Control a space heater

My office is cold. Iā€™ve got a space heater Iā€™m trying to manage with Rule Machine to warm the area around my desk. I want to have Rule Machine turn on an Aeotec Smart Switch, a plug that turns on the heater.

I want to limit the heater to turn on when an Aeotec motion/temp sensor falls below 68ĀŗF, there is active motion, the mode is day or evening, and itā€™s between September 15 and April 30th. I have another rule to turn off the heater when the temp rises above 68ĀŗF.

I must have an error in my logic. In manage conditions (see the screen grab), two conditions are marked as ā€œUnused.ā€ I want both unused conditions to be actively considered before turning the plug on. I assume the word ā€œunusedā€ means the condition is not considered. How do I solve this?

One way to go is to enable USE REQUIRED EXPRESSION, in order to utilize those conditions.

I think you need to change the Actions to a conditional action. (IF, Then, Else).

The On: P-Office -Plug statement would be nested in the if loop where all conditions are true

S

2 Likes

You created the conditions, but haven't used them anywhere in the rule yet.

1 Like

Showing my ignorance. In reading the manual, I understood the managed conditions all had to be true to continue with the rule. Is that where the conditional statement must be entered?

Think of it this way. You just defined the conditions. Now you need to tell Rule Machine how to use them.

See the picture I added above.

The "use required expression" section does allow you to use preconditions that must be true, or the rule won't activate. This is a bit different in my mind. I might put mode in there, and perhaps even time of day, to restrict a rule, but based on what you are doing, conditional actions would seem more appropriate,

S

3 Likes

The conditions being true or not don't have anything to do with building the rule per se - that's just the current state of the condition (is it true right now or not).

You don't have to define conditions before building the rule - you can always just add conditions as you build instead.

The Manage Conditions window is just where the conditions all end up, whether built preemptively or built as you go.

Then later on, if you need to change any condition(s), they're simply easier to access/manage from that window instead of having to dig into the guts of the rule itself.

For smaller rules, that's not a big deal, but for larger rules and/or rules where you use the same condition in multiple places, it helps a ton.

3 Likes

Using "Required Expression", it could look something like this:

The advantage to this approach, is that it makes the conditional actions easier to read.

Note, this probably won't work as well as you hope, without some additional logic.

Motion sensors tend to reset fairly quickly, and generally are less sensitive to small motions than gross motion.

You may want to put a time element, such as a delay, that resets on motion to prevent your heater from cycling.

Perhaps something like this:

Essentially, if I've written it right (RM syntax has changed a bit over the versions), this basically activates the switch on motion, oh, crap, i forgot the motion trigger!!! ...anyway when the trigger activates, it turns on the switch, then when it goes inactive waits five minutes and powers the switch off. Unless the rule is retriggered by the motion event I forgot, in which case, the delay is canceled, and the switch remains on.

Ill have to rewrite this to make it work. I messed up the trigger. But i hope it helps you do what you wanted to do.

S.

2 Likes

I do this with a virtual thermostat. Also there is a App that can handle this that is pretty easy to setup and is available in HPM.

1 Like