homebridge-edomoticz Plugin

Moderator: leecollings

Post Reply
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

homebridge-edomoticz Plugin

Post by Marci »

homebridge-edomoticz

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
...and a few others!

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.
** assumes the EvoHome has been setup according to this script method.
...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
(Option 1 - Expand Filesystem. Finish. Allow reboot.)

If on RaspPi A/B/B+...
Spoiler: show

Code: Select all


sudo apt-get remove nodejs
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*} 
sudo rm -rf /var/db/receipts/org.nodejs.*
hash -r
wget https://nodejs.org/dist/v6.3.1/node-v6.3.1-linux-armv6l.tar.gz
tar -xvf node-v6.3.1-linux-armv6l.tar.gz
cd node-v6.3.1-linux-armv6l
sudo cp -R * /usr/local/
Next...

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
Replace the contents of config.json file at ~/.homebridge/ if necessary...
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
Launch homebridge!

Code: Select all

homebridge
You WILL see some *** warning *** lines. These are standard and can be ignored.

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

Code: Select all

sudo raspi-config
(Option 1 - Expand Filesystem. Finish. Allow reboot.)
If using 4834 image on Raspberry Pi A/B/B+...
Spoiler: show

Code: Select all

sudo apt-get remove nodejs
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*} /var/db/receipts/org.nodejs.*
hash -r
wget https://nodejs.org/dist/v6.3.1/node-v6.3.1-linux-armv6l.tar.gz
tar -xvf node-v6.3.1-linux-armv6l.tar.gz
cd node-v6.3.1-linux-armv6l
sudo cp -R * /usr/local/
cd ~/
If using 3530 image on Raspberry Pi 2 / 3...
Spoiler: show

Code: Select all

sudo apt-get remove nodejs
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*} /var/db/receipts/org.nodejs.*
hash -r
wget https://nodejs.org/dist/v6.3.1/node-v6.3.1-linux-armv7l.tar.gz
tar -xvf node-v6.3.1-linux-armv7l.tar.gz
cd node-v6.3.1-linux-armv7l
sudo cp -R * /usr/local/
cd ~/
Ensure avahi mDNS is installed...

Code: Select all

sudo apt-get install libavahi-compat-libdnssd-dev
If using a Domoticz SD Card image...
Spoiler: show
Remove any existing homebridge installations to avoid confusion.

Code: Select all

sudo rm -rf /usr/lib/node_modules/homebridge* && sudo rm -rf ~/.homebridge
Install the latest version of homebridge & the plugin...

Code: Select all

sudo npm install -g homebridge --unsafe-perm
sudo npm install -g homebridge-edomoticz --unsafe-perm
Replace the contents of config.json file or create config.json file in ~/.homebridge/ if necessary...
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
Remove existing symlink if it exists, and create a new one... and then reboot.

Code: Select all

sudo rm /usr/bin/homebridge
sudo ln -s /usr/local/lib/node_modules/homebridge/bin/homebridge /usr/bin/homebridge
sudo reboot
Now, we can start homebridge...

Code: Select all

homebridge
You WILL see some *** warning *** lines. These are standard and can be ignored.

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
Install forever if you don’t have it already...

Code: Select all

sudo npm install -g forever
Then create the file ‘homebridge.sh’ in /etc/init.d/

Code: Select all

sudo pico /etc/init.d/homebridge.sh
And copy & paste in the contents of the code block below.

/etc/init.d/homebridge.sh

Code: Select all

#! /bin/bash
### BEGIN INIT INFO
# Provides:          homebridge.sh
# Required-Start:    $all
# Required-Stop:     
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Homebridge Forever
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin
 
