All Projects → gerarddvb → Homebridge-on-RaspberryPi

gerarddvb / Homebridge-on-RaspberryPi

Licence: other
Example of Homebridge on RaspberryPi 3

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Homebridge-on-RaspberryPi

homebridge-blinds
🌅 Homebridge Plugin to control my blinds over HTTP
Stars: ✭ 51 (+50%)
Mutual labels:  homebridge, homekit
homebridge-z2m
Expose your Zigbee devices to HomeKit with ease, by integrating 🐝 Zigbee2MQTT with 🏠 Homebridge.
Stars: ✭ 197 (+479.41%)
Mutual labels:  homebridge, homekit
homebridge-panasonic
A Homebridge plugin for Panasonic Viera TV's. Written to support the new Homekit TV accessory.
Stars: ✭ 18 (-47.06%)
Mutual labels:  homebridge, homekit
homebridge-nature-remo-cloud-aircon
Homebridge Plug-in for Air Conditioner Managed by Nature Remo
Stars: ✭ 28 (-17.65%)
Mutual labels:  homebridge, homekit
homebridge-pc-volume
Homebridge plugin to control your computer's volume using HomeKit and Siri
Stars: ✭ 55 (+61.76%)
Mutual labels:  homebridge, homekit
Homebridge Ewelink
Homebridge plugin to control eWeLink devices with original firmware.
Stars: ✭ 208 (+511.76%)
Mutual labels:  homebridge, homekit
homebridge-keylights
Yet another Homebridge plugin for Elgato Key Light and Key Light Air. https://homebridge.io
Stars: ✭ 40 (+17.65%)
Mutual labels:  homebridge, homekit
Homebridge Mi Hygrothermograph
Homebridge plugin for the Xiaomi Mi Bluetooth Temperature and Humidity Sensor
Stars: ✭ 179 (+426.47%)
Mutual labels:  homebridge, homekit
homebridge-callmonitor
Signals incoming and outgoing calls using the call monitor facility in Fritz!Box devices via HomeKit
Stars: ✭ 25 (-26.47%)
Mutual labels:  homebridge, homekit
homebridge-adb
Homebridge script to control remote ADB enabled Android device
Stars: ✭ 56 (+64.71%)
Mutual labels:  homebridge, homekit
Dsckeybusinterface
An Arduino/esp8266/esp32 library to directly interface with DSC security systems.
Stars: ✭ 202 (+494.12%)
Mutual labels:  homebridge, homekit
homebridge-vsx
📻 A VSX and SC Plugin for homebridge
Stars: ✭ 12 (-64.71%)
Mutual labels:  homebridge, homekit
Homebridge Gsh
Allow Google Assistant to control your Homebridge accessories.
Stars: ✭ 190 (+458.82%)
Mutual labels:  homebridge, homekit
homebridge-wifipresence
Detect presence in the room via wifi
Stars: ✭ 39 (+14.71%)
Mutual labels:  homebridge, homekit
Pai
Paradox Magellan, Spectra and EVO, with MQTT, Signal, Pushbullet, Pushover and others
Stars: ✭ 185 (+444.12%)
Mutual labels:  homebridge, homekit
homebridge-ESP8266-pojects
This is a directory where I want to share my own ESP8266 Smart Home projects.
Stars: ✭ 18 (-47.06%)
Mutual labels:  homebridge, homekit
Homebridge Platform Wemo
Homebridge plugin to control Wemo devices.
Stars: ✭ 173 (+408.82%)
Mutual labels:  homebridge, homekit
Homebridge Dafang
Homebridge Plugin for Xiaomi Dafang / Wyze Cam IP Camera => Hey Siri, Start Video Recording
Stars: ✭ 176 (+417.65%)
Mutual labels:  homebridge, homekit
homebridge-unifi-occupancy-sensor
An occupancy sensor for Homebridge and UniFi
Stars: ✭ 71 (+108.82%)
Mutual labels:  homebridge, homekit
homebridge-vieramatic
Homebridge plugin for Panasonic™ Viera™ TVs (includes support for 2018 and later models)
Stars: ✭ 39 (+14.71%)
Mutual labels:  homebridge, homekit

