reverse binary switch message
-
i use binary switch sketch to monitor working electrical appliances through 220v contactor with closes the circuit of the switch.
unfortunatley, in domoticz, when the circuit is opened (no contact between pin3 and GND) it shows ON which is the opposite of my intention.
i tried messing with the code and writing low to the pin instead of high but it didnt work.
another solution is to use Normally Closed contactor so it will show default off and when the contactor will turn on, the arduino circuit will be opened and the domoticz will show this as on, but, i didnt find any 1phase contactor with NC terminal, only 3phase which are too much wide for my box.is there any way to reverse the message from the node?
maybe something with this line:gw.send(msg1.set(value == HIGH ? 1 : 0));
maybe changing the 1 with the 0 ?
-
-
@martinhjelmare said:
Hi!
Yes, you're correct.
Thanks, but for which part do you mean I'm correct? The problem or changing the 1 and 0?
-
You can reverse the message by flipping 1 and 0.
-
@martinhjelmare
Great! I'll try it tomorrow.
Thanks a lot