case "$1" in
  start)
    echo "Starting HomeBridge"
    su -c "/usr/bin/forever start /usr/local/lib/node_modules/homebridge/bin/homebridge" pi
    exit 0
    ;;
  stop)
    echo "Stopping Homebridge"
    su -c "/usr/bin/forever stop /usr/local/lib/node_modules/homebridge/bin/homebridge" pi    
    exit 0
    ;;
  restart)
    echo "Restarting Homebridge"
    su -c "/usr/bin/forever restart /usr/local/lib/node_modules/homebridge/bin/homebridge" pi    
    exit 0
    ;;
  *)
    echo "Usage: /etc/init.d/homebridge.sh {start|stop|restart}"
    exit 1
    ;;
esac
Save with ctrl+o. Exit with ctrl-x. Now run the following command:

Code: Select all

sudo chmod +x /etc/init.d/homebridge.sh && sudo update-rc.d homebridge.sh defaults
sudo reboot
Homebridge will now load at boot up. To manually start/stop/restart homebridge, simply type

Code: Select all

/etc/init.d/homebridge.sh start
/etc/init.d/homebridge.sh stop
/etc/init.d/homebridge.sh restart
To update homebridge & the plugin on the 3530 image, restart homebridge...

Code: Select all

sudo npm update -g homebridge --unsafe-perm
sudo npm update -g homebridge-edomoticz
/etc/init.d/homebridge.sh restart
You could pop this into a shell script called update-edomoticz, chmod +x update-edomoticz, then just ./update-edomoticz to do everything in one move.


The Homebridge log file (the most recent .log file in ~/.forever/) can be monitored via:

Code: Select all

tail -f `ls -t ~/.forever/*.log | grep -v '^d' | head -n1`
Raspbian Jessie (ie: 4834 image):
For the full Jessie Bootup guide ‘doing it properly’ see https://github.com/nfarina/homebridge/w ... up-systemd
Spoiler: show

Code: Select all

sudo pico /lib/systemd/system/homebridge.service

Paste in the following:

Code: Select all

[Unit]
Description=HomeBridge Service
After=multi-user.target

[Service]
User=pi
Type=idle
ExecStart=/usr/bin/homebridge

[Install]
WantedBy=multi-user.target
{ctrl-o to save, ctrl-x to quit}

Now run:

Code: Select all

sudo chmod 644 /lib/systemd/system/homebridge.service
sudo systemctl daemon-reload
sudo systemctl enable homebridge.service
sudo reboot

You now no longer need to manually start Homebridge. It should run automatically at boot up.

To check Homebridge Status...

Code: Select all

sudo systemctl status homebridge.service -l
To restart Homebridge...

Code: Select all

sudo systemctl restart homebridge
To update Homebridge & eDomoticz, then restart Homebridge...

Code: Select all

sudo npm update -g homebridge --unsafe-perm
sudo npm update -g homebridge-edomoticz --unsafe-perm
sudo systemctl restart homebridge
General Info

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)
Last edited by Marci on Wednesday 16 November 2016 14:43, edited 96 times in total.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
User avatar
deejc
Posts: 168
Joined: Tuesday 22 September 2015 18:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5641
Location: UK
Contact:

Re: eDomoticz Homebridge Shim

Post by deejc »

i moved this from the general siri thread …..

hi,
i rebuilt my pi, and again have domoticz and homebridge running, i have been waiting for the feedback / status issue to be addressed and am trying your new eDomoticz shim but it does not seem to respect the "roomid": , entry of the config.json
it has loaded all the devices and i have had to create a zzhidden room to assign them to in the app.
Domoticz 3.5641 on RPI (Raspbian GNU/Linux 8)
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: eDomoticz Homebridge Shim

Post by Marci »

Shall get that added and update git this evening hopefully...! Will post back when done.


Sent from my iPhone using Tapatalk
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
User avatar
deejc
Posts: 168
Joined: Tuesday 22 September 2015 18:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5641
Location: UK
Contact:

Re: eDomoticz Homebridge Shim

Post by deejc »

brilliant, thanks!
i'll try it as soon as i know its available.