This repo is outdated and is not maintained anymore.

Go here: https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Raspbian

For better and cheaper devices see: https://github.com/RavenSystem/esp-homekit-devices/wiki/Home-Accessory-Architect

For better RPI camera see: https://github.com/brutella/hkcam

[OUTDATED] Homebridge on Raspberry Pi 3

[OUTDATED] Example of Homebridge on RaspberryPi 3

READ: https://github.com/nfarina/homebridge

This example gives the configuration of these accessories/devices;

  • Nest thermostat (3rd gen)
  • Logitech Harmony Hub
  • Camera
  • Fan
  • Smoke Detector
  • Motion Detector
  • GPS Temperature & humidity sensor

Things I used in this setup;

  • Raspberry Pi 3 Model B+
  • Raspbian Stretch with Desktop
  • Raspberry Pi Camera Module V2
  • Keyes Relayboard (2 relays)
  • Makeblock MQ2 Gas Sensor
  • HC-SR501 PIR Motion Sensor
  • Phoenix Contact RPI-BC DIN rail housing
  • iPhone/iPad on iOS 11.3
  • PC/Mac (For SSH)
  • AppleTV 4 (For remote access)

Useful iOS Apps;

  • Home (Expensive but better than default iOS app)
  • Prompt
  • iTeleport
  • Eve (Edit Siri commands)

Useful Mac Apps;

  • Etcher
  • Apple Screen Sharing
  • Termius
  • Transmit

Setup Raspberry Pi

Connect a display, mouse and keyboard to the Raspberry Pi, open terminal and enter the following command:

sudo raspi-config

In the configuration tool enable SSH, VNC, Autologin, Wifi and change your password.

Open VNC Server settings from the system tray.

Options > Security

Encryption = Prefer On
Authentication = VNC Password

Download the setup files, enter the following command:

git clone https://github.com/gerarddvb/Homebridge-on-RaspberryPi /home/pi/HomeKit/
sudo reboot

After reboot test SSH and VNC connection, when succesful, disconnect display, mouse and keyboard.

Install Homebridge

Setup APT, enter the following commands:

sudo apt-get update
sudo apt-get upgrade

Use these commands to install Homebridge:

sudo apt-get install libavahi-compat-libdnssd-dev
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g --unsafe-perm homebridge

Use these commands to install the Homebridge plugins.

Initial setup of various plugins is nedeed. Follow the instructions on the GitHub link to the plugin below.

sudo npm install -g homebridge-http
sudo npm install -g homebridge-ws
sudo npm install -g homebridge-nest

sudo npm install -g npm@4
sudo npm install -g [email protected]

Test Homebridge

homebridge

Close after succesful test

Now its time to copy the config.json

cd /home/pi/.homebridge/
sudo wget -N <YOUR config.json file>

WebIOPi

To use homebridge-http with GPIO you will need to setup webiopi, skip if you don't want to use GPIO

Setup GPIO

sudo crontab -e

Add the following line at the end:

@reboot sudo python3 /home/pi/HomeKit/gpio.py > /home/pi/HomeKit/webiopilog.txt

Save changes with CTRL-X

Enter the following commands to setup webiopi:

cd /home/pi/HomeKit
sudo wget http://sourceforge.net/projects/webiopi/files/WebIOPi-0.7.1.tar.gz
sudo tar xvzf WebIOPi-0.7.1.tar.gz
cd WebIOPi-0.7.1
sudo wget https://raw.githubusercontent.com/doublebind/raspi/master/webiopi-pi2bplus.patch
patch -p1 -i webiopi-pi2bplus.patch
sudo ./setup.sh
sudo webiopi -d -c /etc/webiopi/config 		(Test, close after successful connection)
sudo update-rc.d webiopi defaults
sudo /etc/init.d/webiopi start

Setup systemd deamon

After all the accessories/devices are configured and tested, it is time to make it run at boot.

