Is there a way to formulate a simple rule which solves the condtion “when heating is absent < 5 seconds …”
-
Rule for "present/absent less than x seconds"
-
OK, this is a misunderstanding. What I want to have is a rule which triggers when the heating switches ON within x seconds after it has been switched off. If it switches on after x seconds nothing should happen. The use case is an error in the heating system I would like to detect this and report it.
-
Ok i understand. You could do the following:
- create a dummy presence sensor (lets call it: dummyP) , with an auto-reset of 5 seconds
- create rule “when ‘heating switches off’ then set presence of dummyP to present”
- create rule “when ‘heating switches on’ and dummyP is present” then ‘report it’
You can change the 5 seconds to any value, to set the restart-error-window
-
@bertreb Great, this should work. Thanks a lot for the quick reply!
-
It also works with a variable timeout, when I define the rule like this:
“when heating switches off then set presence of dummyP to present for $varTime seconds”. Then the auto-reset attribute of the dummy presence sensor is not necessary. -
@bertreb I do it in the rule ‘when heating switches on’ and ’ dummyP is present 'then ‘report it’ and set presence of dummP to absent
-
@bertreb said in Rule for "present/absent less than x seconds":
Ok i understand. You could do the following:
- create a dummy presence sensor (lets call it: dummyP) , with an auto-reset of 5 seconds
- create rule “when ‘heating switches off’ then set presence of dummyP to present”
- create rule “when ‘heating switches on’ and dummyP is present” then ‘report it’
You can change the 5 seconds to any value, to set the restart-error-window
If you change the rule in step 2 to
"when ‘heating switches off’ then set presence of dummyP to present and after $varTime seconds set presence of dummyP to absent "This will reset the presence sensor (without auto-reset) and the error detecting rule will work
-
@bertreb said in Rule for "present/absent less than x seconds":
Yes, but than you don’t have a time function, because the rule is also true after $varTime seconds (for example 1 hour)
I do not understand this. In my opinion the rule is false after $varTime seconds caused of the second part in the ‘and’ condition
-
I did a small test and it looks that the ‘for x seconds’ clause works for all boolean devices.
So you are right to use it like you did.
It seems there are several solutions for your puzzle -
@bertreb Pimatic often requires workarounds like this and there are different ways. I think your solution
is the best readable. I will use it for my application. Many thanks!