Opening curtains with a motion sensor but only once?
-
Hi
I've just put a motion sensor under my bed so when I get up in a morning it will open the curtains.
However how do you make it so that action only happens once until the next morning?
For example if I later in the day enter the bedroom again, I don't want this rule to be triggered again and its action run again etc.
Thanks
-
Hi
I've just put a motion sensor under my bed so when I get up in a morning it will open the curtains.
However how do you make it so that action only happens once until the next morning?
For example if I later in the day enter the bedroom again, I don't want this rule to be triggered again and its action run again etc.
Thanks
-
Hi
I've just put a motion sensor under my bed so when I get up in a morning it will open the curtains.
However how do you make it so that action only happens once until the next morning?
For example if I later in the day enter the bedroom again, I don't want this rule to be triggered again and its action run again etc.
Thanks
@cw-kid I'm sure there are multiple ways to do this, and probably some better than what I'm thinking...
Create an expression "g_curtains_open_today"
Create a rule. At midnight every day set g_curtains_open_today to false
Motion sensor rule: If motion sensor trips AND g_curtains_open_today is false then:
-> Open curtains
-> set g_curtains_open_today to trueThe next time the motion sensor trips before midnight the curtains will not open
-
@tunnus said in Opening curtains with a motion sensor but only once?:
try latching
I've never used latching before. I will read the user manual about that then also.
Thanks.
@cw-kid Do read up, but make sure you get this important point:
A latching condition must be paired with at least one other condition in an AND group. The latch is reset by the group going false. Since your latching condition will be latched true at some point (maybe), that means the other condition(s) going false determine when and how the latched condition is reset/unlatched.
I'm curious to see what you come up. Latching is a concept that takes some thinking for undergrad electrical engineering students to apply well and correctly, and it's the same here. I can see a very simple two condition implementation for your stated rule, but I'm going to leave this as an exercise for you and the group for the moment.
Other readers, no spoilers, please! If you can't wait, you're welcome to PM me your thoughts.
-
@cw-kid Do read up, but make sure you get this important point:
A latching condition must be paired with at least one other condition in an AND group. The latch is reset by the group going false. Since your latching condition will be latched true at some point (maybe), that means the other condition(s) going false determine when and how the latched condition is reset/unlatched.
I'm curious to see what you come up. Latching is a concept that takes some thinking for undergrad electrical engineering students to apply well and correctly, and it's the same here. I can see a very simple two condition implementation for your stated rule, but I'm going to leave this as an exercise for you and the group for the moment.
Other readers, no spoilers, please! If you can't wait, you're welcome to PM me your thoughts.
I have something similar, but with a pressure sensor on the bed (Amazon Thin Film Pressure Sensor Flex/Bend Sensor SF15-600), besides opening the curtain in the morning when I get up, also serves for another rule, if I'm not in bed and there is no movement in the room, turns off the air conditioning.
-
@cw-kid I'm sure there are multiple ways to do this, and probably some better than what I'm thinking...
Create an expression "g_curtains_open_today"
Create a rule. At midnight every day set g_curtains_open_today to false
Motion sensor rule: If motion sensor trips AND g_curtains_open_today is false then:
-> Open curtains
-> set g_curtains_open_today to trueThe next time the motion sensor trips before midnight the curtains will not open
@alan_f said in Opening curtains with a motion sensor but only once?:
Create an expression "g_curtains_open_today"
Create a rule. At midnight every day set g_curtains_open_today to false
Motion sensor rule: If motion sensor trips AND g_curtains_open_today is false then:
-> Open curtains
-> set g_curtains_open_today to true
The next time the motion sensor trips before midnight the curtains will not openThis works I have just set it up and tested it.
Ignore the additional optional extra conditions I added for Vera to be in Home Mode and for a master virtual switch called "Dark Mode" must be OFF.
The other option of using Latching I am not so sure about.
"A latching condition must be paired with at least one other condition in an AND group. The latch is reset by the group going false. Since your latching condition will be latched true at some point (maybe), that means the other condition(s) going false determine when and how the latched condition is reset/unlatched."
What would be my one other Condition in the AND group I could use?
-
@alan_f said in Opening curtains with a motion sensor but only once?:
Create an expression "g_curtains_open_today"
Create a rule. At midnight every day set g_curtains_open_today to false
Motion sensor rule: If motion sensor trips AND g_curtains_open_today is false then:
-> Open curtains
-> set g_curtains_open_today to true
The next time the motion sensor trips before midnight the curtains will not openThis works I have just set it up and tested it.
Ignore the additional optional extra conditions I added for Vera to be in Home Mode and for a master virtual switch called "Dark Mode" must be OFF.
The other option of using Latching I am not so sure about.
"A latching condition must be paired with at least one other condition in an AND group. The latch is reset by the group going false. Since your latching condition will be latched true at some point (maybe), that means the other condition(s) going false determine when and how the latched condition is reset/unlatched."
What would be my one other Condition in the AND group I could use?
@cw-kid said in Opening curtains with a motion sensor but only once?:
What would be my one other Condition in the AND group I could use?
Date/time...