on a slightly off topic slant .. and also a bit cheeky but would you be able to help me make a plug-in ?
i have zero programming knowledge but am proficient in linux etc… there is currently a panasonic viera npm js file that i would love to see made in to a homebridge plugin… i posted on the slack team website to see if anyone is / would make one..

its not got to be fancy, just the normal buttons up,down, channel up / down etc and numbers .. i see there is already a samsung and phillips tv plugin.
Domoticz 3.5641 on RPI (Raspbian GNU/Linux 8)
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: eDomoticz Homebridge Shim

Post by Marci »

Done...! eDomoticz shim should now respect roomid if defined in config.json

Re Homebridge plugin - doubtful, I’m afraid. Not having a panasonic viera to test with kinda makes it difficult to know if any of it works or not... that and I don’t actually use Homebridge plugins, just the shim to link to Domoticz. I’d be working out how to get Domoticz to control it, then each command would show up as a Domoticz switch that you could put in a room called TV (which is how I currently control my TV gear - via RS232 & IR thru Domoticz - switches just trigger python scripts that either send raw serial commands, or LIRC irsend commands).
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: eDomoticz Homebridge Shim

Post by Marci »

Ro8in wrote:Nevermind I got it.. You rewrite the domoticz plugin big thanks to that!!

Found one bug tho. When a switch is turned on by a scene eDomoticz reports it as off even tho in domoticz its set as turned on.
- viewtopic.php?f=36&t=6864&start=440#p72490

Homebridge/HomeKit doesn’t poll statuses on any form of timer, and Domoticz doesn’t send any events out... so you’ll never be able to open a home kit app and watch it’s accessory page and see a switch-flip in Domoticz reflected automatically within the app afaik. (Someone more versed in home kit - feel free to correct me if I’m wrong)

Scroll up/down whatever app you’re viewing your switches through and that triggers HomeBridge to retrieve an update per device... _every_ time you scroll. Or at least that’s how it’s done via Eve app or Home app (Home being about the best there is imo)

If you start homebridge using DEBUG=* option at the beginning of the command, you can watch the Homebridge logs whizz past and see each switch requesting it’s status update.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
User avatar
deejc
Posts: 168
Joined: Tuesday 22 September 2015 18:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5641
Location: UK
Contact:

Re: eDomoticz Homebridge Shim

Post by deejc »

Marci wrote:Done...! eDomoticz shim should now respect roomid if defined in config.json.
All good, thanks!!
Domoticz 3.5641 on RPI (Raspbian GNU/Linux 8)
Ro8in
Posts: 10
Joined: Saturday 23 January 2016 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: eDomoticz Homebridge Shim

Post by Ro8in »

Sorry dude had to move away again from your plugin. The newer versions allow to setup siri names (as some of the names I use in domoticz are not handy for siri), and with yours I had no such option. Or am I missing something?

Also when a switch is set to on by a scene it doesn't update on my Eve App..

For me an option to set Siri names is higher on the list then to being able to read a switch status and temperatures..
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

eDomoticz Homebridge-Plugin

Post by Marci »

That's cos latest Homebridge runs the Domoticz platform as a bridge... all Siri names now just pull straight from Domoticz. I just renamed them there, restarted Homebridge to pick up the changes, done. - was my error, now fixed.

Dunno about Eve app - all works fine here across all HomeKit apps. All apps refresh status from Homebridge when the sensor's displayed (should see spinner then last updated message to right of each sensor as it loads - pull to refresh). None of this will work if not running latest homebridge installed via npm... What output does 'sudo npm ls -g homebridge' give?
Last edited by Marci on Saturday 30 January 2016 0:39, edited 5 times in total.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
steppi
Posts: 41
Joined: Saturday 30 January 2016 0:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: eDomoticz Homebridge Shim

Post by steppi »

Hello everyone! I installed Domoticz file in the right folder.
But when launching Homebridge happens:

Code: Select all

