After a few upgrades (Home Assistant (Core) from 0.104.x to 0.106.2; AppDaemon from 3.0.5 to 4.0.3), my script for integrating device trackers has been acting odd.
The last working version (which has been unaltered from August to now) is this.
At present, the life360 and google maps device_trackers don’t seem to update (except life360 did seem to update for one person an hour or so ago). The “Ping” tracker seems to work in the AD script, at least for me it has updated the “meta tracker”. but only for me.
The app seems to crash continuously, the appdaemon log shows (repeatedly):
2020-02-29 23:46:25.225704 INFO AppDaemon: Reloading Module: /conf/appdaemon/apps/device_tracker/meta_device_tracker.py
2020-02-29 23:46:25.229088 INFO AppDaemon: Initializing app meta_tracker using class MetaTracker from module meta_device_tracker
2020-02-29 23:46:50.686623 INFO AppDaemon: Terminating meta_tracker
2020-02-29 23:46:50.690260 INFO AppDaemon: Reloading Module: /conf/appdaemon/apps/device_tracker/meta_device_tracker.py
2020-02-29 23:46:50.693693 INFO AppDaemon: Initializing app meta_tracker using class MetaTracker from module meta_device_tracker
2020-02-29 23:46:50.707424 WARNING AppDaemon: Log formatting error - 'not all arguments converted during string formatting'
2020-02-29 23:47:52.100706 INFO AppDaemon: Terminating meta_tracker
2020-02-29 23:47:52.104361 INFO AppDaemon: Reloading Module: /conf/appdaemon/apps/device_tracker/meta_device_tracker.py
2020-02-29 23:47:52.108092 INFO AppDaemon: Initializing app meta_tracker using class MetaTracker from module meta_device_tracker
2020-02-29 23:49:13.696024 INFO AppDaemon: Terminating meta_tracker
with nothing in the error log.
I can’t really see what should have broken it. Other AppDaemon scripts work fine (after upgrading from 4.0.2 -> 4.0.3 at least), and the individual device trackers seem t work fine. And I couldn’t see anything in the release notes that would make this make sense for me…
@sj3fk3 Thanks, but that might have been from when I was messing with the script, so I don’t think that part is relevant.
It started after having worked fine for 6 months. So something happened after these upgrades, and before I started changed anything in the script.
If I manually change the state of my device trackers (e.g. life360), then it runs, and updates the meta_tracker. But It won’t do it on its own; only the ping device tracker seems to update. Maybe there was a change in one of the updates (Appdaemon or Home Assistant) to how an “update” that doesn’t change the state is handled? E.g. if device_tracker.life360 is updated, but the state doesn’t change, it seems (my best guess for now) that the AppDaemon script doesn’t fire via the self.listen_state anymore. Would that make sense? That this has changed in those updates?
I’m currently noticing issues with the life360 and google maps device trackers.
I also did an upgrade from Appdaemon 3 to 4 and run into the same issue. My motion sensors (Xiaomi Aqara Human Body Sensor) initially triggered the lights but then any continous movement afterwards (which results in another message while the sensor entity stays at “detected”) didn’t restart my timers. Although I set force_update to true.
So, the simple example self.listen_state(self.motion_detected_callback, motion_entity, new="on") IMHO doesn’t work with the Aqara motion sensors that stay “on” for 60 seconds and AppDaemon 4. It only works if after 60 seconds the sensor turns back to “off”, but not for a continous movement.