#Set MQTT Switch to neither ON nor OFF

1 messages · Page 1 of 1 (latest)

vital veldt
#

I would like to create an MQTT switch where its state can be ON, OFF or PENDING. The latter would be used to show that the state has not been confirmed. The frontend seems to be able to handle it exactly the way I wanted; by showing a switch that is neither ON nor OFF. I can put the entity in this state by using the developer tools' "set state" feature.
However if I try to set the state via the MQTT topic, it doesn't get accepted.
Is there a way to work around it or do I need to write my own integration?

gilded silo
#

is it neither or both? schrodinger's switch?

gilded silo
vital veldt
#

Got it! Thanks for the hint.
Sending unknown as payload didn't work, but I actually started poking around in the source code and found that if the payload is None it sets the state to python's None and in turn will be interpreted as unknown.