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

Google home and telegram? #6

Closed camui-alexandru closed 4 years ago

camui-alexandru commented 4 years ago

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:

crserran commented 4 years ago

Hi @camui-alexandru, sorry for the delay answering I was out in the weekend.

I guess the problem with the google home mini comes from sound attribute in the media player alert. To reproduce your mp3 file you have to write the full URL of your Home Assistant instance including the mp3 file like this: https://{YOUR_IP_OR_DNS}:{PORT}/local/Alert.mp3

Regarding the telegram notifications I recommend you to test it in your HA going to Developer Tools and services. Write your notifier in the service input and in details in YAML write message: "This is a test!". If this step works, you can write me and we check what is happening with the telegram notifications in your case.

I hope I helped you :)

camui-alexandru commented 4 years ago

So, this is my set:

home_alarm: module: home_alarm class: HomeAlarm sensors:

The message: "This is a test!" in Developer Tools, is working. With this set neither the telegram and the google home mini isn't workin.

crserran commented 4 years ago

Hello @camui-alexandru, it is good that telegram notifier is working from developer tools.

Did you write this yaml configuration in apps.yaml from appdaemon folder? Are you able to see appdaemon logs from supervisor? If so, you can send me the logs and we can see if there are some errors. It would be interesting also that I could see your yaml indentation. You can format your yaml with this string ``yaml and closing with 3 more like this:

```yaml home_alarm: test: test ```

home_alarm:
  test: test

I also suggest that you use your IP instead of "homeassistant" in your sound attribute.

Let me know when you tried it and we will try to solve it asap :)

camui-alexandru commented 4 years ago

This is the LOG from AppDaemon:

[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. [13:20:57] INFO: Starting AppDaemon... 2020-07-29 12:20:59.861759 INFO AppDaemon: AppDaemon Version 4.0.3 starting 2020-07-29 12:20:59.862479 INFO AppDaemon: Python version is 3.8.2 2020-07-29 12:20:59.863006 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml 2020-07-29 12:20:59.863919 INFO AppDaemon: Added log: AppDaemon 2020-07-29 12:20:59.864344 INFO AppDaemon: Added log: Error 2020-07-29 12:20:59.864843 INFO AppDaemon: Added log: Access 2020-07-29 12:20:59.865514 INFO AppDaemon: Added log: Diag 2020-07-29 12:20:59.942023 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin 2020-07-29 12:21:00.011707 INFO HASS: HASS Plugin Initializing 2020-07-29 12:21:00.012709 INFO HASS: HASS Plugin initialization complete 2020-07-29 12:21:00.014421 INFO AppDaemon: Initializing HTTP 2020-07-29 12:21:00.015733 INFO AppDaemon: Using 'ws' for event stream 2020-07-29 12:21:00.047340 INFO AppDaemon: Starting API 2020-07-29 12:21:00.058384 INFO AppDaemon: Starting Admin Interface 2020-07-29 12:21:00.059661 INFO AppDaemon: Starting Dashboards 2020-07-29 12:21:00.095369 INFO HASS: Connected to Home Assistant 0.113.2 2020-07-29 12:21:00.128874 WARNING AppDaemon: App 'input_boolean' missing 'class' or 'module' entry - ignoring 2020-07-29 12:21:00.130756 INFO AppDaemon: App 'hello_world' added 2020-07-29 12:21:00.131693 INFO AppDaemon: App 'home_alarm' added 2020-07-29 12:21:00.133831 INFO AppDaemon: Found 2 total apps 2020-07-29 12:21:00.135042 INFO AppDaemon: Starting Apps with 2 workers and 2 pins 2020-07-29 12:21:00.137968 INFO AppDaemon: Running on port 5050 2020-07-29 12:21:00.231809 INFO HASS: Evaluating startup conditions 2020-07-29 12:21:00.272225 INFO AppDaemon: Got initial state from namespace default 2020-07-29 12:21:02.153520 INFO AppDaemon: Scheduler running in realtime 2020-07-29 12:21:02.164349 INFO AppDaemon: Adding /config/appdaemon/apps to module import path 2020-07-29 12:21:02.166256 INFO AppDaemon: Adding /config/appdaemon/apps/home-alarm to module import path 2020-07-29 12:21:02.169330 INFO AppDaemon: Adding /config/appdaemon/apps/home-alarm/ha_utils to module import path 2020-07-29 12:21:02.170731 INFO AppDaemon: Adding /config/appdaemon/apps/home-alarm/ha_alert to module import path 2020-07-29 12:21:02.171668 INFO AppDaemon: Adding /config/appdaemon/apps/home-alarm/ha_core to module import path 2020-07-29 12:21:02.194810 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py 2020-07-29 12:21:02.242574 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/home-alarm/home_alarm.py 2020-07-29 12:21:02.282520 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_version.py - ignoring 2020-07-29 12:21:02.285180 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_utils/ha_funcs.py - ignoring 2020-07-29 12:21:02.287843 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_utils/ha_const.py - ignoring 2020-07-29 12:21:02.289848 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_alert/light.py - ignoring 2020-07-29 12:21:02.293503 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_alert/media_player.py - ignoring 2020-07-29 12:21:02.295809 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_alert/xiaomi_gateway.py - ignoring 2020-07-29 12:21:02.298319 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_alert/init.py - ignoring 2020-07-29 12:21:02.300643 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_alert/notifier.py - ignoring 2020-07-29 12:21:02.302877 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_core/state.py - ignoring 2020-07-29 12:21:02.305237 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/home-alarm/ha_core/alert.py - ignoring 2020-07-29 12:21:02.307098 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello 2020-07-29 12:21:02.310071 INFO AppDaemon: Initializing app home_alarm using class HomeAlarm from module home_alarm 2020-07-29 12:21:02.502034 INFO hello_world: Hello from AppDaemon 2020-07-29 12:21:02.504793 INFO hello_world: You are now ready to run Apps! 2020-07-29 12:21:02.527105 INFO home_alarm: 🚨 Home Alarm security system v2.2.2 2020-07-29 12:21:02.545999 INFO AppDaemon: App initialization complete 2020-07-29 12:21:02.550268 WARNING home_alarm: home_alarm: Entity input_boolean.safe_mode not found in namespace default

And this is the apps yaml:

hello_world:
  module: hello
  class: HelloWorld

input_boolean:
  safe_home:
    name: Safe Home
    icon: mdi:alarm-light

home_alarm:
  module: home_alarm
  class: HomeAlarm
  sensors:
    - binary_sensor.usa_intrare
    - binary_sensor.usa_spate
    - binary_sensor.usa_terasa_dreapta
    - binary_sensor.usa_terasa_stanga
  safe_mode: input_boolean.safe_mode
  alerts:
    - id: media_player
      sound: http://homeassistant:8123/local/Alert.mp3
      loop_delay: 2
      media_players:
        - media_player.livingroom_speaker
        - media_player.master_bedroom_speaker
    - id: notifier
      notifiers:
        - notify.telegram
      message: Alarma s-a declansat la {sensor}
camui-alexandru commented 4 years ago

I put the input boolean in apps.yaml and still not working. In configuration.yaml, not working too.

crserran commented 4 years ago

Hi @camui-alexandru, thank you for sharing your configuration.

The input boolean safe_mode has to be defined in your configuration.yaml.

input_boolean:
  safe_home:
    name: Safe Home
    icon: mdi:alarm-light

Once you have it, you need to restart HomeAssistant. Then, you have to go to your apps.yaml and correct the typing error of your safe_mode like this:

home_alarm:
  module: home_alarm
  class: HomeAlarm
  sensors:
    - binary_sensor.usa_intrare
    - binary_sensor.usa_spate
    - binary_sensor.usa_terasa_dreapta
    - binary_sensor.usa_terasa_stanga
  safe_mode: input_boolean.safe_home
  alerts:
    - id: media_player
      sound: http://homeassistant:8123/local/Alert.mp3
      loop_delay: 2
      media_players:
        - media_player.livingroom_speaker
        - media_player.master_bedroom_speaker
    - id: notifier
      notifiers:
        - notify.telegram
      message: Alarma s-a declansat la {sensor}

With this configuration it should work. I also recommend you to change your sound url. Replace homeassistant with your Home Assistant IP address.

camui-alexandru commented 4 years ago

10x a lot ! Now, the log seems fine, I have to get home to test it. I have another question, I made a button for activating the safe home. Is there any solution to use a PIN to activate it and deactivate it ? Like an alarm arming/disarming ?

crserran commented 4 years ago

Good news!

Yes, I am actually using an RFID system that I have made myself. I would like to well document it and publish for everybody. I use and ESP32 as a microcontroller and RC522 acting as a RFID reader like the followings images:

IMG_2262 IMG_2261

I hope that I can publish it soon :)

crserran commented 4 years ago

Here you have the correct photos

photo_2020-07-29_14-13-56 photo_2020-07-29_14-13-53

camui-alexandru commented 4 years ago

Yea cool! But i was wondering în home assistant ui if i ca-n enable the safe home with a pin

crserran commented 4 years ago

Maybe this can help you but I haven't use it before:

https://www.home-assistant.io/lovelace/alarm-panel/ https://www.home-assistant.io/integrations/manual/