---
Loaded config.json with 0 accessories and 1 platforms.
---
Loading 1 platforms...
[eDomoticz] Initializing eDomoticz platform...
Loading legacy platform eDomoticz
/usr/local/lib/node_modules/homebridge-legacy-plugins/platforms/eDomoticz.js:5
<!DOCTYPE html>
^

SyntaxError: Unexpected token <
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:413:25)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at new <anonymous> (/usr/local/lib/node_modules/homebridge-legacy-plugins/index.js:35:30)
    at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:204:32)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:35:36)
My "config.son":

Code: Select all

{
	"bridge": {
		"name": "Homebridge",
		"username": "CC:21:3E:E4:DE:33",
		"port": 51826,
		"pin": "031-45-154"
	},
	"description": "Configuration file for (e)xtended Domoticz platform.",
	"platforms": [{
		"platform": "eDomoticz",
		"name": "eDomoticz",
		"server": "127.0.0.1",
		"port": "8080"
	}],
	"accessories": []
}
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

eDomoticz Homebridge Shim

Post by Marci »

Update config.json and eDomoticz.js from the GitHub repo...

Presume you're running latest version of homeBridge? Copy and paste the output of:

Code: Select all

sudo npm ls -g homebridge
...into your reply.
Last edited by Marci on Sunday 31 January 2016 23:13, edited 1 time in total.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
steppi
Posts: 41
Joined: Saturday 30 January 2016 0:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: eDomoticz Homebridge Shim

Post by steppi »

OK thanks! The file was not complete Domoticz.js
Now it works fine! Although I am trying from work via ssh, so I can not verify if it works locally by iOS. But Homebridge started correctly:

Code: Select all

---
Loaded config.json with 1 accessories and 1 platforms.
---
Loading 1 platforms...
[eDomoticz] Initializing eDomoticz platform...
Loading legacy platform eDomoticz
[eDomoticz] Fetching Domoticz lights and switches...
Loading 1 accessories...
[Luce Camera] Initializing WeMo accessory...
[Luce Camera] Searching for WeMo device with exact name 'Camera'...
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:
                       
    ┌────────────┐     
    │ 121-25-149 │     
    └────────────┘     
                       
Homebridge is running on port 51826.
[Luce Camera] Found 'Camera' device at 192.168.6.183
Thank you and congratulations for the project!
Look further changes !!
User avatar
deejc
Posts: 168
Joined: Tuesday 22 September 2015 18:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5641
Location: UK
Contact:

Re: eDomoticz Homebridge Shim

Post by deejc »

just wanted to say thanks again been running all day and all the switches report status to homebridge now, i also got a homekit compatible thermostat instead of using the nest platform so i have less reliance on the homebridge software!
Domoticz 3.5641 on RPI (Raspbian GNU/Linux 8)
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

eDomoticz Homebridge-Plugin

Post by Marci »

Updated the OP - now a proper homebridge-plugin rather than a legacy plugin.

If you’d installed the legacy eDomoticz shim, just remove eDomoticz.js from /usr/local/lib/node_modules/homebridge-legacy-plugins/platforms

So:

Code: Select all

sudo rm -rf /usr/local/lib/node_modules/homebridge-legacy-plugins/platforms/eDomoticz.js
Then:

Code: Select all

sudo npm install -g homebridge-edomoticz
...then restart homebridge. Re-pair to the Homebridge device et voila! kWh sensors, % sensors alongside the usual! More to come at the updated repo, which is named to match the homebridge plugin git repo naming convention: https://github.com/patchworkboy/homebridge-eDomoticz
Last edited by Marci on Sunday 31 January 2016 21:20, edited 1 time in total.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
m0rph13
Posts: 18
Joined: Sunday 31 January 2016 1:24
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Contact:

Re: eDomoticz Homebridge-Plugin

Post by m0rph13 »

Updated the OP - now a proper homebridge-plugin rather than a legacy plugin.
Thank you ! :)
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: eDomoticz Homebridge Shim

