Z2M response speed and publishing messages in ZHA

Hello,

I use dumb light switches to turn my lights on and off. An AppDaemon app listens for when they are powered on and then publishes a message through Z2M to change their colour based on a few different inputs. It takes three seconds after powering the light on for it to get updated, which can be annoyingly long for the light to be doing the wrong thing. The actual app only takes 0.02 s to run. Before this method I was using an HA automation through ZHA which was much quicker (under 1 s to update after powering on the light), but not as flexible.

I’d like to try my AppDaemon app using ZHA instead of Z2M to see if it will run faster, but I’m not sure how to replicate the ‘publish message’ function that Z2M provides. ‘Set state’ doesn’t update the actual device. Is there an equivalent for communicating with a device through ZHA from AppDaemon? Or even directly from an HA automation. If using ZHA, I only currently know hot to set lights (Tradfri) by automating different scenes, rather than controlling directly.

I’d also be interested to know if anyone has any other suggestions for how to speed up my Z2M communication.

Thank you

Yes, don’t use dumb switches to turn on and off your smart light bulbs.

:rofl: Ha yes, that would solve the issue! :rofl:
Unfortunately, I ruled this out as an option a while ago.
I’m interested in ways to reduce the number of steps in the communication line, or at least understand which step is the time consuming one.