Hi,
i have a relais, which is giving a signal for 1 second to open the frontdoor. Sadly this relais is active low. So when i remove power, the relais changes automatically to CLOSED and my door opens…
When i give back the power, the relais changes to OPEN again.
Is there a way to do this with a rule? I want prevent my frontdoor from opening, when the power of the relais is gone.
My current rule is like this:
rule "frontdoor"
when
Item Kontakt_Haustuer changed to CLOSED
then
Haustuer_Dummy.sendCommand(ON)
end
Is there a way to change the rule, that it only opens, when the contact was only closed for about 500ms? Maybe with timers?
I know, it is not the best way, because if the power is gone only for very short time, the door will open too, but it would be a workaround for the first time, until i can find a better solution for this.
In the rule you can use Thread::sleep(500) then check the condition with an if statement.
I’m not sure how the item Kontakt_Haustuer works. Does this CLOSE then change back to OPEN fast? If so here’s a rule example:
rule "frontdoor"
when
Item Kontakt_Haustuer changed to CLOSED
then
Thread::sleep(500)
if(Kontakt_Haustuer.state != CLOSED) // check the item has changed from CLOSED state
Haustuer_Dummy.sendCommand(ON)
end
This should work except when you have a power blip (quick on off). Is using a small UPS power supply possible? Just something that will keep the sensor powered for a few minuets, as the rule will only run when the item has changed to OFF.