Enter the following commands to enable homebridge to run at boot and restart after 10 seconds of inactivity.

The config.json used by the deamon will be located at /var/homebridge/

sudo useradd --system homebridge
sudo mv /home/pi/HomeKit/homebridge /etc/default/
sudo mv /home/pi/HomeKit/homebridge.service /etc/systemd/system/ 
sudo mkdir /var/homebridge
sudo cp -r /home/pi/.homebridge/accessories/ /var/homebridge/
sudo cp -r /home/pi/.homebridge/persist/ /var/homebridge/
sudo cp /home/pi/.homebridge/config.json /var/homebridge/
sudo chown -R homebridge:homebridge /var/homebridge
sudo chmod 777 -R /var/homebridge
sudo systemctl daemon-reload
sudo systemctl enable homebridge
sudo systemctl start homebridge
sudo reboot

Setup CPU Watchdog

To enable the CPU watchdog enter the following commands, this will reboot the Raspberry Pi after a CPU inactivity of 15 seconds.

sudo nano /boot/config.txt

Add the following lines:

# Watchdog enable
dtparam=watchdog=on

# VNC resolution enable
hdmi_group=2
hdmi_force_hotplug=1

# VNC resolution
# 2=640x400
# 27=1280x800
# 46=1440x900
# 76=2560x1600
# 82=1080p
# 85=720p
hdmi_mode=46

Save changes with CTRL-X

Enter the following commands

sudo apt-get install watchdog
sudo mv /home/pi/HomeKit/watchdog.conf /etc/
sudo mv /home/pi/HomeKit/watchdog.service /lib/systemd/system/
sudo systemctl enable watchdog
sudo systemctl start watchdog
sudo reboot

Test watchdog

To test the watchdog enter the following command, this will freeze your Rapsberry Pi, it should reboot after 15 seconds.

:(){ :|:& };:

Setup Raspberry Pi Camera Module

Use these commands to install the Raspberry Pi Camera Module.

raspi-config 				 Enable Camera
sudo nano /etc/modules		Add: bcm2835-v4l2
sudo reboot 
raspistill -o cam.jpg
sudo apt install ffmpeg
cd /opt
sudo mkdir homebridge-camera-rpi
sudo chown pi homebridge-camera-rpi
git clone https://github.com/moritzmhmk/homebridge-camera-rpi
cd homebridge-camera-rpi
npm install
node standalone.js
sudo mv /home/pi/HomeKit/homebridge-camera-rpi.conf.json /etc/
sudo mv /home/pi/HomeKit/hap-camera-rpi.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable hap-camera-rpi
sudo systemctl start hap-camera-rpi
sudo reboot

Status

You can check the state of homebridge by entering the following command:

sudo systemctl status -l homebridge -n 200
sudo systemctl status -l hap-camera-rpi -n 200

This will output the last 200 lines, change that number to get more/less info

You can check the status of WebIOPi by entering the following address in your browser:

http://RASPBERRYIPADDRESS:8000/

Notes

  • The service will restart after 10 seconds if it fails for any reason (or if you kill it for example with 'sudo systemctl stop homebridge')
  • The system will restart after 15 seconds of inactivity
  • Install packages manually with: sudo npm install -g FOLDERNAME

Sources

https://github.com/nfarina/homebridge

https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi

https://nodejs.org/en/download/package-manager/

https://github.com/rudders/homebridge-http

https://github.com/gerarddvb/homebridge-http

https://github.com/kraigm/homebridge-nest

https://github.com/KraigM/homebridge-harmonyhub

https://github.com/ebaauw/homebridge-ws

https://github.com/moritzmhmk/homebridge-camera-rpi

http://webiopi.trouch.com/INSTALL.html

http://forkgeeks.com/enabling-watchdog-on-raspberry-pi/

https://gist.github.com/johannrichard/0ad0de1feb6adb9eb61a

https://elinux.org/RPiconfig#Video_mode_options

https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/gen/HomeKitTypes.js

DIN 81346 Electrical Drawing

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].