[SOLVED][Help] Zigbee Relay State Not Updating When Triggered via PyScript/Developer Tools

Hi everyone,

I’m experiencing an issue while migrating my home automation system from Node-RED to Home Assistant, specifically with my pellet stove management.

I’m using a Zigbee relay (TYZGTH1CH-D1RF) for ignition. The relay works perfectly when activated from the dashboard, but it doesn’t behave as expected when I try to change its state through:

  • PyScript
  • Developer Tools

In these cases, the dashboard interface updates correctly, but the state change is not transmitted to the physical device.

My setup uses Zigbee2MQTT as it provides better compatibility with my devices.

Would anyone have any insight into what might be missing in my configuration?

I expected Home Assistant to transmit the state change to the device regardless of the method used to trigger it.

Thanks in advance for your help.

Can’t speak about PyScript, but changing the state in Dev Tools > State > Set State will only change state in HA. It does not actually send any commands to the relay.

If you want to send a toggle command to the relay via Dev Tools, you need to go to the Action tab and send a switch.toggle action with your relay entity as the target:

action: switch.toggle
target:
  entity_id: switch.your_relay
data: {}
1 Like

Thanks for the hint.

Pyscript allows to use entities names to trigger python functions and also to use these names to change the states. The state is indeed changed but it does transmit to the end device. This is confusing.

So in fact I have to call the service switch.toggle, switch.turn_on and so on.

Thank you for the help !

1 Like

Welcome. Please mark my previous post with the solution tag so that others with the same question can identify the answer immediately.