Coder Social home page Coder Social logo

home-assistant-apps's Introduction

home-assistant-apps

Home Assistant apps based on AppDaemon. A sample configuration for all apps is located here: sample_config/apps.yaml

AlarmSystem

The idea is to notify if an intrusion is detected. The system arms itself if all device_trackers are marked away and disarms if any device_tracker is back home. For me the system works perfectly without manual intervention. In order to allow baby sitters or other guest without residents you can enable a guest mode.

This system work with any light system (should support color) and with any sensors who report on/off values. I have tested it with xiaomi hub, sensors, buttons. Some disscusion can be found in the forum

Key Description Default
language language used for notifcations in text and audio english
device_trackers list of tracked devices (for auto arming / disarming) []
armed_home_binary_sensors list of binary sensors to monitor (like doors, motion, sensors) in case you are home []
armed_away_binary_sensors list of binary sensors to monitor (like doors, motion, sensors) in case you are away []
water_binary_sensors list of binary sensors to monitor (like water leakage sensors) all the time []
fire_binary_sensors list of binary sensors to monitor (like water smoke sensors) all the time []
fire_temperature_sensors list of temperature sensors to monitor (like temperature sensors) all the time []
armed_home_image_processing_sensors list of image processing sensors to monitor in case you are home []
armed_away_image_processing_sensors list of image processing sensors to monitor in case you are away []
alarm_control_buttons list of buttons to control (single click arm_away, double click disarm, long pres arm_home) []
alarm_lights list of lights to indicate alarm status (red is triggered, blinking is pending) []
alarm_arm_night_after_time time to arm at evening 23:15:00
alarm_arm_night_before_time time to disarm at morning 06:00:00
sleep_after_time start of sleeptime at evening 23:15:00
sleep_before_time end of sleeptime at morning 06:00:00
vacation_control input boolean to configure a vacation mode which arms using armed_vacation None
guest_control input boolean to configure a babysitter mode which does not auto arm None
silent_control input boolean to mute the alarm sound None
siren_switches list of siren switches to turn on or off []
notify_service script to call for notification None
notify_title title parameter for script AlarmSystem triggered, possible intruder
cameras List of cameras (snapshots will be made once alarm is triggered) []
camera_snapshot_path Path for storing camera snapshots /tmp
camera_snapshot_regex Regex for camera snapshots "camera_.*\d+_\d+.jpg"
alexa_monkeys list of alexa voice monkeys for audio notifications []
telegram_user_ids list of telegram user ids used for notifications []

HeatSaver

This app controls the temperature based on the opening and closing of windows/doors and some global control settings. Tt saves heating by lowering the thermostat if you are away or a window is open.

Key Description Default
device_trackers list of tracked devices []
door_window_sensors list of sensors to monitor (like doors, motion, sensors) []
climate_controls list of cliamte controls []
guest_control input boolean to configure a babysitter mode which does not shut down heating None
vacation_control input boolean to configure a vacaction mode which lowers temperatures None
offset_temperature offset temperature 0
home_temperature_control slider to control temperature of the state at home None
away_temperature_control slider to control temperature of the state at away None
vacation_temperature_control slider to control temperature of the state at vacation None
open_temperature_control slider to control temperature of the state at open None

LightSaver

This app controls the lights based on motion sensors, sun elevation, illumination level and some global control settings. It saves energy by switching lights off.

Key Description Default
device_trackers list of tracked devices []
motion_sensors list of sensors to monitor for motion []
lights list of lights []
guest_control input boolean to configure a babysitter mode which does not switch off lights None
vacation_control input boolean to configure a vacaction mode which switches off lights None
motion_duration time for no motion until lights are switched off 180
tracker_duration time for tracker not_home until lights are switched off 60
vacation_duration time for vation mode until lights are switched off 60
min_elevation min evelation which turns lights on 10
min_illumination min illumination which turns lights on 15
night_scene scene to use for night lights None
night_start start time for night mode 23:15:00
night_end start time for night mode 06:30:00
evening_scene scene to use for evening lights None
off_scene scene to use for lights off None

