11115
(アイラ)
May 19, 2017, 3:30pm
1
hi, i want to use a button as a switch, which turns my relay through a gpio on and after 1 second off again. something like a push button
i have tried a few things, but nothing did really work
default.items
Switch one{ gpio="pin:2 activelow:yes" }
Switch two{ gpio="pin:3 activelow:yes" }
Switch three{ gpio="pin:4 activelow:yes" }
Switch four{ gpio="pin:5 activelow:yes" }
Switch five{ gpio="pin:6 activelow:yes" }
Switch six{ gpio="pin:7 activelow:yes" }
Switch seven{ gpio="pin:8 activelow:yes" }
Switch eight{ gpio="pin:9 activelow:yes" }
here i have listet all relay channels
rule "computer an"
when
item seven changed from OFF to ON
then
Thread::sleep(5000)
seven.sendCommand(OFF)
end
and here i tried to set my gpio pin 7 back and deactivate the relay
but my 7th switch acts the same as the others do.
how can i do this?
KidSquid
(The Squid)
May 19, 2017, 4:08pm
2
Here’s how I was shown to do that…My use was for a sliding gate relay
Install the EXPIRE binding and then add it to your switch as shown below…
Switch FGate "Front Gate" [ "Switchable" ] { channel="zwave:device:ad34b696:node4:switch_binary",expire="1s,command=OFF",autoupdate="false" }
This will turn the switch on for 1s and then back off.
Hope this helps.
1 Like
sipvoip
(Nathan Stratton)
May 19, 2017, 5:21pm
3
Will that work for .1s or 500ms? Can’t seem to get that to work.
11115
(アイラ)
May 19, 2017, 5:27pm
4
Switch seven [ "Switchable"] { gpio="pin:8 activelow:yes",expire="2s,command=OFF",autoupdate="false" }
i have tried that, but that did not work (i dont get a gpio output anymore), but how do i install the expire binding, i tried it by following
apt-get install openhab-addon-binding-expire
but then i get this E: Unable to locate package openhab-addon-binding-expire
KidSquid
(The Squid)
May 19, 2017, 6:53pm
5
I installed the binding via PaperUI
It’s a 1.X binding so you need to enable “include Legacy 1.x bindings” under System -> Configuraton
11115
(アイラ)
May 19, 2017, 6:56pm
6
okay i have installed openhab 1.8 installed, do i need openhab2 ?
KidSquid
(The Squid)
May 19, 2017, 7:01pm
7
I made the move to OH 2 as I wanted to use some of the newer features…You don’t have to upgrade unless you want to move to the new feature set.
You can download the .JAR file of the Expire binding from the link below…place it in your “Addons” folder.
https://openhab.ci.cloudbees.com/job/openHAB1-Addons/lastSuccessfulBuild/artifact/bundles/binding/org.openhab.binding.expire/target/org.openhab.binding.expire-1.9.0-SNAPSHOT.jar
11115
(アイラ)
May 19, 2017, 7:05pm
8
ok i will try install that, but first the link is broken, it says error 404 file not found and where is my addons folder? or do i have to create it first?
KidSquid
(The Squid)
May 19, 2017, 7:12pm
9
That’s weird…that url is on the binding page:
Let me see if I can find it somewhere else.
The addon folder should be found here:
/usr/share/openhab/addons.
Here’s how to install bindings:
KidSquid
(The Squid)
May 19, 2017, 7:16pm
10
11115
(アイラ)
May 19, 2017, 7:24pm
11
okay i have copied the file into the addons folder and rebooted my raspberry, but it did not bring me any changes so far
is this really the correct version? i have read in the changelog
1.9.0 initial release
and i have 1.8.3
KidSquid
(The Squid)
May 19, 2017, 7:36pm
12
From what I know you can use any of the 1.x versions with the 1.8 version of OH.
I’m sure someone else here will correct me if I’m wrong.
11115
(アイラ)
May 19, 2017, 7:38pm
13
okay, maybe im gonna move to OH2 tonight and see, if it is working there
KidSquid
(The Squid)
May 19, 2017, 8:39pm
14
From what I’ve tested it only works in full second increments.
@watou may be able to confirm this, but I was only able to get full seconds to work.
11115
(アイラ)
May 19, 2017, 9:17pm
15
It works perfectly on OH2 without any problemy, thank you
KidSquid
(The Squid)
May 19, 2017, 9:23pm
16
My pleasure…glad I could help out!