Hey everyone, I wanted to share my recent success in setting up a rule to control my pool heater switches. I was struggling with creating a rule that would make two switches mutually exclusive, meaning only one switch can be ON at any given time. Here’s how I tackled it:
First, I identified the issue: when I turned on one switch, the other switch would briefly turn on as well, causing both to be ON for a few milliseconds. This was problematic because it could potentially cause overheating or other issues.
To solve this, I created a rule that intercepts the ON command for one switch and checks if the other switch is already ON. If it is, the rule sends an OFF command to the second switch before processing the ON command for the first switch. Here’s the rule I used:
plaintext
rule “Pool Heater Turns Spa Heater OFF”
when
Item channel3 received command ON
then
if (channel4.state == ON) {
sendCommand(channel4, OFF)
}
end
This rule ensures that only one switch can be ON at any time, preventing any overlap. I tested it extensively, and it worked perfectly! The brief delay between the OFF command and the ON command was eliminated, and now only one switch can be active at a time.
I hope this helps anyone else who’s struggling with similar issues. If you have any questions or need further assistance, feel free to reach out!