PowerSaver

This app controls the devices based on motion sensors and some global control settings. It saves energy by switching devices off.

Key Description Default
device_trackers list of tracked devices []
motion_sensors list of sensors to monitor for motion []
power_controls list of power_controls []
guest_control input boolean to configure a babysitter mode which does not switch off lights None
vacation_control input boolean to configure a vacaction mode which switches off lights None
motion_duration time for no motion until lights are switched off 180
tracker_duration time for tracker not_home until lights are switched off 60
vacation_duration time for vation mode until lights are switched off 60

home-assistant-apps's People

Contributors

runningman84 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

home-assistant-apps's Issues

changes in new alarm.py

Hi Philipp, which changes you have applied to AlarmSystem configuration?
with the new alarm.py system is not armed by input_boolean like this do not works...

  - alias: system alarm home on
    trigger:
      platform: state
      entity_id: input_boolean.systemalarm_home
      to: 'on'
    action:
      service: alarm_control_panel.alarm_arm_home
      data: {"entity_id":"alarm_control_panel.ha_alarm","code":"1234"}

I saw you changed

  • armed_home_sensors: to armed_home_binary_sensors:
  • armed_away_sensors: to armed_away_binary_sensors:

other changes?

2 or 3 booleans in 1 input_select?

tip: instead of using different input.booleans for operation modes like "guest" or "vacation" would 1 input_select not be better? Can't really see any practical situation where both would be valid.

Cleans up code and UI/UX imho

After upgrade HA to 0.66.1 System Alarm don't start automatically

I'm using HASSIO v. 0.99, after I upgraded HA from v. 0.65.5 to v. 0.66.1 System Alarm do not start automatically.
This is my automation... until v. 0.65.5 it worked fine...

  - alias: system alarm HOME automatic on
    trigger:
      platform: time
      hours: 23
      minutes: 30
      seconds: 00
    condition:
      condition: or
      conditions:
      - condition: state
        entity_id: device_tracker.samsung_s8_wifi
        state: 'home'
      - condition: state
        entity_id: device_tracker.samsung_s8_bt
        state: 'home'
      - condition: state
        entity_id: device_tracker.huawei_p8_wifi
        state: 'home'
      - condition: state
        entity_id: device_tracker.huawei_p8_bt
        state: 'home'
    action:
      service: alarm_control_panel.alarm_arm_home
      data: {"entity_id":"alarm_control_panel.ha_alarm","code":"12345678"}

Continuous toggle ON/OFF when auto insert armed home

Hi!
I updated to the new version of your app. At the moment everything is running smooth except that at the time I set for the auto arm home the system became crazy and start changing it's status in armed_home, disarmed.
I tried to change the behaviour of the app changing those 2 line of code.

self.listen_state(self.alarm_disarm_auto_callback, sensor, old="not_home", new="home", duration=i)
self.listen_state(self.alarm_arm_home_auto_state_change_callback, sensor, old="not_home", new="home", duration=15 * 60 + 1)
        i += 1

Basically I added the old sstatus, obviously the second one does not start anymore because it can happen that I am at home for more than 15 minutes.
Did you observe anything strange with those callbacks?
A better way to solve the continuous state toggle?

Thank you!

Errors after upgade to AppDaemon3

Hi, after upgrade from AppDaemon2 to Appdaemon3 in the AppDaemon3 log I found the following error...

