I have the same problem here, everytime I restart Home assistant, I get this error for all my zwave switches.
I have to wait a few seconds and then restart appdaemon to get rid of this error.
It’s almost like appdaemon is starting before all my zwave device are discovered.
Is there anyway to delay the startup of appdaemon?
2018-03-31 12:36:43.000305 WARNING AppDaemon: ------------------------------------------------------------
2018-03-31 12:36:43.031501 WARNING AppDaemon: ------------------------------------------------------------
2018-03-31 12:36:43.032640 WARNING AppDaemon: Unexpected error running initialize() for Pantry Light Automation
2018-03-31 12:36:43.033631 WARNING AppDaemon: ------------------------------------------------------------
2018-03-31 12:36:43.037337 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/Light Automation/light_automation.py”, line 18, in initialize
self.listen_state(self.reset_flag ,self.args[“switch”],new=‘off’,duration=10,immediate=True) #reset flag after 10 sec
File “/usr/lib/python3.6/site-packages/appdaemon/plugins/hass/hassapi.py”, line 86, in listen_state
return super(Hass, self).listen_state(namespace, cb, entity, **kwargs)
File “/usr/lib/python3.6/site-packages/appdaemon/appapi.py”, line 180, in listen_state
return self.AD.add_state_callback(name, namespace, entity, cb, kwargs)
File “/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py”, line 594, in add_state_callback
if self.state[namespace][entity][“state”] == kwargs[“new”]:
KeyError: ‘switch.pantry_room_light’
2018-03-31 12:36:43.038704 WARNING AppDaemon: ------------------------------------------------------------
2018-03-31 12:36:43.049880 WARNING AppDaemon: ------------------------------------------------------------
2018-03-31 12:36:43.050966 WARNING AppDaemon: Unexpected error running initialize() for Master Bedroom
2018-03-31 12:36:43.052341 WARNING AppDaemon: ------------------------------------------------------------
2018-03-31 12:36:43.055784 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/Light Automation/light_automation.py”, line 18, in initialize
self.listen_state(self.reset_flag ,self.args[“switch”],new=‘off’,duration=10,immediate=True) #reset flag after 10 sec
File “/usr/lib/python3.6/site-packages/appdaemon/plugins/hass/hassapi.py”, line 86, in listen_state
return super(Hass, self).listen_state(namespace, cb, entity, **kwargs)
File “/usr/lib/python3.6/site-packages/appdaemon/appapi.py”, line 180, in listen_state
return self.AD.add_state_callback(name, namespace, entity, cb, kwargs)
File “/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py”, line 594, in add_state_callback
if self.state[namespace][entity][“state”] == kwargs[“new”]:
KeyError: ‘switch.master_bedroom_light’