I need some help, trying to figure out how to make a rule.
Situation is:
I have this reed-relay connected to my IHC system, controled by a pushbutton.
When activating the pushbutton, it turn on a the relay with a simple potential-free contact, which sends a puls to my garageport opener (motor).
The relay goes OFF when the pushbutton is no longer pushed.
This part is working just great… And it´s useable in Openhab through the IHC binding, to be used in BasicUI and Openhab Android App.
But never start a moving thing, unless there are somekind of controle of it´s state. So I bought a garage door tilt sensor. Since this was only a test, I bought just one garage port tilt sensor and placed it at the top of the garage port. It turns out the testing is going pretty good, so next step is to buy another tilt sensor, and place it at the bottom of the garage port. Then I can make a rule verifying and telling me, when the garage port is opening, on the move, and when it´s fully open.
Simple job, except the tilt sensor is out of stock atm, so I´ll have to wait.
However it has happened a few times, I have not hit the push button in Openhab App (on the touchscreen on my mobilephone) correctly, resulting is the garageport is closed when I arrive.
So…What I need is somekind verification, that the relay did get activated.
I have a few thoughts… And I think I have an idea…
Make a rule, which turn on some visuel icon (light or something in the OpenHab Android app) when the relay goes ON. Problem is, the relay is only ON for a very few miliseconds. So it has to be with some timing keeping this “verification light” ON for enough time. I could measure the time it take for the garage port to open fully, but since I just need this “verification light” to verify I did hit the button allright, Im thinking of using the tilt sensor insted.
So in short.
- Button pushed, (on the app).
- If correctly pushed, (ie the relay has come ON) verification light goes ON. And stays ON untill.
- When the tilt sensor reach horisont position, (tilt sensor change state) verification light goes OFF.
Hope it makes any sense!
Question is, how to make this rule, specially the time from relay goes ON untill the tilt sensor change state, is the hard part, cause I have no idea how to use timing in rules.
Right now I´m using this rule, which sends a Pushover message to my mobilephone, when the tilt sensor change state.
rule "Garageport åben"
when
Item ZWaveNode11ZG8101GarageDoorTiltSensor_BinarySensor changed from CLOSED to OPEN
then
sendPushoverMessage(pushoverBuilder("Garageporten er åben!", "GalaxyS7", 1))
end
rule "Garageport lukket"
when
Item ZWaveNode11ZG8101GarageDoorTiltSensor_BinarySensor changed from OPEN to CLOSED
then
sendPushoverMessage(pushoverBuilder("Garageporten er lukket!", "GalaxyS7", 1))
end
Thats was an easy part, and it´s working. But it misses the verification light, since this rule will only fire when the garage port is moving. And as mentioned above, I need to know, if I did hit the button at all, before I arrive infront of an closed garage port.
Can someone help?
My items for this:
Switch garage_bryggers_NV "Garage Tryk nederst venstre garageport" <WallSwitch> ["Lighting"] {ihc=">[ON:53850:100]", autoupdate="false"}
Contact garage_reedrelay "Garage Reed relay to garage port" <switch> {ihc="16667410"}
Contact ZWaveNode11ZG8101GarageDoorTiltSensor_BinarySensor {channel="zwave:device:fef78fef:node11:sensor_door"}
garage_bryggers_NV is a psycical push button.
garage_reedrelay is the reed relay with the potential-free contact.