Should I check the state of a switch before sending a command?

I am looking for input on best practices with a timed motion sensing switch. I’m using an all-Z-Wave setup and OpenHABian on a lightweight x86 box. I have a set of timed motion sensor rules (using the expire binding as documented in @rlkoshak’s design pattern), and they works great.

My question is whether it makes sense, from a technical or practical perspective, to check the state of a switch before I send it an ON command, and only send if the switch is OFF? Put differently, if a motion sensor turns on the light, and repeated motion triggers keep sending more ON commands, does this cause any harm aside from cluttering my log?

No harm and you can filter the log to get rid of all the motion triggers see this link.

1 Like

You might also consider the device technology involved; it might be undesirable to repeatedly transmit commands over some wireless tech, or clutter some limited bandwidth channel, etc.