I am still a noob, therefore please excuse stupid questions
My setup:
PiOne: Raspberry Pi running Hassbian (located inside my house and connected to local router.)
PiTwo: Raspberry Pi located inside my garage (separated building) controlling the lights and garage doors via GPIOs and relays (not connected to Homeassistant yet).
What I want to do:
Create Switches in HA ibPiOne that are triggering the PiTwo’s GPIO (via Python scripts, whatever…) and control garage doors/lights etc.
As PiOne and PiTwo are far away from each other, there is no option to realize this via cable.
I have completely no clue about where to start and how to realize this project. Is there somebody out there who has done something similar with RPis? or maybe someboday could give me a hint on where to find ideas. Thank you so much in advance!
Pi 1 running osmc, connected to my TV via HDMI, and to a 16 port relay board via the GPIOs controlling the lights and the heating/cooling.
The way I do it is through php with nginx running on the pi, and command line switches on HA.
nginx default conf on pi:
# Default server configuration
#
server {
listen 81 default_server;
# SSL configuration
#
listen 443 ssl default_server;
ssl_certificate /etc/ssl/certs/my_own_certificate_file.crt;
ssl_certificate_key /etc/ssl/private/my_own_key_file.key;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}
thank you for your answers. It’s been a while since I found time to proceed with the project.
Meanwhile I decided to realize this project via MQTT and a NodeMCU controller. As I am still a rookie I am sure I will come back with more questions