Project to integrate a Pimoroni Automation (p)HAT on a Raspberry Pi Zero W with Apple's Homekit using Homebridge
This is the code for a basic homebridge plugin and a python server. By running both on a Raspberry Pi 0W with the Automation HAT installed you can add a relay as a switch to your Homekit and control it with Siri.
Obviously the Automation HAT is capable of much more and this project is a good start for more abitious home automation projects. Remember don't use the Automation HAT to directly switch mains electricity!
- You need a Raspberry Pi with Raspian installed.
- Install the Automation (p)HAT
- Install Homebridge
- Add homebridge as an accessory in your home app on IOS
- Open a terminal and clone this repository
git clone https://github.com/dropletmedia/homebridge-automation-hat.git
- move or copy the
config.json
file into yourhome/pi/.homebridge
folder. - Make sure flask is installed
sudo pip3 install flask
- use npm to install the homebridge plugin globally
npm install -g ~/homebridge-automation-hat
- Restart homebridge
- start the server
python ~/homebridge-automation-hat/server.py
- Add the switch accessory to your home app on IOS
I have connected some Led light strips with a music sensitive controller to my automation phat's relay. I've put them up in my shed, and with an Apple homepod and iphone I've set up a siri shortcut to play a playlist and turn the lights on when I say "Hey Siri, disco shed!!'
Phil Picton – @dropletmediaUK - https://dropletmedia.co.uk
Distributed under the MIT license. See LICENSE
for more information.
https://github.com/dropletmedia
- Fork it (https://github.com/dropletmedia/homekit-automation-hat/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request