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?
Push Button physical GPIO
Moderator: leecollings
-
- Posts: 17
- Joined: Wednesday 10 October 2018 21:46
- Target OS: -
- Domoticz version:
- Contact:
-
- Posts: 17
- Joined: Wednesday 10 October 2018 21:46
- Target OS: -
- Domoticz version:
- Contact:
Re: Push Button physical GPIO
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
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
-
- Posts: 17
- Joined: Wednesday 10 October 2018 21:46
- Target OS: -
- Domoticz version:
- Contact:
Re: Push Button physical GPIO
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.
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.
Who is online
Users browsing this forum: No registered users and 0 guests