Quickly alternating relay state

Hello,
I’m trying to figure out how feasible something is: I have a regular security/motion detector light that can be set to “Always on” by toggling the switch it’s connected to off and on rapidly (3 times “off-on” in 3 seconds I believe). I thought it would be handy to put that on a Zigbee relay so I could automate the manual override.

However, it seems that the signal getting from HA to the relay isn’t consistently quick enough to flick through 6 state transitions in 3 seconds. Sometimes a command to toggle the relay takes a second or so from initiating the command in the UI to the relay reacting.

Is it unrealistic to try to do this with HA, or do I just need a different setup/hardware?

The main controller is across the room, so not far away. I’m using Zigbee.

Thanks

How are you currently testing this exactly? Are you switching on & off manually from the dashboard or triggering a script/automation via the UI?

If via script/automation, those on/off commands are sent at practically the same time, so try adding a slight delay between commands to avoid race conditions:

  • switch.toggle
  • delay 0.05s
  • switch.toggle
  • delay 0.05s
  • etc…

I believe I tried both methods, but based on what you’ve said I’ll test the automation again in case I had something set up weird.