Page 1 of 1
Push Button physical GPIO
Posted: Monday 29 October 2018 15:34
by NoProfesor
How to set the physical button in domoticz, so that: press, change status to ON, press again, change status to OFF.
Something like, press to turn it on if it's off, press to turn off if it is switched on,
Input GPIO 16
output GPIO 22
How to configure raspberry?
Re: Push Button physical GPIO
Posted: Tuesday 30 October 2018 13:43
by NoProfesor
It be correct?
1 step.
sudo nano /etc/init.d/domoticz.sh
/usr/local/bin/gpio export 16 in
/usr/local/bin/gpio edge 16 both
2 step.
Connect switch PIN 1 with PIN 36 (GPIO 16) with the resistor
Re: Push Button physical GPIO
Posted: Wednesday 31 October 2018 14:58
by NoProfesor
Configure at startup.
You can do so by adding the lines you would like to use to the 'rc.local'.
Type: sudo nano /etc/init.d/domoticz.sh to edit the file Go to the end of the file, and just add after ':' place your commands.
#Run export GPIO Raspberry
/usr/local/bin/gpio export 16 in
/usr/local/bin/gpio edge 16 both
Inside Domoticz
You need first to declare the GPIO port in Domoticz. To do so, go to the "Hardware" tab, type in a name like "GPIO Port" and select "Raspberry's GPIO Port" as type, then click add.
Next, go to the "Switches" tab, and for each GPIO pin, click "Manual Light/Switch" and proceed as follows:
For inputs
Select the GPIO port hardware you just configured, give it a name, select the "Contact" switch type and a "GPIO" type. You can now select the pin in the list. Obviously, the ones you configured above should not start with the "! NON EXPORTED" mention. Then click "Add Device". The mention "open/closed" corresponds to a switch connected between the pin and the ground, with the pin also connected to a pull-up (as you have read on the wiringPi website, some GPIO have an internal permanent pull-up.