crserran / home-alarm

Alexa & Google Home alarm integrations and notifications system for your home security.
https://crserran.github.io/home-alarm
MIT License
22 stars 6 forks source link

Identification #8

Closed rrosson closed 3 years ago

rrosson commented 3 years ago

Question

Currently your documentation states Identification is a work in progress (WiP)

Additional information

Do you know when this is going to be updated. What ideas are you throwing around for implementation?

crserran commented 3 years ago

Hi @rrosson, I will try to update this section by the end of this week. My idea is to show you the identification system that I am currently using at home with an RFID and an ESP32 and show some images about how are the PINs mapped. Anyway you can use Home Alarm without this identification system due to is a complemented system.

LordNex commented 3 years ago

Hi @rrosson, I will try to update this section by the end of this week. My idea is to show you the identification system that I am currently using at home with an RFID and an ESP32 and show some images about how are the PINs mapped. Anyway you can use Home Alarm without this identification system due to is a complemented system.

Hello, I too just came across your system and am trying to integrate it into my HA as well. I think I understand everything except this part like the guy above. If I or a family member comes home, how would they disarm the system when coming in? Could an audible PIN work or some form of a passcode? Or is this something we would just have to have setup as a switch inside HA and just toggle the entire automation off prior to entry. I guess you could use the device location to automatically disable to automation when they enter the geofence. Anyway kinda just thinking out loud. Would love to get your opinion on what you think a good solution would be.

Also one other question. I can make another post if you want. I have a house full of Google Home Minis that I plan on using as the speaker system. If I find an mp3 file that I want to play, where to I store it in the HA file structure? Also, do I need to specify the location to the file in the configuration.yaml entry? Thanks for your hard work!

crserran commented 3 years ago

Hi LordNex! Regarding your first question I will say that there are different options. In my case and for the RFID system that I want to show you, each person that are living in your home needs to have their own RFID tag that can be brought in the set-keys and when one arrives at home they just have to approach the RFID tag to the RFID reader. The other approach that you commented is taking into account the location. In that case you won't need the RFID you just need to program automations to active or deactive the secure mode if someone is at home or not. It is also valid and totally supported by Home Alarm.

Regarding your second question, you have to save your local mp3 files into /config/www folder. That is because that folder serves your files via http(s) and Google Home Minis will be able access to your files by the URL like https://IP:port/local/your_file.mp3. Your apps.yaml should be like this:

home_alarm:
  module: home_alarm
  class: HomeAlarm
  sensors:
    - binary_sensor.entrance_presence_detector
  safe_mode: input_boolean.safe_mode
  activation_delay: 15
  stop_delay: 60
  alerts:
    - id: media_player
      sound: https://YOUR_DNS_NAME/local/alarm.mp3
      volume: 0.8
      media_players:
        - media_player.google_home_1
        - media_player.google_home_2
xaviml commented 3 years ago

Hi guys,

I would like to have a word in this conversation. I am currently using Home Alarm to control my and my parent's alarm system. I don't have any automation related to the alarm in HA except to activate the safe_mode, which is an input boolean. These are how I toggle the safe_mode in each setup:

Having said this, the preferred setup for me would be the one that @crserran has and described, so having an RFID scanner that toggles the safe_mode when an RFID chip gets scanned in the scanner. Here is a nice project that tells you how to set up your own scanner for HA.

Regarding the media player alert, I have it working with 2 Google Home minis and it works like a charm. The only thing to consider is that the GH minis should be able to reproduce media from a HA URL, and this depends on if the router support NAT loopback. In my case it doesn't, so I had to leave HA without SSL and add a reverse proxy with NGINX with the SSL, so I can play a media from my GH minis with a URL like: http://192.168.X.X:8123/local/alarm.mp3.

This is my Home Alarm configuration:

home_alarm:
  module: home_alarm
  class: HomeAlarm
  sensors:
    - binary_sensor.entrance_presence_detector
  safe_mode: input_boolean.safe_mode
  activation_delay: 15
  stop_delay: 120
  alerts:
    - id: media_player
      sound: http://192.168.X.X:8123/local/alarm.mp3
      loop_delay: 31
      volume: 1
      media_players:
        - media_player.office_speaker
        - media_player.livingroom_speaker
    - id: notifier
      notifiers:
        - notify.mobile_app_xavi_mobile
      title: "ALARM ALERT!"
      message: "Someone/something triggered your alarm!"

Regards, Xavi M.

rrosson commented 3 years ago

@crserran I look forward to the update (I am now following your project). My current solution since all my occupants have HA installed on their IOS devices is activate an automation I wrote that sets the input boolean for the proper state along with Alexa Guard. It would be nice if I could have a simple button to use to activate/deactivate my automations but that is a little off topic from this topic and your project.

LordNex commented 3 years ago

Hi LordNex! Regarding your first question I will say that there are different options. In my case and for the RFID system that I want to show you, each person that are living in your home needs to have their own RFID tag that can be brought in the set-keys and when one arrives at home they just have to approach the RFID tag to the RFID reader. The other approach that you commented is taking into account the location. In that case you won't need the RFID you just need to program automations to active or deactive the secure mode if someone is at home or not. It is also valid and totally supported by Home Alarm.

Regarding your second question, you have to save your local mp3 files into /config/www folder. That is because that folder serves your files via http(s) and Google Home Minis will be able access to your files by the URL like https://IP:port/local/your_file.mp3. Your apps.yaml should be like this:

