Completed late September 2020 Last Update: 03 May 2021
Here's the latest step-by-step rebuild of our HomePi server - AirPlay and Homekit integration for non-apple compliant devices around our home. Basically notes-to-self, but may be useful to others. Feel free to drop me a line with suggestions or comments. Our HomePi has served as an integrator of non-compliant devices into our Apple iPhone/iPad/Mac world for quite a few years - originally filling the 'Air-Gap' to allow non-apple devices to participate in AirPlay/Print world. HomePi services have evolved over the years as devices were added/upgraded around the house. V1 providing AirPrint capabilities for an old printer then adding AirPlay capabilities in V2 for our favorite Bose radio and finally V3 integrate non-compliant smart devices into the Apple Homekit world. See original DIY Apple AirPlay/Print HowTo for more Backgrounder. V4 is simply an update/simplification minus AirPrint services because they were no longer needed. HardwareNo change for V4 other than a fresh MicroSD card.
SoftwareNo major changes for V4. AirPrint services were no longer necessary (new printer) so DietPi Google Cloud Print is no longer installed.
DietPi Install NotesNotes to self on OS Prep (DietPi IS Raspbian) and some optimized packages- Download latest DietPi and Etcher. Follow DietPi Quickstart Guide
// used DietPi_RPi-ARMv6-Stretch.7z (~90MB Download) // - Easiest to start DietPi install with Ethernet, keyboard & monitor then switch to ssh after first boot
- Automatically resizes partitions, forces password changes and updates itself (~5min)
- Config tweaks via SSH and DietPi-config utility. Minimally, set the following:
- DietPi-Config/Audio Options->Soundcard=usb-dac
// For shairport-sync w/ usb sound // - DietPi-Config/Language&Regional->Local=en.US.UTF-8 + Timezone + Keyboard[us]
// Season to taste, keyboard and country! // - DietPi-Config/Network Adapters->WiFi
// I setup WiFi @ this point and disconnect ethernet on next boot - Remember to Apply/Restart Net // - DietPi-Config/Security->Change Hostname
// Changing Hostname will force reboot //
- Install Software via SSH and DietPi-Software utility
- Software Optimized - Check the following
- Media Systems->Shairport Sync (for AirPlay)
- System Stats->RPi-Monitor (nice web-based monitor)
Printing->CloudPrint (aka cups for AirPrint)- Homebridge is still a manual install process, see below
- Remember to scroll down to do actual Install - select Go >> Start installation for selected software
- Final/Favorite tweaks 'n such via command line:
- Install favorite editor if you don't like nano. I like joe: apt-get install joe
- Disabled WiFi Power Management to be safe
$ iwconfig wlan0 power off
HomeBridge is still not part of DietPi software library ... manual install required, but it's a LOT easier than it used to be! This will still take some time, count on an hour with minimal plugin playtime! Homepage info @ https://github.com/homebridge/homebridge and Raspberry Pi specifics @ https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Raspbian
- One preliminary - check for plugins for your smart devices before you go through install - just to make sure you'll be able to control your device. Go to https://www.npmjs.com and search for "homebridge-<your dev>". For example "homebridge-wemo" or "homebridge-" to browse the library.
- Note - no need for sudo if you are logged in as DietPi root
- Install Steps are dissected from *new* HomeBridge on Raspian Lite instructions
- Install Node.js
# setup repo
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -
# install Node.js
sudo apt-get install -y nodejs gcc g++ make python
# test node is working
node -v
# upgrade npm (version 6.13.4 has issues with git dependencies)
sudo npm install -g npm
- Install Homebridge and Homebridge Config UI X
sudo npm install -g --unsafe-perm homebridge homebridge-config-ui-x
# To setup Homebridge as a service that will start on boot use hb-service command.
sudo hb-service install --user homebridge
- Log into Homebridge Config UI X (This is NICE!) - Default uc/pw = admin/admin
http://<ip address of your server>:8581
- Couple of name changes in Configuration Reference Section of guide
Note: Service management is now via sudo hb-service restart/stop/start/logs instead of systemctl
- Config using Config UI X installed above.
The following is a blow-by-blow of our Smartthings and Nest upgrade - mostly for my sake! Steps dissected from https://www.npmjs.com/package/homebridge-config-ui-x - Log in via http://homepi:8581
- Smartthings: Step by steps below MAY still need cleanup ... MUCH has changed since I installed original (pdlove) HomeBridge SmartThings!
Followed https://techtechandmoretech.com/guides/smartthings-homebridge/ - Via Browser: Smarthings IDE @ https://graph.api.smartthings.com/
- On IOS (smarthings app has always been a friggin mess!) via
NEW ST App OLD ST App BECAUSE THAT IS WHAT INSTRUCTIONS SAID! (I made a mess doing it myself!) - <Follow instructions EXACTLY>
- emailed (yeesh!) config.json snippet for ST
- Via SSH! Update the config.lson file using texted pasted into email from IOS!
- Found config.json in /var/lib/homebridge/
- Pasted clipping from email onto jsonlint.com to doublecheck/validate
- Pasted clipping into /var/lib/homebridge/config.json
- Had to empty and remove /var/lib/homebridge/accessories to get HB running
I was getting error: Cannot Add bridged accessory with same UUID read this https://github.com/luisiam/homebridge-cmdswitch2/issues/8 - hb-service start (to get hb back up)
- Back to IOS (round and round we go!), Home App:
- I deleted old home and added new one using UI QR Code to reduce confusion
- Fumbled around in IOS Home App until I settled all rooms, devices and favorites
- Nest - Installed via Config UI X
- homebridge-nest v4.4.9 (Nest plug-in for Homebridge using native Nest API)
Doc @ https://github.com/chrisjshull/homebridge-nest - I still use Nest Account - pretty simple: Access Token from home.nest.com/session
(I'll update to Google account when forced to - this step is more complicated)
- Set up IOS phone via https://support.apple.com/en-us/HT204893
- Debugging: Troubleshooting Guide @ https://github.com/nfarina/homebridge/wiki/Basic-Trouble-Shooting
- Running in terminal window is very helpful
- See Also: Common Issues section in the README
- Apple Home info @ https://www.apple.com/ios/home/
|