I can't grasp rm4 yet. Someone make me a space heater rule to review?

I have a supplemental, low-wattage heater in the office. Its onboard rheostat stays set to max. I have a temperature sensor (Office Sensor) in the room and the heat is plugged into a Zigbee outlet (Office Outlet).

On weekdays between 5 am and 7 pm, I want to turn the heater on if the temperature is below 70F and off any time it reaches 75F.

I really feel dumb, but in my defense, my HE has been rock-solid and I ain't had to even look at a dashboard much less hang any code since rm2.5.

I have done this 2 different ways, one entirely in RM. One using a virtual thermostat. Which one do you want?

Entirely RM, please.

Doing this from memory

trigger:
Time becomes 5AM or
Time becomes 7pm or
Temperature of Office sensor <70
Temperature of Office sensor >75

Actions:
If not time between 5AM and 7pm then
Heater off
exit rule
end if
if temperature >75 then
Heater on
else if temperature <70 then
Heater off
end if

Now I also add an extra rule that creates a variable that is true if the temp sensor has updated in the last hour, and use that variable to turn off the heater, I can add that code as well

1 Like

What he said, except the opposite on the temperature actions. OFF at 75, and ON at 70. :smile:

1 Like

oops, that is why we don't do things from memory!!!:blush:

Thanks! I can see one mistake I was making already. I'll give it a go.