I have been migrating across from STT and webCoRE recently and am seeking advise regarding Rules.
Currently I have a lot of Triggered Rules, 1 for ON capability and 1 for OFF capability.
Here is an example, where I am encapsulating the change in power to determine if an outdoor PIR security light is either ON or OFF.
I am trying to simplify the number of Rules I have and wondering if I can do this via a single Rule?
If power_level > 5 then
turn ON
else
turn OFF
endif
Yeah I see triggers rules as something for when you want it to only evaluate once ON the trigger for something like your set-up a standard rule is better. IE one of my rules is between 40 after sunset and 9am do close blind else open them. Where as I also have a z-wave contact that turns on a ZigBee device. So for that I need a trigger rule because
If contact opens or closes and switch is off do turn ON else turn OFF. In a standard rule this would make the lights flash ON and OFF in a never ending loop. Because the condition is always true then false then true.....(contact is always open or closed and light is always ON or OFF) it constantly evaluated.
Triggers are most often used when there is no False Action needed.
Rules are most often used when there are both True Actions and False Actions.
Triggered Rules are used when the conditions may switch between true and false and true BUT you care about their condition ONLY at the moment of a trigger event.
I have quite a few of my Lighting Rules split between Turn On and Turn Off. For example: I may get a motion event that would turn on the light in the evening or at night, but ignore motion during the day. However, 5 mins after Motion ends, I turn Off the light. Don't care if it was on, I want it off, if a human turned the physical switch on. On rules have 'restrictions', OFF rules, in these cases, do not. So I need two rules.
As I said, I have quite a few like that. The rest are done in single Rules.
Being new to this I am struggling with trying to do something very similar. I am trying to turn a light on if a door sensor is opened and it is between sunset and sunrise, and turn off 5 minutes later.