3 state switch and what to send via mqtt
-
hello
i'm planning the following setup:
- simple relay + light sensor node => controlling a lamp
on / off is clear. auto should switch on the light when it becomes dark and vice versa. - in openhab i want to so set this lamp to on / off / auto => does this kind of switch exist in openhab?
- if yes: how would the message sent via mqtt look like? The predefined api sub-types won't help me imho, because a V_LIGHT for example does know only two states. or can i set the payload to whatever i want? ie 0=off, 1=on, 3=auto and decide in the sketch what to do?
- simple relay + light sensor node => controlling a lamp
-
I would try to keep the logic at the controller side. You could make two buttons/switches in openhab. One for on/off and one for auto/manual. A sensor for the light level. Combine those with a rule.
-
yep, i'm afraid that's the way to go. Thanks for ACK