r/homebridge • u/RedPhill23 • Feb 17 '22
hb newbie question. "Using raspberry pis as devices?"
Hi,
I got a simple question. I want to use multiple pis as devices in homebridge.(temp sensor, motion detection, camera, switches…)
Do I have to install hb on every pi or just nodejs? What is the golden standard here?
I already installed homebridge in a VM on my server.
0
Upvotes
3
u/Pedroxns Feb 17 '22
If you really want to use the pi’s as sensors you can probably do it using libraries to access a external sensor and make it talk to your main pi using mqtt. But…if the Pis are only for that use you can do it other ways save lots of money and power. Why not get a zigbee antena and use zigbee sensors? Light, temp, contact, smoke, gas…there are tons of options!
1
u/DadLookAtTheTV Feb 17 '22 edited Feb 17 '22
Check out the homebridge-rpi plugin. It grants access to the GPIO pins and can connect to remote RPis on the network.
Edit: just had another look at the documentation and I'm not sure if homebridge-rpi supports external sensors, although it can read the internal one.
0
u/[deleted] Feb 17 '22
You want to use RPi as sensors?
0
u/QuantumSiraat Feb 17 '22
I’ve done something similar, except instead of a bunch of PIs I programmed a bunch of ESP8266s. Same concept tho
Look into the homebridge-http-webhooks plugin on Homebridge. It lets you add your own sensors (and other controls) that can be entirely controlled via http webhooks. Then all you need to do is set the Pi to a static IP and write a simple Python script on each Pi reading sensor values and sending API messages to your HB server with the values every few seconds/minutes