Exploring MQTT Light Control Workarounds

I’ve been diving into the world of MQTT and smart lighting, and I wanted to share my experiences and some troubleshooting tips that might help others facing similar issues.

Recently, I set up my lights using MQTT, and while it’s been a great experience overall, I encountered an interesting challenge. My lights don’t provide state feedback, so I’ve been relying on blind commands to turn them on or off. This setup works well most of the time, but there are specific scenarios where simply sending a 0 payload to turn off the light doesn’t work as expected. Instead, I noticed that I need to first send a higher value before sending the 0 command to ensure the light turns off properly.

To address this, I’ve been experimenting with a workaround that involves sending two payloads in sequence. Here’s a snippet of my current setup:

command_topic: “casambi/0/set/scene_level”
payload_on: “‘{“scene”: 12, “level”: 254, “duration”: 50}’”
payload_off: “‘{“scene”: 12, “level”: 0, “duration”: 50}’”

What I’d like to achieve is having payload_off first send a value of 1 and then 0 to ensure the light turns off reliably. I’m curious if anyone has successfully implemented a similar two-step payload approach or if there are alternative solutions to handle this scenario more efficiently.

If anyone has tips or alternative methods for handling such cases, I’d love to hear about them! It’s always great to learn from the community and find innovative solutions to these challenges. Happy tinkering! :rocket: