Code Monkey home page Code Monkey logo

ad_who_used_the_door's Introduction

Home Assistant Who Used the Door Sensor & Notifications

hacs_badge
Buy Me A Coffee

Who Used the Door app for AppDaemon.

This creates 2 sensors that peel the last opened and last closed timestamp out of a binary_sensor/sensor door. This also will notify users of the following events:

  • Who used the door with a time and date stamp. This includes intruder tracking. e.g. if an unknown person opens the door, a listener will be created and listen for a known person to show up. If the known person shows up within 90 seconds, a message will be sent saying that the person who used the door is {name}.
  • If the door is open for more than {duration}.
  • How many times the door has been opened over the past {quiet_window} period. (to keep the messages down)

I'm reluctant to share this app because it can be very annoying. This is something that I wrote many years ago and never bothered changing the functionality. I am open to suggestions for making this less notification heavy.

Requirements

This requires the People Tracker appdaemon app.

Installation

Download the who_used_the_door directory from inside the apps directory to your local apps directory, then add the configuration to enable the hacs module.

Example App configuration

Basic, No notifications

# Creates 2 sensors sensor.main_door_last_opened, and  sensor.main_door_last_closed
main_door:
  module: who_used_the_door
  class: WhoUsedTheDoor
  sensor: sensor.main_door
  people_tracker: sensor.people_tracker
  message_name: Main Door

Advanced

# Creates all notifications
main_door:
  module: who_used_the_door
  class: WhoUsedTheDoor
  sensor: sensor.main_door
  people_tracker: sensor.people_tracker
  message_name: Main Door
  notify:
    door_ajar:
      timestamp: '%-I:%M:%S %p'
      duration: 120
      notify:
      - notify.petro
    door_open:
      timestamp: '%-I:%M:%S %p'
      quiet_window: 120
      notify:
      - notify.petro

App Configuration

key optional type default description
module False string who_used_the_door The module name of the app.
class False string WhoUsedTheDoor The name of the Class.
sensor False string entity_id of the door sensor.
people_tracker False string entity_id of the people tracker sensor.
message_name True string <sensor.attributes.friendly_name> Name of the door for your notifications.
open_name True string <sensor.attributes.friendly_name> Last Opened Name of the Last Opened sensor.
close_name True string <sensor.attributes.friendly_name> Last Closed Name of the Last Closed sensor.
notify True map door_ajar | door_open open or ajar notification map, see below.
log_level True 'INFO' | 'DEBUG' 'INFO' Switches log level.

Ajar Notification Map Configuration

key optional type default description
notify False list list of notify entity_ids.
title True string Title of the notifications.
timestamp True string Timestamp format for messages. Use '%-I:%M:%S %p' for 12 hr notation and '%-H:%M:%S' for 24 hr notation.
duration True int 30 If the door is open longer than this time, send a message.

Open Notification Map Configuration

key optional type default description
notify False list list of notify entity_ids.
title True string Title of the notifications.
timestamp True string Timestamp format for messages. Use '%-I:%M:%S %p' for 12 hr notation and '%-H:%M:%S' for 24 hr notation.
quiet_window True int 0 After the first door open, a quiet window will activate. During this window, all door open messages will be suppressed. After the window is met, a final message will appear with a count of door opens. 0 = no quiet window. I created this because I found that we would open the door in bursts and we didn't want 900000000 messages.

ad_who_used_the_door's People

Contributors

petro31 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

ad_who_used_the_door's Issues

Ensure entity_id's are correct in format, warn user.

Hey i try getting your app running but get this error:

2020-01-31 23:47:54.122672 WARNING AppDaemon: ------------------------------------------------------------


2020-01-31 23:47:59.417896 WARNING AppDaemon: ------------------------------------------------------------


2020-01-31 23:47:59.418653 WARNING AppDaemon: Unexpected error during process_event()


2020-01-31 23:47:59.419355 WARNING AppDaemon: ------------------------------------------------------------


2020-01-31 23:47:59.420350 WARNING AppDaemon: Traceback (most recent call last):


  File "/usr/lib/python3.8/site-packages/appdaemon/events.py", line 179, in process_event


    await self.AD.state.process_state_callbacks(namespace, data)


  File "/usr/lib/python3.8/site-packages/appdaemon/state.py", line 199, in process_state_callbacks


    cdevice, centity = callback["entity"].split(".")


ValueError: too many values to unpack (expected 2)




2020-01-31 23:47:59.420770 WARNING AppDaemon: ------------------------------------------------------------


what does this mean?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.