home_alarm:
  module: home_alarm
  class: HomeAlarm
  sensors:
    - binary_sensor.entrance_presence_detector
  safe_mode: input_boolean.safe_mode
  activation_delay: 15
  stop_delay: 60
  alerts:
    - id: media_player
      sound: https://YOUR_DNS_NAME/local/alarm.mp3
      volume: 0.8
      media_players:
        - media_player.google_home_1
        - media_player.google_home_2

Rrosson, thanks for the reply and suggestions. I might look into RFIDs down the road as I was looking at them for a more direct presence detection for rooms (between that and multi-sensors), so it may be something I add on along with electronic locks. Ultimately I’d like to have all of these then function together as one cohesive system.

There was also another project I was looking at that actually feed google_tts a recorded mp3 file from the Home speaker, be processed, and then feed back to home assistant and in input string. I’m wondering if we can do something like that would then allow a spoken PIN to be checked against a file and if correct, disable the alarm. Obviously this would be after you unlocked the door and entered and for some reason HA did not automatically disable the alarm via automation. It would give another quick and cool way to disable the alarm without fumbling around for your phone and waking your family in the middle of the night with a false alarm. Anyway just a thought.

Additionally, I have my google homes grouped into a speaker group called Whole Home. Can I specify that entity to play the alarm? I figured I could, just figured I’d ask

And finally in regards to the above code. Do I need to store that in the directly in the configuration.yaml? I have my automations broken out to a separate file. Is it ok to just include the home_alarm: integration there?

I’m sure ill have more but this is pretty cool. Should be able to do some neat stuff with this. Need to work on a cool Lovelace card to display all this!

LordNex commented 3 years ago

Well looks like I must have it wrong from the beginning somewhere. When I I put your code with my data of course. I get an error of integration not found when I run a configuration check. HACS is installed and your component installed and up to date there. Am I missing something?

Edit: sorry I found it at /config/appdaemon/apps/apps.yaml Let me know if pasting it here is wrong

xaviml commented 3 years ago

Hi @LordNex,

This app is an AppDaemon app, so AppDaemon is needed to run it. Do you have it installed? If so, could you share the logs in here to see what the problem is? Also, the configuration must be placed in /config/appdaemon/apps/apps.yaml once AppDaemon addon is up and running. If you don't have AppDaemon, then these are the steps:

Let me know if you have any problems with the above procedure :)

Regards, Xavi M.

LordNex commented 3 years ago

Hi @LordNex,

This app is an AppDaemon app, so AppDaemon is needed to run it. Do you have it installed? If so, could you share the logs in here to see what the problem is? Also, the configuration must be placed in /config/appdaemon/apps/apps.yaml once AppDaemon addon is up and running. If you don't have AppDaemon, then these are the steps:

  • Uninstall Home Alarm if you have it installed
  • Delete /config/appdaemon folder if you already install Home Alarm from HACS
  • Install AppDaemon 4 from the addon-store
  • Start the addon
  • Wait until everything is working and no errors are raised in the AppDaemon logs
  • Reinstall Home Alarm.
  • Copy the configuration in /config/appdaemon/apps/apps.yaml. This file should already exist with a hello_world example.
  • Restart the AppDaemon addon and check logs. You should see something like: INFO home_alarm: 🚨 Home Alarm security system v2.3.0.

Let me know if you have any problems with the above procedure :)

Regards, Xavi M.

Xavi,

Yes I had appdaemon installed, just never really used it much so I’m pretty new to it. I was able to locate the apps.yaml and add my code. Restarted AppDaemon and here is the end of my log output.

2020-10-12 22:20:03.117875 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_alert/__init__.py - ignoring
2020-10-12 22:20:03.121978 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_alert/switch.py - ignoring
2020-10-12 22:20:03.125960 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_alert/notifier.py - ignoring
2020-10-12 22:20:03.130458 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_alert/light.py - ignoring
2020-10-12 22:20:03.134525 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_core/alert.py - ignoring
2020-10-12 22:20:03.138643 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_core/state.py - ignoring
2020-10-12 22:20:03.142468 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_utils/ha_funcs.py - ignoring
2020-10-12 22:20:03.146601 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_utils/ha_const.py - ignoring
2020-10-12 22:20:03.150680 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2020-10-12 22:20:03.154879 INFO AppDaemon: Initializing app home_alarm using class HomeAlarm from module home_alarm
2020-10-12 22:20:03.356611 INFO hello_world: Hello from AppDaemon
2020-10-12 22:20:03.359373 INFO hello_world: You are now ready to run Apps!
2020-10-12 22:20:03.372603 INFO home_alarm: 🚨 Home Alarm security system v2.3.0
2020-10-12 22:20:03.384883 INFO AppDaemon: App initialization complete
2020-10-12 22:20:03.389112 WARNING home_alarm: home_alarm: Entity input_boolean.safe_mode not found in namespace default

Do I need to add input_boolean.safe_mode In the integration code?

xaviml commented 3 years ago

Hi @LordNex,

Do I need to add input_boolean.safe_mode In the integration code?

Yes, input_boolean.safe_mode needs to exists as an entity in Home Assistant. You can either create it through configuration.yaml or through UI in the Helpers menu from Configuration. Then you will probably need to restart AppDaemon again.

Home Alarm will listen to the state changes for that input boolean, which you can toggle manually or automatically, and trigger an alarm if it is "on" and there is movement in the sensors listed in the sensor list.

Cheers, Xavi M.

crserran commented 3 years ago

Hi everybody,

I have updated the documentation for the RFID system. Here you have the link, enjoy!

If you have any question or inconvenience, please let me know and open another issue if needed I'm going to close this one.

Thank you for the support!