help with rule

Dennis Norlin shared this thanks 2 months ago

Hello. I need help with a rule. I will try too explain: I want, when the "input 1 relay alarm" is on, then "fake TV" will be on, but only between a certain time.


I have made a rule that does not work fully

please help me

Comments (8)

photo
1

In my opinion you do not need "join".

photo
1

There are two things you can change in your rule, see below;

1. Use JOIN as Acteck is suggesting, this will allow your rule to reset (run again) if the first sensor changes state.

2. There are two variable options for time checking and it can be confusing, you have to use "TIME OF NOW" not sure what is the translation for you.


Best regards.

photo
1

hello. I have try too do as you say, but it don't work correctly. It work if "input 1" goes "open" between the time, but I want: if "input 1" goes "open" BEFORE the time and when the time is 11:00 the "plugguttag 6" goes ON, and when the time is AFTER 11:15 the "plugguttag 6" goes off.

Now the rule is this

photo
1

Hello Dennis,


I think you could simplify the rule like this:


WHEN(Schedule)

If(Input1)

Action on the plug

Else

Opposite action on the plug)


This would switch to the opposite state the plug, only once for example everyday at 11.00h. Could that work for you?


If you need to switch ON at 11.00 and OFF at 11.15, tell and I can send you an example

photo
1

hello. I want to use "time" not schedule. And it must be ONE rule

photo
1

Hello Dennis,

I guess you never mentioned that if INPUT 1 comes one before that window time then it should turn the Plug ON. Correct me if I'm wrong but this is how you expect this to work;

1. Plug will come ON only if between 11 and 11:15 and INPUT came on at whatever time BEFORE this window time.

2. Plug will come OFF at 11:15 only if INPUT came on at some point before.

If I were you then I would split the rules and then you need to use some sort of "memory" to know that INPUT 1 came ON at some point. One rule for setting the memory, another one for PLUG ON and the third for PLUG OFF, and then I would use schedulers instead of TIME OF. In my example I'm using a variable, but keep in mind that variables reset if the controllers reboot or turned OFF, so if you want to avoid this you can create a virtual switch/sensor or even a meter to set the memory value to, these won't loose their values (they will read it from the cloud) if controller is rebooted or turned OFF.

photo
1

Hello Alberto. You're right, but I'll send an explanation again

I think that 3 rules should not be needed for such a "easy" rule. I have a similar rule with motion and it works well, and there is 1 rule. I can post a picture on it.


I can also try to explain again how I want my rule to work:


If "input 1" is open before time, "plug" must be OFF.

BUT, if "input 1" is open before time and let's say at 11, then the "plug" will be ON.


AND if "input 1" closes between 11:00 and 11:15, the "plug" must be OFF

AND if the time is after 11:15 then the "plug" must be OFF


I apologize for my bad English and my bad explanations.


please replay again alberto

photo
1

Dennis,


Don't worry about the english. I think the main difference between your examples is the motion sensor, the fact that it detects motion before and after time make your rule to work. In this case, with no motion sensor I cannot think of a way of accomplishing all those tasks with one switch and one plug, so this is my proposal based on what you want to achieve (or at least what I understand). I would do it with three rules, and the main reason for that is that it is not recommended (from previous posts) to NOT use schedulers with AND/OR conditions, this was some time ago though, you can try to make these three rules two and see how it goes;


1. First rule takes care of your requirements 1,2 and 3.

2. Second rule will trigger the plug ON between 11 and 11:15 in case the switch was turned on BEFORE. I'm using VAR 1 as memory.

3. Third rule will trigger the plug OFF at 11:15 if it is ON.


Best Regards.

photo