Post by Marci »

Ro8in wrote:Sorry dude had to move away again from your plugin. The newer versions allow to setup siri names (as some of the names I use in domoticz are not handy for siri), and with yours I had no such option. Or am I missing something?
I was mistaken - this was due to this.name not being passed to the new service instances - mistake on my behalf, and is now fixed!
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: eDomoticz Homebridge-Plugin

Post by Marci »

Just to complete the get-up-n-running tips for Homebridge in general if you’ve just manually installed it for the first time whilst using the Domoticz RaspPi SD Card image (or just installing it for the first time via npm)...

install forever if you haven’t already...

Code: Select all

sudo npm install -g forever
Then create the file ‘homebridge.sh’ in /etc/init.d/

Code: Select all

sudo pico /etc/init.d/homebridge.sh
And copy & paste in the contents of the code block below.

/etc/init.d/homebridge.sh

Code: Select all

#! /bin/bash
### BEGIN INIT INFO
# Provides:          homebridge.sh
# Required-Start:    $all
# Required-Stop:     
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Manage my cool stuff
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin
 
case "$1" in
  start)
    echo "Starting HomeBridge"
    su -c "/usr/bin/forever start /usr/local/lib/node_modules/homebridge/bin/homebridge" pi
    exit 0
    ;;
  stop)
    echo "Stopping Homebridge"
    su -c "/usr/bin/forever stop /usr/local/lib/node_modules/homebridge/bin/homebridge" pi    
    exit 0
    ;;
  restart)
    echo "Restarting Homebridge"
    su -c "/usr/bin/forever restart /usr/local/lib/node_modules/homebridge/bin/homebridge" pi    
    exit 0
    ;;
  *)
    echo "Usage: /etc/init.d/homebridge.sh {start|stop}"
    exit 1
    ;;
esac
Save with ctrl+o. Exit with ctrl-x. Now run the following command:

Code: Select all

sudo chmod +x /etc/init.d/homebridge.sh && sudo update-rc.d homebridge.sh defaults
Homebridge will now load at boot up. To manually start/stop/restart homebridge, simply type

Code: Select all

/etc/init.d/homebridge.sh start
/etc/init.d/homebridge.sh stop
/etc/init.d/homebridge.sh restart
Last edited by Marci on Friday 29 July 2016 11:14, edited 5 times in total.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
User avatar
deejc
Posts: 168
Joined: Tuesday 22 September 2015 18:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5641
Location: UK
Contact:

Re: eDomoticz Homebridge-Plugin

Post by deejc »

Will it wipe out my scenes and / or triggers setup in Home app ?


Sent from my iPhone using Tapatalk
Domoticz 3.5641 on RPI (Raspbian GNU/Linux 8)
steppi
Posts: 41
Joined: Saturday 30 January 2016 0:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: eDomoticz Homebridge-Plugin

Post by steppi »

Now it works perfectly eDomoticz! Compliments!
I would like to be able to handle even the built-in amplifier my AVR Pioneer SC-2024. Etherenet has a connection, so even an app for iOS. I wish I could manage with Domoticz / Homebridge / eDomoticz .. For example, "Siri turn on the music" as already exists for this: https://github.com/luc-ass/homebridge-marantzavr
My AVR can be connected via telnet and precise commands ..
Do you have any idea?

thank you! Hello!!
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: eDomoticz Homebridge-Plugin

Post by Marci »

deejc wrote:Will it wipe out my scenes and / or triggers setup in Home app ?


Sent from my iPhone using Tapatalk
If you have to nuke persist/ then quite probably, yes. No way round it unfortunately - although I haven’t looked into it extensively.

EDIT: I’m hoping https://github.com/nfarina/homebridge/pull/497 may fix this in the future...
Last edited by Marci on Monday 01 February 2016 19:45, edited 1 time in total.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests