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

Since update #4

Closed titelies closed 4 years ago

titelies commented 4 years ago

@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

crserran commented 4 years ago

Hello @titelies I guess the error could be related to the breaking changes on the new release. Take a look on the new yaml structure, now we have a list of alerts and media players should be inside that list like this:

home_alarm:
  module: home_alarm
  class: HomeAlarm
  sensors:
    - binary_sensor.livingroom_window_contact
    - binary_sensor.entrance_door_contact
    - binary_sensor.entrance_motion_occupancy
  safe_mode: input_boolean.safe_mode
  alerts:
    - id: media_player
      sound: amzn_sfx_scifi_alarm_04
      loop_delay: 4
      media_players: 
        - media_player.alexa
        - media_player.alexa2
    - id: notifier
      notifiers:
        - notify.mobile_app_iphone
        - notify.notifier

That error you send me looks like the app cannot parse the “id” from the alerts list.

I hope it helps 😊

titelies commented 4 years ago

I edited apps.yaml to with your sample and then modified with my sensors, media players, and notifiers, and those are the warnings I get in the log. I uninstalled the Home Alarm from HACS and installed again and the same error messages are reporting. My apps.yaml: home_alarm: module: home_alarm class: HomeAlarm sensors:

crserran commented 4 years ago

@titelies yaml seems correct. Let me say something quite obvious... Try to restart AppDeamon Integration from Supervisor, maybe it doesn't get the dependencies of the project correctly. Let me know when you do it :)

titelies commented 4 years ago

Tried the restart of AppDaemon and a reinstall of it as well. Still the same errors. Sorry @crserran I'm really trying here... Don't want to be a bother.

2020-06-12 18:19:51.136776 INFO AppDaemon: Initializing app home_alarm using class HomeAlarm from module home_alarm 2020-06-12 18:19:51.319277 INFO home_alarm: Welcome to Home Alarm security system. 2020-06-12 18:19:51.323316 WARNING home_alarm: ------------------------------------------------------------ 2020-06-12 18:19:51.324152 WARNING home_alarm: Unexpected error in worker for App home_alarm: 2020-06-12 18:19:51.324931 WARNING home_alarm: Worker Ags: {} 2020-06-12 18:19:51.325733 WARNING home_alarm: ------------------------------------------------------------ 2020-06-12 18:19:51.327045 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 2020-06-12 18:19:51.327760 WARNING home_alarm:

titelies commented 4 years ago

Uninstalled Home Alarm 2.0 from HACS and a number of other apps from HACS, uninstalled AppDaemon4, deleted AppDaemon directory and everything inside. Restarted HA, installed new AppDaemon4, no errors, install Home Alarm 2.0 and pasted your sample with my info into apps.yaml, go check AppDaemon after restart and it keeps terminating AppDaemon.

Just uninstalled Home Alarm 2.0, AppDaemon 4 and deleted the directory again. Started everything from scratch, installed AppDaemon4 and Home Alarm 1.0, no error messages using the apps.yaml info for 1.0. Looks to be working, will test the alarm during the day. I'll stick with version 1.0 for now. Thanks again for your continued support.

crserran commented 4 years ago

Hello @titelies yesterday I was trying to reproduce your error on my HA but without success. Could you share your YAML indented or an screenshot of your apps.yaml please, just to have more information.

No worries, we will find the problem and we will solve it!

titelies commented 4 years ago

So, it looks like stopping Appdaemon4, installing Home Alarm 2 and pasting your config into apps.yaml and then editing it to my settings, saving and restarting Home Assistant then coming back to Appdaemon and starting it now no errors with the updated Home Alarm and successfully tested! Thanks @crserran for your patience and support.

crserran commented 4 years ago

Good news! If you have some more troubles don't hesitate to ask me. Sorry for the inconveniences and thank you @titelies! 😄