Main goal - control 3 opening gates with only 1convenient item displayed in my sitemap.
For that purpose I created the following sitemap item:
Switch item=Bramy_przelacznik mappings=[1="Garażowa", 2="Wjazdowa",3="Furtka"]
Here are my 3 items:
Switch Brama_Garazowa_wlacznik "Brama Garażowa" (Parter_Garaz) {knx="1/1/1"}
Switch Brama_Wjazdowa_wlacznik "Brama Wjazdowa" (gOgrod) {knx="2/2/2"}
Switch Furtka_Elektrozaczep "Furtka" (gOgrod) {knx="4/4/4"}
Number Bramy_przelacznik "Brama" <garage>
And this is my rule which I created some time ago and was using it for some time:
rule "Otwieranie Bram, Furtki"
when
Item Bramy_przelacznik received command
then
if(Bramy_przelacznik.state == 1) {
sendCommand(Brama_Garazowa_wlacznik,ON)
//postUpdate(Brama_Garazowa_wlacznik,OFF)
logInfo("rules", "Otwieranie Bramy Garazowej zostalo aktywowane")
}
if(Bramy_przelacznik.state == 2) {
sendCommand(Brama_Wjazdowa_wlacznik,ON)
//postUpdate(Brama_Wjazdowa_wlacznik,OFF)
logInfo("rules", "Otwieranie Bramy wjazdowej zostalo aktywowane")
}
if(Bramy_przelacznik.state == 3) {
sendCommand(Furtka_Elektrozaczep,ON)
//postUpdate(Brama_Wjazdowa_wlacznik,OFF)
logInfo("rules", "Otwieranie Furtki zostalo aktywowane")
}
end
I can frankly say - it’s working, but not so well.
First - when I click on one of the buttons, let’s say on ‘1’, then button is displayed as pushed, gate is opening, but when I want to stop or close it, then I need to click 2 times - once so it changes from on to off and again to change it’s state from off to on.
It becomes a pain when you have 3 like that as I have.
Second - when I am at or near my house I use wifi for connection. Outside it or near one of my gates connection is switched to 3g/LTE. Usually due to that switchover from wifi to mobile I loose the connection to openhab and clicking on the button has no effect. After connection is recovered I am not sure if gate will be opening or closing at that time.
I would like to operate it more like when using a pulse button as this is how my gate operates.
Best would be to have a buttons that are always white(OFF state) and every sends an ON impulse only. Perhaps, I could get rid of the second problem as well with that.
Any ideas how to update it ?