Since upgrading to AD4, a number of my automation that use listen_state have been behaving erratically. did this method change?
one example is an automation i have looking at my temp sensors and using any change in Temp or Hum to calculate a feels like. The way I used the listen state is
self.listen_state(self.state_change_detected, self.args[“humsensor”])
self.listen_state(self.state_change_detected, self.args[“tempsensor”])
where the call back reads the values and calcs the feels like.
I am getting this error now
2020-03-15 00:43:40.236844 WARNING masterfeelsliketemp: ------------------------------------------------------------
2020-03-15 00:48:26.635880 WARNING studyfeelsliketemp: ------------------------------------------------------------
2020-03-15 00:48:30.010356 WARNING studyfeelsliketemp: Unexpected error in worker for App studyfeelsliketemp:
2020-03-15 00:48:30.012044 WARNING studyfeelsliketemp: Worker Ags: {‘id’: ‘61621241aac74f04ba14f2c6dc0e3ad0’, ‘name’: ‘studyfeelsliketemp’, ‘objectid’: ‘f5c8ec1faaa64708a0cf4936c6a1fe75’, ‘type’: ‘state’, ‘function’: <bound method FeelsLikeTempStateChange.state_change_detected of <set_feels_like_temp_state.FeelsLikeTempStateChange object at 0x7f5a8bc4f8e0>>, ‘attribute’: ‘state’, ‘entity’: ‘sensor.temperature_sensor_58’, ‘new_state’: ‘21.80’, ‘old_state’: ‘21.70’, ‘pin_app’: True, ‘pin_thread’: 10, ‘kwargs’: {‘__thread_id’: ‘thread-10’}}
2020-03-15 00:48:30.193852 WARNING studyfeelsliketemp: ------------------------------------------------------------
2020-03-15 00:48:30.195114 WARNING studyfeelsliketemp: Traceback (most recent call last):
File “/usr/local/lib/python3.8/site-packages/appdaemon/threading.py”, line 777, in worker
funcref(entity, attr, old_state, new_state,
File “/conf/apps/set_feels_like_temp_state.py”, line 39, in state_change_detected
self.get_sensor_values()
File “/conf/apps/set_feels_like_temp_state.py”, line 58, in get_sensor_values
self.set_state(self.args[“apparentsensor”], state = heatIndex, attributes = {“friendly_name”: self.args[“apperentfriendlyname”],“unit_of_measurement”: “°C”, “icon”: “mdi:thermometer” })
File “/usr/local/lib/python3.8/site-packages/appdaemon/utils.py”, line 191, in inner_sync_wrapper
f = run_coroutine_threadsafe(self, coro(self, *args, **kwargs))
File “/usr/local/lib/python3.8/site-packages/appdaemon/utils.py”, line 285, in run_coroutine_threadsafe
result = future.result(self.AD.internal_function_timeout)
File “/usr/local/lib/python3.8/concurrent/futures/_base.py”, line 441, in result
raise TimeoutError()
concurrent.futures._base.TimeoutError
and a lot of these in my info file
2020-03-17 10:55:15.953361 INFO AppDaemon: Adding thread 51
2020-03-17 10:55:16.990201 CRITICAL AppDaemon: Thread thread-10 has died
2020-03-17 10:55:16.991131 CRITICAL AppDaemon: Pinned apps were: [‘studyfeelsliketemp’]
2020-03-17 10:55:16.991752 CRITICAL AppDaemon: Thread will be restarted
2020-03-17 10:55:16.992358 INFO AppDaemon: Adding thread 10
2020-03-17 10:55:16.994937 CRITICAL AppDaemon: Thread thread-51 has died
2020-03-17 10:55:16.995575 CRITICAL AppDaemon: Pinned apps were:
2020-03-17 10:55:16.996107 CRITICAL AppDaemon: Thread will be restarted
This was working fine before I upgraded to AD4, any help much appreciated.
thanks