2018-04-07 10:51:54.617550 WARNING AppDaemon: ------------------------------------------------------------
2018-04-07 10:51:54.618057 WARNING AppDaemon: Unexpected error running initialize() for alarm_system
2018-04-07 10:51:54.618623 WARNING AppDaemon: ------------------------------------------------------------
2018-04-07 10:51:54.620238 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 1513, in init_object
    init()
  File "/config/appdaemon/apps/alarm.py", line 51, in initialize
    self.count_home_device_trackers(), self.count_not_home_device_trackers()))
  File "/config/appdaemon/apps/alarm.py", line 132, in count_home_device_trackers
    return self.count_device_trackers("home")
  File "/config/appdaemon/apps/alarm.py", line 127, in count_device_trackers
    if self.get_state(sensor) == state:
  File "/usr/lib/python3.6/site-packages/appdaemon/appapi.py", line 214, in get_state
    return self.AD.get_state(namespace, device, entity, attribute)
  File "/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 644, in get_state
    return deepcopy(self.state[namespace])
KeyError: 'device_tracker.samsung_s8_wifi'
2018-04-07 10:51:54.620816 WARNING AppDaemon: ------------------------------------------------------------

Panic mode?

A suggestion.... it could be useful to create a "panic mode" to be activated through a switch button (or using le long_click mode) that immediately activates the alarm without waiting for pending mode?

Schedule a time range where AlarmSystem is disarmed

Currently AlarmSystem is armed every time for x minutes if no presence is detected inside the house.
But there are situations where it is necessary that AlarmSystem to remain disarmed for example between 2:00 pm and 6:00 pm even if no presence is detected at home., or you can program that every Wednesday remains disarmed between 14:00 and 18:00.
Is it possible to schedule a period of time for a given day or for every day during which Alarm System remains disarmed for both the home and away function?

Notify if Xiaomi Gateway or some sensor is not working

I found that if the Xiaomi Gateway is disconnected, the AlarmSystem will continue to work and send arming and disarming messages. But obviously, no alarm works.
First of all it should check if Xiaomi Gateway and sensors are online and otherwise send a notification message saying that AlarmSystem cannot be activated, or the alarm is activated but the xxx sensor is not active. This could be very useful

Alarm is disarmed if in "armed_home" a new device was detected

If the alarmsystem is in the state "armed_home" and a new device in "device_trackers" is detected (e.g. I active BT or wifi of my android phone)... system change the status in "disarmed".
This don't have to happens whem alarmsystem is "armed_home" but only in "armed_away".

my alarm system do not works

Hi, from some weeks my alarm system do not works..... until I used the version 2021.11.4 it works fine.
After I update HA to 2021.12.5 it do not works.
It works only if I manually call the service alarm_control_panel arm_home the entity alarm_control_panel.ha_alarm or by a switch that start an automation to turn on or off the alarm.
Auto arm function of alarm.py do not works
the Xiaomi Aqara Gateway do not change colors in pending, home or away mode and do not play any sound
If I open a window in armed mode it do not change the status of alarm.

Appdaemon works fine
What could be happened?

error about camera_snapshot

Often after alarm_system activation in Appdaemon it show errors about camera_snapshot... can you help me?
I have Home Assistant Hassio v. 0.83.2

2019-01-16 18:09:08.108181 INFO alarm_system: Starting camera snapshot timer
2019-01-16 18:09:09.010918 WARNING AppDaemon: ------------------------------------------------------------
2019-01-16 18:09:09.012404 WARNING AppDaemon: Unexpected error in worker for App alarm_system:
2019-01-16 18:09:09.014793 WARNING AppDaemon: Worker Ags: {'name': 'alarm_system', 'id': UUID('6de5b787-b9a0-4064-bdfe-428fa1669380'), 'type': 'timer', 'function': <bound method AlarmSystem.camera_snapshot of <alarm.AlarmSystem object at 0x746650f0>>, 'kwargs': {}}
2019-01-16 18:09:09.018667 WARNING AppDaemon: ------------------------------------------------------------
2019-01-16 18:09:09.021501 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 586, in worker
    funcref(self.sanitize_timer_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/alarm.py", line 287, in camera_snapshot
    self.log("Camera snapshot {} stored as {}".format(self._snap_count, filename))
UnboundLocalError: local variable 'filename' referenced before assignment
2019-01-16 18:09:09.024166 WARNING AppDaemon: ------------------------------------------------------------

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.