Hi Folks,
Looking for your help/suggestion!
What is the best way to implementation of one global state listener to callback multiple depending apps?
Like, listening for device_tracker state and callback two or more apps.
Thanks in advance,
Alex
Hi Folks,
Looking for your help/suggestion!
What is the best way to implementation of one global state listener to callback multiple depending apps?
Like, listening for device_tracker state and callback two or more apps.
Thanks in advance,
Alex
Hello,
Do you mean you want to listen to a device tracker, and call multiple callbacks within different apps?
if i understand correct you would for example want to listen to device_tracker.a with this:
self.listen_state(self.callback,"device_tracker.a")
and use the result in different apps, correct?
that itself is very easy.
just use that line in every app you want.
even in the same app you can listen to the same entity multiple times, like:
self.listen_state(self.callback,"device_tracker.a")
self.listen_state(self.another_callback,"device_tracker.a")
But if I correctly understand this way is going to start multiple listeners, which could be a result of unnecessary of system usage, even could be a result of “WARNING AppDaemon: Scheduler clock skew detected”, which I would like to avoid.
i think i got near to a thousand listeners.
thats really something you only want to think about when you start optimalising stuff, but then you really need to have deep knowledge about the system and programming.
appdaemon is created just to be able to do it that way.
clock skew detection is not something that will be caused by using multiple listeners. that is caused by apps hanging up the system.
i dont know what you have running on your system, but with only HA and AD you shouldnt get clock skews even when you have 10.000 listeners on an RPI.
I agree with Rene, callbacks have by design very low impact on system resource usage.