Does anyone have any tips on how to set up a remote raspberry pi GPIO switch? Its fairly obvious how to do it on the primary pi, but id like to make a sensor that uses the switch in another room with a secondary pi.
Ive been looking into doing this. Common route seems to be setup the pi and sensors / buttons / etc. and then have python pass the info to your HA instance through MQTT.
HA has MQTT built in and there are sensors/switches/etc. in existing components that can use the MQTT input. However, I haven’t found a good set of instruction on how to set it all up.
You can setup a local website with a php file that calls the GPIO. The php script for activating the GPIO 6 is below, save it as switchon.php and put it in your /var/www directory. In your HA configuration, add a command line switch with the on url as
You can try setting up a slave on the RPi and the switches should appear in the master’s interface. I did manage to do this with an rpi_rf but haven’t tried it with gpio.