I have some custom switches, i want to turn on a few of them using a script. I’m using switch.turn_on but it seems like its toggling the switches i.e. if the switch is already on, calling the turn_on service is turning it off. Any idea why or how i should be doing this differently ?
The HA config seems fine.
Have you checked on what is behind the MQTT switch if sending “bypass” while the door is already “bypasssed” doesn’t clear it?
ah ! you are right, nothing to do with the switch, if i send a bypass payload to the command topic using MQTT explorer it reverses the current state like a toggle.
Any idea how i prevent the switch from duplicating the command?