crserran / home-alarm Goto Github PK
View Code? Open in Web Editor NEWAlexa & Google Home alarm integrations and notifications system for your home security.
Home Page: https://crserran.github.io/home-alarm
License: MIT License
Alexa & Google Home alarm integrations and notifications system for your home security.
Home Page: https://crserran.github.io/home-alarm
License: MIT License
I have setup an HA automation that uses Alexa Guard as a trigger and Home Alarm as as action... I currently have an automation setup so when the Alexa Guard state changes from disarmed to armed_away, then the Action type Condition > State > input_boolean.safe_mode to on (but the action never happens). And vice versa, when the Alexa Guard state changes from armed_away to disarmed the Action type Condition > State > input_boolean.safe_mode to off (doesn't work either).
Any idea why or advice to offer....
I'm wanting to make my lights toggle on and off, or red and blue for colored, when the alarm triggers. I've looked through the documentation but couldn't find anything there.
I could try and setup a webhook maybe and have the alarm systems try and use that address as an mp3 path. But that would also break the audio.
Any idea of a way to do this?
home_alarm:
module: home_alarm
class: HomeAlarm
sensors:
# - binary_sensor.garage_motion
- binary_sensor.kitchen_window
- binary_sensor.back_door
- binary_sensor.back_door_tamper_sensor
safe_mode: input_boolean.safe_mode
activation_delay: 15
stop_delay: 300
alerts:
- id: media_player
sound: https://mydomain.duckdns.org:8123/local/MainAlarm.mp3 #https://bigsoundbank.com/UPLOAD/mp3/0268.mp3
volume: 1
loop_delay: 4
media_players:
- media_player.living_room_speaker
- media_player.master_bedroom_speaker
- media_player.bathroom_speaker
- media_player.xxxxx_s_room_speaker
- id: notifier
notifiers:
- notify.mobile_app_wwwww
- notify.mobile_app_yyyyy_
- notify.mobile_app_zzzzz
- notify.mobile_app_xxxxx
- notify.notify
title: "ALARM ALERT! {sensor} has triggered!"
message: "Someone/something triggered your Home Alarm! Better check {sensor} and see whats up!!"
(optional) Add relevant AppDaemon / Home Assistant logs which could help answering the question.
Add any other context or screenshots about the question here.
No
While I was testing the home-alarm it was confuse to capture the current state of the program. So, should be nice to have a sensor that displays the current state of the home-alarm, with the following values:
Also this sensor confirms if the system is currently armed without any bug or stopped process, being "secure" to leave the house.
Should be nice to have another sensor that displays the device name that triggered the alarm.
Currently your documentation states Identification is a work in progress (WiP)
Do you know when this is going to be updated. What ideas are you throwing around for implementation?
I think would be good to add not only windows/doors sensor, but motion sensor as well.
These can trigger an alarm as well.
If so, then add a clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
When the Alarm is triggered, announce what sensor triggered the alarm. This can be more helpful in the middle of the night than just a loud noise. Plus in the case that someone does break it would be rather disturbing that the system announces the location intruder based on what sensor was triggered.
As an example, I currently have my alarm Konnected system set up in NR and a function that derives the announcement that will be sent to all my google home speakers based on the event that triggered the alarm. It would be nice if this AD addin could do something similar. I have been thinking about tackling this myself, but my AD coding skills are not on par with yours. For example, I have yet to understand how to use async
and await
functions effectively, but see you use them quite extensively. I assume this is to basically setup a separate "thread" for each entity. Anyway, I thought I would make the suggestion here in case you would be willing to do the changes necessary to get it working as described.
var ghmsgPending='A-Pending-Alarm-has-been-triggered-by-the-' + msg.sensorName + '.';
var ghmsgTriggered='The-Security-Alarm-has-been-triggered-by-the-' + msg.sensorName + '.';
var ghmsgDisarmed='The-Security-Alarm-has-been-Disarmed.';
flow.set('textMessage', null);
var textMessage
if (msg.payload == 'pending') {
textMessage = ghmsgPending;
}
if (msg.payload == 'triggered') {
textMessage = ghmsgTriggered;
}
if (msg.payload == 'disarmed'){
textMessage = ghmsgDisarmed;
}
flow.set('textMessage', textMessage);
msg.textMessage=flow.get('textMessage');
return msg;
Node-Red
A clear and concise description of any alternative solutions or features you've considered.
Node-Red Flows, but I would prefer migrating this to AD so that I could have test cases that I could run after each HA update just to make sure nothing is broken by the latest release. I recently discovered that my alarm hadn't been working since May when apparently there was some breaking change related to tts.google_say.
Add any other context or screenshots about the feature request here.
@crserran Getting these error messages now since running the HACS update for Home Alarm:
2020-06-10 14:47:56.743479 INFO home_alarm: Welcome to Home Alarm security system.
2020-06-10 14:47:56.748133 WARNING home_alarm: ------------------------------------------------------------
2020-06-10 14:47:56.750332 WARNING home_alarm: Unexpected error in worker for App home_alarm:
2020-06-10 14:47:56.752129 WARNING home_alarm: Worker Ags: {}
2020-06-10 14:47:56.755031 WARNING home_alarm: ------------------------------------------------------------
2020-06-10 14:47:56.757847 WARNING home_alarm: Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/appdaemon/app_management.py", line 143, in initialize_app
await init()
File "/config/appdaemon/apps/home-alarm/home_alarm.py", line 22, in initialize
alert_list = self.parse_alerts(alert_configs)
File "/config/appdaemon/apps/home-alarm/home_alarm.py", line 79, in parse_alerts
alert_cls = alerts_dict.get(alert_config["id"])
TypeError: string indices must be integers
Any advice to offer, I'm currently investigating those lines mentioned here...
Wondering if the one issue might be to my configuration of AppDaemon 4 looking like this:
system_packages: []
python_packages: []
init_commands: []
log_level: info
Thank you for this very interesting project.
Everything works fine except the LED which does not light up when the save-mode is activated.
Does the led work with MQTT?
I don't have an esphome / safe-mode topic as described in the configuration ...
Can someone help me please?
The documentation says a door or window sensor is required. Could this not work with any sensor such as a motion sensor?
For example, I have Blink camera's that I use to detect motion in my house to alert me.
Hi, this looks really neat! I was thinking that it would be great if you could add support to fire a switch as well as light/notifier/media_player. It would be useful for activating an actual siren or other equipment. Thanks!
Should the directory name be home_alarm or home-alarm. The info on this page: https://crserran.github.io/home-alarm/installation/ shows home_alarm but the install from HACS creates a directory named home-alarm. HACS only adds the 1 file: home_alarm.py while the manual install shows 3 other directories: ha_alert, ha_core, ha_utils.
Not sure how to complete the setup, the identification page is also incomplete.
Any info is greatly appreciated, really looking forward to getting this working.
The following message is displayed in the log window of AppDaimon when I disable the alarm:
Invalid callback handle '45508543bb864246b28d95d8ea67d5c9' in cancel_timer() from app home_alarm
home_alarm:
module: home_alarm
class: HomeAlarm
sensors:
- binary_sensor.123
- binary_sensor.345
safe_mode: input_boolean.alarme
safe_mode_delay: 90
activation_delay: 10
stop_delay: 240
alerts:
- id: media_player
sound: amzn_sfx_scifi_alarm_04
loop_delay: 4
volume: 0.9
media_players:
- media_player.alexa_1
- media_player.alexa_2
- id: switch
switches:
- switch.sonoff_100023456
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] appdaemon.sh: executing...
[cont-init.d] appdaemon.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[16:34:35] INFO: Starting AppDaemon...
2022-01-08 20:34:39.906084 INFO AppDaemon: AppDaemon Version 4.2.0 starting
2022-01-08 20:34:39.906695 INFO AppDaemon: Python version is 3.9.7
2022-01-08 20:34:39.907317 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2022-01-08 20:34:39.908159 INFO AppDaemon: Added log: AppDaemon
2022-01-08 20:34:39.908853 INFO AppDaemon: Added log: Error
2022-01-08 20:34:39.909482 INFO AppDaemon: Added log: Access
2022-01-08 20:34:39.910334 INFO AppDaemon: Added log: Diag
2022-01-08 20:34:39.965415 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2022-01-08 20:34:40.062594 INFO HASS: HASS Plugin Initializing
2022-01-08 20:34:40.063372 INFO HASS: HASS Plugin initialization complete
2022-01-08 20:34:40.064977 INFO AppDaemon: Initializing HTTP
2022-01-08 20:34:40.066154 INFO AppDaemon: Using 'ws' for event stream
2022-01-08 20:34:40.075582 INFO AppDaemon: Starting API
2022-01-08 20:34:40.084259 INFO AppDaemon: Starting Admin Interface
2022-01-08 20:34:40.085611 INFO AppDaemon: Starting Dashboards
2022-01-08 20:34:40.127790 INFO HASS: Connected to Home Assistant 2021.12.8
2022-01-08 20:34:40.193978 INFO AppDaemon: App 'hello_world' added
2022-01-08 20:34:40.197898 INFO AppDaemon: App 'home_alarm' added
2022-01-08 20:34:40.200094 INFO AppDaemon: Found 2 total apps
2022-01-08 20:34:40.201508 INFO AppDaemon: Starting Apps with 2 workers and 2 pins
2022-01-08 20:34:40.204304 INFO AppDaemon: Running on port 5050
2022-01-08 20:34:40.363351 INFO HASS: Evaluating startup conditions
2022-01-08 20:34:40.402316 INFO HASS: Startup condition met: hass state=RUNNING
2022-01-08 20:34:40.403198 INFO HASS: All startup conditions met
2022-01-08 20:34:40.475890 INFO AppDaemon: Got initial state from namespace default
2022-01-08 20:34:40.686203 INFO AppDaemon: New client Admin Client connected
2022-01-08 20:34:42.217506 INFO AppDaemon: Scheduler running in realtime
2022-01-08 20:34:42.234351 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2022-01-08 20:34:42.235432 INFO AppDaemon: Adding /config/appdaemon/apps/home-alarm to module import path
2022-01-08 20:34:42.236381 INFO AppDaemon: Adding /config/appdaemon/apps/home-alarm/ha_core to module import path
2022-01-08 20:34:42.237476 INFO AppDaemon: Adding /config/appdaemon/apps/home-alarm/ha_utils to module import path
2022-01-08 20:34:42.238515 INFO AppDaemon: Adding /config/appdaemon/apps/home-alarm/ha_alert to module import path
2022-01-08 20:34:42.269186 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py
2022-01-08 20:34:42.286239 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/home-alarm/home_alarm.py
2022-01-08 20:34:42.308065 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_version.py - ignoring
2022-01-08 20:34:42.311618 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_core/state.py - ignoring
2022-01-08 20:34:42.316467 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_core/alert.py - ignoring
2022-01-08 20:34:42.320452 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_utils/ha_const.py - ignoring
2022-01-08 20:34:42.324265 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_utils/ha_funcs.py - ignoring
2022-01-08 20:34:42.329063 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_alert/switch.py - ignoring
2022-01-08 20:34:42.333573 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_alert/notifier.py - ignoring
2022-01-08 20:34:42.337413 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_alert/xiaomi_gateway.py - ignoring
2022-01-08 20:34:42.341529 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_alert/light.py - ignoring
2022-01-08 20:34:42.346851 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_alert/media_player.py - ignoring
2022-01-08 20:34:42.350975 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_alert/init.py - ignoring
2022-01-08 20:34:42.354239 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2022-01-08 20:34:42.360700 INFO AppDaemon: Initializing app home_alarm using class HomeAlarm from module home_alarm
2022-01-08 20:34:42.579849 INFO hello_world: Hello from AppDaemon
2022-01-08 20:34:42.583012 INFO hello_world: You are now ready to run Apps!
2022-01-08 20:34:42.599634 INFO home_alarm: 🚨 Home Alarm security system v2.3.0
2022-01-08 20:34:42.621075 INFO AppDaemon: App initialization complete
2022-01-08 20:34:54.973451 INFO AppDaemon: Client disconnection from Admin Client
2022-01-08 20:34:55.394441 INFO AppDaemon: New client Admin Client connected
2022-01-08 20:38:18.021304 INFO home_alarm: Safe mode activated
2022-01-08 20:39:01.219270 INFO home_alarm: Movimento no Escrit��rio activated
2022-01-08 20:39:01.223831 INFO home_alarm: safe_mode
state: on
2022-01-08 20:39:01.228009 INFO home_alarm: safe_mode_active
state: True
2022-01-08 20:39:11.018536 INFO home_alarm: The alarm has been triggered
2022-01-08 20:40:41.012321 INFO home_alarm: Alarm has been disarmed
2022-01-08 20:40:41.025354 INFO home_alarm: Stopping media services...
2022-01-08 20:40:41.030568 INFO home_alarm: Stopping switches...
2022-01-08 20:40:41.046367 WARNING AppDaemon: Invalid callback handle '45508543bb864246b28d95d8ea67d5c9' in cancel_timer() from app home_alarm
2022-01-08 20:40:43.017637 INFO home_alarm: Alarm has been stopped
2022-01-08 20:41:31.573485 INFO home_alarm: Movimento no Escrit��rio activated
2022-01-08 20:41:31.576864 INFO home_alarm: safe_mode
state: off
2022-01-08 20:41:31.579961 INFO home_alarm: safe_mode_active
state: False
2022-01-08 20:44:32.275119 INFO home_alarm: Movimento no Escrit��rio activated
2022-01-08 20:44:32.283734 INFO home_alarm: safe_mode
state: off
2022-01-08 20:44:32.293065 INFO home_alarm: safe_mode_active
state: False
2022-01-08 20:47:59.390872 INFO home_alarm: Movimento no Escrit��rio activated
2022-01-08 20:47:59.395028 INFO home_alarm: safe_mode
state: off
2022-01-08 20:47:59.398804 INFO home_alarm: safe_mode_active
state: False
2022-01-08 20:49:12.013077 INFO home_alarm: Movimento no Escrit��rio activated
2022-01-08 20:49:12.023230 INFO home_alarm: safe_mode
state: off
2022-01-08 20:49:12.030176 INFO home_alarm: safe_mode_active
state: False
2022-01-08 20:51:43.596142 INFO home_alarm: Movimento no Escrit��rio activated
2022-01-08 20:51:43.599595 INFO home_alarm: safe_mode
state: off
2022-01-08 20:51:43.602906 INFO home_alarm: safe_mode_active
state: False
Add any other context or screenshots about the bug here.
Hello, and 10x for your work.
I have 2 google home mini and this is not working. The telegram notifier not working too.
If I check the appdaemon callbacks, it shows the fired events ov the door, but no sound in google home players or the telegram notifier.
I have this config:
home_alarm:
module: home_alarm
class: HomeAlarm
sensors:
- binary_sensor.door_front
- binary_sensor.door_back
- binary_sensor.door_left
- binary_sensor.door_right
safe_mode: input_boolean.safe_mode
alerts:
- id: media_player
sound: /local/Alert.mp3
loop_delay: 2
media_players:
- media_player.livingroom_speaker
- media_player.master_bedroom_speaker
- id: notifier
notifiers:
- notify.telegram
title: "ALERT! {sensor}"
message: "Alarm at sensor {sensor}"
Hello, NeX again.
Good news I got everything almost working. Lovelace is setup. Got 3 sensors installed and more on the way from Amazon. Issue I'm having mainly is getting it to fire the mp3 as an alarm. I first put the mp3 in the local/www directory on HA. Apps.yaml below. But when I did I would get a volume change sound on each speaker about every 2 seconds when triggered, but it would never fire the mp3.
I figured maybe us was due to the LetsEncrypt SSL I have on so instead I found a mp3 housed on an outside web server that was completely public. When I trigger the alarm with this I again get the volume increase sound, over and over every 2 seconds, until I toggle the alarm off in Lovelace. Once I do that it will play one loop of the mp3 on my bedroom_speaker but nothing on the whole_house group I have set.
I'm going to try and remove the grouping and send the command to each speaker individually, but the fact that I did that with the bedroom_speaker and it didn't play tells me somethings off. Any suggestions would be wonderful. Let me know if you need any logs.
`---
hello_world:
module: hello
class: HelloWorld
home_alarm:
module: home_alarm
class: HomeAlarm
sensors:
- binary_sensor.garage_motion
- binary_sensor.side_door_tamper_alert
- binary_sensor.kitchen_window
safe_mode: input_boolean.safe_mode
activation_delay: 15
stop_delay: 120
alerts:
- id: media_player
sound: https://bigsoundbank.com/UPLOAD/mp3/0268.mp3
volume: 1
loop_delay: 2
media_players:
- media_player.whole_house
- media_player.master_bedroom_speaker
- id: notifier
notifiers:
- notify.mobile_app_iphone_inator
title: "ALARM ALERT!"
message: "Someone/something triggered your Home Alarm! Better check and see whats up!!" `
Configuration.yaml
'``binary_sensor:
- platform: mqtt
state_topic: "RF_Bridge/tele/RESULT"
name: 'Garage Motion'
unique_id: "garage_motion"
value_template: '{{value_json.RfReceived.Data}}'
payload_on: "EF641E"
off_delay: 15
device_class: motion
qos: 1
# retain: false
- platform: mqtt
state_topic: "RF_Bridge/tele/RESULT"
name: 'Side Door Tamper Alert'
unique_id: "side_door_tamper"
value_template: '{{value_json.RfReceived.Data}}'
payload_on: "E2B5EB"
off_delay: 10
device_class: problem
qos: 1
- platform: mqtt
state_topic: "RF_Bridge/tele/RESULT"
name: 'Kitchen Window '
unique_id: "kitchen_window"
value_template: '{{value_json.RfReceived.Data}}'
payload_on: "3820B9"
off_delay: 30
device_class: window
qos: 1
`'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.