I have a custom made device (z-uno) where I trigger actions by using the on or off command, which is represented by a switch.
On the Arduino side:
int getterNull(void) {
// no status, switch only triggers
return 0;
}
void setter(byte value) {
if (value == 0) {
//switch off (charge)
setStatus = 0;
}
else {
//switch on (go)
setStatus = 1;
}
}
I guess I should do return setStatus;
to avoid that issue, but I guess I had a reason for that back then…
Home Assistant seems to have some issues with that, because the status is always off. It turns on and off the switch rapidly - potentially triggering the z-uno to off again.
Is there a way to only send the ON command to the device without “using” the switch?