A fully-fledged up-to-date Homebridge-Plugin for use with Homebridge v0.2.1+ and Domoticz, which checks the status of all supported devices, thus you can flip a switch in Domoticz, and (usually via a pull to refresh, or swipe up & down in your HomeKit app of choice) those changes will be reflected in HomeKit. Also adds more Domoticz sensor support to HomeKit - see ‘Supports:’ list below.
This will not add support for any additional hardware to Domoticz. It is purely for getting Domoticz data out and onto HomeKit.
This plugin will only work with homebridge v0.2.1x or better.
Supports:
Standard HomeKit Types:
- Sockets (on/off) - Domoticz SwitchTypeVal: 0
- Lamps (on/off) - Domoticz SwitchTypeVal: 0
- Lamps (dimmer & rgb) - Domoticz SwitchTypeVal: 7
- Contact Sensors - Domoticz SwitchTypeVal: 2
- Smoke Detectors - Domoticz SwitchTypeVal: 5
- Motion Sensors - Domoticz SwitchTypeVal: 8
- Window Coverings - Domoticz SwitchTypeVal: 3 & 13
- Occupancy Sensors - any SwitchTypeVal: 0 with "Occupied" in it's title
Provides:
Custom HomeKit Types (these will display as ‘unsupported’ within iOS10 Home app, but function fine in 3rd party apps such as Eve):
- General kWh power meters - Types: General, Current, Usage; SubType: kWh, Electric (inc CurrentCost USB)
- YouLess Meter (Current, Total and Today Total Consumption) - Type: YouLess Meter; SubType: YouLess counter
- EvoHome / OpenTherm Thermostat support - Types: Heating, Thermostat; SubTypes: Zone, SetPoint
- General Usage % meters (eg: Motherboard Sensors Hardware Device - CPU %, Mem %, HDD % etc) - Type: General; SubType: Percentage
- Temperature, Temp + Humidity, Temp + Humidity + Baro (Current Temperature, Current Humidity, Current Pressure in hPA) - Type: Temp, Temp + Humidty, Temp + Humidity + Baro
- DarkSkies Virtual Weather Station Sensors (Wind, Solar Radiation, Rainfall, Visibility, Barometer)
- Location Sensor - any Domoticz text sensor with "Location" in it's title, for use with custom GeoFence / Bluetooth scripts.
...and a few others!
q: Is my [device] supported?
a: See https://www.domoticz.com/wiki/Domoticz_ ... fic_device - query your device as per that, and if your device’s SwitchTypeVal isn’t in the ‘Supports:’ or Type/SubType aren’t in the ’Provides:' list above, then I haven’t added support for it yet. Open a new issue over on the GitHub repo including the output from the json api and I’ll get round to it at somepoint!
q: Are Domoticz SCENES supported?
a: Not directly, but there's a straightforward workaround. Create a dummy/virtual/manual switch in Domoticz and set the On action to trigger the scene (see https://www.domoticz.com/wiki/Domoticz_ ... _on_or_off), and an Off delay to reset the switch.
eDomoticz / Homebridge will see the virtual switch.
q: I have LOTS of devices and can’t connect to Homebridge
a: Create a room plan within Domoticz. Add the sensors you NEED exposing to HomeKit to that roomplan within Domoticz. Note the roomplan’s idx number, and set the “roomid” value in your config.json to this number. (In the config.json example roomid is set to 0 so loads ALL sensors).
q: What’s the Override slider represent on the EvoHome Thermostat?
a: Override-Until time in minutes from the current time. Allows setting an override-until time upto 8 hours in the future. Setting this slider to 0 will set the heating mode to Auto. Setting it to 481 will set the override as a PermanentOverride.
Homebridge & Plugin Installation
Option 1 - Updating preinstalled versions on Domoticz 4834 image only
All steps below have been tested, verified & are known to work fine with Domoticz 3.4834 (the 4834 image) on RaspPi B/B+/2/3. These are the latest images to date at the time of the last update to this post. (27/6/16)
Apply the clean 4834 image to an SD card and boot off it. SSH onto the Pi and proceed as follows...
Code: Select all
sudo raspi-config
If on RaspPi A/B/B+...
- Spoiler: show
Code: Select all
sudo service homebridge stop
sudo npm set prefix '/usr' -g
sudo npm update -g homebridge --unsafe-perm
sudo npm update -g homebridge-edomoticz --unsafe-perm
cd /usr/lib/node_modules
sudo npm rebuild homebridge
sudo npm rebuild homebridge-edomoticz
Refer to the config example & tips at https://github.com/PatchworkBoy/homebridge-edomoticz - (ctrl-o to save, ctrl-x to exit).
Code: Select all
sudo pico ~/.homebridge/config.json
Code: Select all
homebridge
If all went well you should now see a device entitled “Homebridge” to pair with from your chosen homekit app, which contains all your accessories! See further down this post to make Homebridge run at boot (if it wasn’t already set to, otherwise, just reboot your Pi and homebridge should start).
To quit homebridge, hit Ctrl-C.
See further down this post to run as service at bootup...
Option 2 - Replacing preinstalled versions on 4834 & 3530 image
Also the standard install method for most Debian / Raspbian based Linux OSes
All steps below have been tested, verified & are known to work fine with Domoticz 3.4834 (the 4834 image) as well as 2.3530 (the 3530 image), on RaspPi B/B+/2/3. These are the latest images to date at the time of the last update to this post. (27/6/16)
If working from a fresh copy of a Domoticz SD Card Image...
- Spoiler: show
- Spoiler: show
- Spoiler: show
Code: Select all
sudo apt-get install libavahi-compat-libdnssd-dev
- Spoiler: show
Code: Select all
sudo npm install -g homebridge --unsafe-perm
sudo npm install -g homebridge-edomoticz --unsafe-perm
Refer to the config example & tips at https://github.com/PatchworkBoy/homebridge-edomoticz - (ctrl-o to save, ctrl-x to exit).
Code: Select all
mkdir ~/.homebridge
sudo pico ~/.homebridge/config.json
Code: Select all
sudo rm /usr/bin/homebridge
sudo ln -s /usr/local/lib/node_modules/homebridge/bin/homebridge /usr/bin/homebridge
sudo reboot
Code: Select all
homebridge
If all went well you should now see a device entitled “Homebridge” to pair with from your chosen homekit app, which contains all your accessories! See further down this post to make Homebridge run at boot...
To quit homebridge, hit Ctrl-C.
Option 3 - Bare install on Raspbian Jessie WITHOUT using Domoticz SD card images
If you’d rather work from scratch and install Raspbian by hand. It’s assumed that you have a vague idea of what you’re doing with Linux and will be able to resolve any issues yourself. You won’t get any help from us!
Manual Installation Guide: https://raw.githubusercontent.com/Patch ... stallGuide
Enabling MQTT For improved realtime updates (speedier response)
If enabling MQTT via config.json, don’t forget to install an MQTT Broker - see https://mosquitto.org/2013/01/mosquitto ... epository/
And then you’ll need to enable Domoticz’ MQTT Client - see https://www.domoticz.com/wiki/MQTT#Add_ ... Gateway.22
Run in Background / As Service at Bootup & Updating
Raspbian Wheezy (ie: 3530 image):
- Spoiler: show
For the full Jessie Bootup guide ‘doing it properly’ see https://github.com/nfarina/homebridge/w ... up-systemd
- Spoiler: show
I’ve referred to Domoticz thru-out the plugin as eDomoticz so that it doesn’t overwrite the existing shim or pollute the official Domoticz namespace (in case gizmocuz n’ the guys release their own), that way you can just change your config.json to test one vs the other, emptying the persist folder in between restarts.
Anyways... if you want the source rather than installing thru npm, find it on GitHub: https://github.com/PatchworkBoy/homebridge-edomoticz (you can also find the changelog there too)