Integration Home Assistant and TUYA and N8N

I’m experiencing an issue with the integration between Home Assistant and devices connected via TUYA. When I send a state with the value OFF to Home Assistant, the state changes correctly in Home Assistant, but the device does not turn off in TUYA.

However, if I use the button directly in Home Assistant to control the device, it works perfectly, and the device responds in TUYA as expected.

Has anyone encountered this issue before or have any suggestions to resolve this inconsistent behavior?

I don’t know N8N, but it looks like you are forcing the state of the entity, here. That won’t trigger any automations and it seems it doesn’t work for Tuya, either.

You should do a service call (light.turn_off)