Siri / HomeKit support for Domoticz

Moderator: leecollings

Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Bikey »

deejc wrote:
Bikey wrote:
Not all devices have two way communication, e.g. LightwaveRF devices. Its not possible for HomeKit (or indeed Domoticz) to keep its status in sync.
i understand the concept,i have z-wave devices and rfxcom devices, Domoticz knows about the state of certain devices when i use the web gui but firing Eve up it does not reflect the state of these devices.
That was not my quote, but lukeredpath's... I totaly agree that it must be possible for HomeKit to reflect the status of the devices as they are presented in Siri. For this, however it should poll Domoticz at a regular basis to request the device list with the statuses.
I see that e.g. non Siri Apps like Imperihome have implemented this in the App.

I have to remark that I also use the bridge to directly control Hue lights, and also the status of those lamps is not propagated to Eve if switched via another remote. So the polling is not implemented as a general function in the bridge.
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Bikey »

lukeredpath wrote:
Ok I'm with you now, so the problem is not setting the level but that the level is not being reported correctly in the other direction? It's possible there's a similar bug, I will take a look.

I still think it's a bug on the Domoticz side that it accepts levels between 1-16 if it's max dim level is 15 though.
Yes, that's is correct. As a result of the level not reported correctly to Siri, it only will send limited levels back as a command.
You are right that 1-16 as command values for a MaxdimLevel of 15 is questionable, although this is as described I the WiKi
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: Siri / HomeKit support for Domoticz

Post by deejc »

Bikey wrote: That was not my quote, but lukeredpath's...
sorry i edited the post.. still its frustrating!
Domoticz 3.5641 on RPI (Raspbian GNU/Linux 8)
woods
Posts: 8
Joined: Friday 30 October 2015 17:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Siri / HomeKit support for Domoticz

Post by woods »

Hi guys,

I'm testing Domoticz on Windows. Is it possible to activate HomeBridge on this platform?

Trying to follow the guide on Wiki, but it's for the r-pie.

Code: Select all

Create config.json file in the HomeBridge directory:

cd ~/homebridge/
nano config.json
If possible; coulde someone point me where I should start? Thanks!
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Bikey »

Bikey wrote:
lukeredpath wrote:
Ok I'm with you now, so the problem is not setting the level but that the level is not being reported correctly in the other direction? It's possible there's a similar bug, I will take a look.

I still think it's a bug on the Domoticz side that it accepts levels between 1-16 if it's max dim level is 15 though.
Yes, that's is correct. As a result of the level not reported correctly to Siri, it only will send limited levels back as a command.
You are right that 1-16 as command values for a MaxdimLevel of 15 is questionable, although this is as described I the WiKi
Ok, I just tested things by changing Domoticz.js in the platforms directory.
I have changed line 329:
designedMaxValue: this.MaxDimLevel
to:
designedMaxValue: 100

Now Siri sees a maximum level of 100%. If I ask Siri to dim back to 50% it sends a level 8 to Domoticz (50% * 15 rounded upwards to 8. 49% results in level 7). That now works perfect!

Now there is only still one bug: Domoticz reports back a MaxDimLevel of 15 but needs values between 1 - 16. Also if you send e.g. 8 as a command in JSON you get back a level 7!
alexsh1
Posts: 169
Joined: Wednesday 30 September 2015 11:50
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8975
Location: United Kingdom
Contact:

Re: Siri / HomeKit support for Domoticz

Post by alexsh1 »

mschut wrote:Hmm, I did a first install according to the wiki. I started at the configuration part, because I have a recent SD card image for the Pi. However, I didn't got it working.

So, today I started all over again, performing all actions in the wiki. However, now I am stuck way sooner: At the part "Install dependencies", the command "node -v" results in:

Code: Select all

node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by node)
node: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.16' not found (required by node)
Any idea/help appreciated...
Did you get it sorted? Wiki is outdated - you have to follow the Github instructions. They have a manual for RPi users.
Stick to node 0.12.6 otherwise you need to upgrade to Jessie. The above error tells me that you have upgraded your node (v4***) and not upgraded your system.
Downgrade it to v.0.12.6
alexsh1
Posts: 169
Joined: Wednesday 30 September 2015 11:50
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8975
Location: United Kingdom
Contact:

Re: Siri / HomeKit support for Domoticz

Post by alexsh1 »

This was a very useful guide to install homebridge on the RPi2


https://github.com/cflurin/homebridge-s ... spberry-Pi

and the following pm2 works fine on RPi2

pm2 start "/usr/local/bin/npm" --name "myAPP" -- start
simon_rb
Posts: 612
Joined: Wednesday 07 August 2013 19:09
Target OS: -
Domoticz version:
Location: UK
Contact:

Siri / HomeKit support for Domoticz

Post by simon_rb »

Forgive me for being stupid however I am looking to get this installed tomorrow on my Pi, I tried before and was unsuccessful. The above link says its for an old homebridge. The GitHub instructions say that it needs to be updated as it installs Nodes 4.x.x which doesn't work with wheezy.

What guide should I follow to install homebridge on wheezy?

Thank you :-)
alexsh1
Posts: 169
Joined: Wednesday 30 September 2015 11:50
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8975
Location: United Kingdom
Contact:

Re: Siri / HomeKit support for Domoticz

Post by alexsh1 »

simon_rb wrote:Forgive me for being stupid however I am looking to get this installed tomorrow on my Pi, I tried before and was unsuccessful. The above link says its for an old homebridge. The GitHub instructions say that it needs to be updated as it installs Nodes 4.x.x which doesn't work with wheezy.

What guide should I follow to install homebridge on wheezy?

Thank you :-)
Every guide is getting outdated. The only question is when.
If you are on wheezy, please stick to node 0.12.6 - I can confirm it works with homebridge.
You have to install the following
1) all dependencies
2) homebridge (please check your package.json file and search any info on https://github.com/nfarina/homebridge)
3) homebridge-legacy-plugins and any extra plugins via npm
4) configure your config.json file (you may need to add 127.0.0.1 to the trusted sites in your Domoticz settings if you have a username/password login)
5) npm start run to run homebridge

I must state that the installation process is very tedious after the recently introduced changes.
simon_rb
Posts: 612
Joined: Wednesday 07 August 2013 19:09
Target OS: -
Domoticz version:
Location: UK
Contact:

Re: Siri / HomeKit support for Domoticz

Post by simon_rb »

alexsh1 wrote:
simon_rb wrote:Forgive me for being stupid however I am looking to get this installed tomorrow on my Pi, I tried before and was unsuccessful. The above link says its for an old homebridge. The GitHub instructions say that it needs to be updated as it installs Nodes 4.x.x which doesn't work with wheezy.

What guide should I follow to install homebridge on wheezy?

Thank you :-)
Every guide is getting outdated. The only question is when.
If you are on wheezy, please stick to node 0.12.6 - I can confirm it works with homebridge.
You have to install the following
1) all dependencies
2) homebridge (please check your package.json file and search any info on https://github.com/nfarina/homebridge)
3) homebridge-legacy-plugins and any extra plugins via npm
4) configure your config.json file (you may need to add 127.0.0.1 to the trusted sites in your Domoticz settings if you have a username/password login)
5) npm start run to run homebridge

I must state that the installation process is very tedious after the recently introduced changes.
Thanks for that. I'll see how I get on. Is it working more reliably now with all switches from domoticz staying there. They kept disappearing when I had this working a few months back. That was with iOS 8, I'm guessing now iOS 9 is out its a bit better.

Cheers
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Bikey »

Bikey wrote:
Bikey wrote:
lukeredpath wrote:
Ok I'm with you now, so the problem is not setting the level but that the level is not being reported correctly in the other direction? It's possible there's a similar bug, I will take a look.
Ok, I just tested things by changing Domoticz.js in the platforms directory.
I have changed line 329:
designedMaxValue: this.MaxDimLevel
to:
designedMaxValue: 100

Now Siri sees a maximum level of 100%. If I ask Siri to dim back to 50% it sends a level 8 to Domoticz (50% * 15 rounded upwards to 8. 49% results in level 7). That now works perfect!
Will this bug fix (designedMaxValue:100) be included in the code?
SuppleX
Posts: 2
Joined: Saturday 05 July 2014 13:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Siri / HomeKit support for Domoticz

Post by SuppleX »

Hi,

Quick question here. Just tried to follow the guide on https://www.domoticz.com/wiki/Homekit_Siri.
All prereqs install correctly but the moment i enter "npm run start" i get the following error.

/usr/local/lib/node_modules/homebridge/lib/server.js:124
throw err;
^

SyntaxError: Unexpected token “
at Object.parse (native)
at Server._loadConfig (/usr/local/lib/node_modules/homebridge/lib/server.js:118:19)
at new Server (/usr/local/lib/node_modules/homebridge/lib/server.js:25:23)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:23:3)
at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)

This is based on a config for philips hue. The moment i configure domoticz it will complain about:

Error: The requested platform 'Domoticz' was not registered by any plugin.
at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:88:13)
at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.

Any idea what i am missing?
alexsh1
Posts: 169
Joined: Wednesday 30 September 2015 11:50
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8975
Location: United Kingdom
Contact:

Re: Siri / HomeKit support for Domoticz

Post by alexsh1 »

SuppleX wrote:
This is based on a config for philips hue. The moment i configure domoticz it will complain about:

Error: The requested platform 'Domoticz' was not registered by any plugin.
at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:88:13)
at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.

Any idea what i am missing?

The wiki link is outdated. Please check out the link I posted above or alternatively try the following: https://github.com/nfarina/homebridge/w ... spberry-Pi

You need to install homebridge-legacy-plugins

IMPORTANT
Homebridge has recently spun off its included accessories into a new module homebridge-legacy-plugins which contains our previous integrations for popular devices like Nest, WeMo, Sonos, Hue, and many more.
SuppleX
Posts: 2
Joined: Saturday 05 July 2014 13:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Siri / HomeKit support for Domoticz

Post by SuppleX »

Thanks, problem solved!
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Bikey »

Ok, I have also solved the other issue being that Domticz expects for RFXCOM-based (KaKu) dimmers values between 1-16, even if it reports MaxDimLevel 15 in the API.
I have changed the following in the Domoticz.js file in the platforms subdirectory:

In this function:

dimmerLevelForValue: function(value) {
if (this.MaxDimLevel == 100) {
return value;}
return Math.round(((value / 100.0) * this.MaxDimLevel)+1) }

I have changed:
return Math.round((value / 100.0) * this.MaxDimLevel)
to:
return Math.round(((value / 100.0) * this.MaxDimLevel)+1)

Now finally I can get my dimmers back to 100%! And the other values % SIRI reports now more closely match the values as being reported in the GUI of Domoticz.

I'm not sure if this also is needed for other non-RFXCOM/KaKu dimmer-devices that work with values instead of % in the API. Are there others that work this way?
Perhaps others can check if that works for your configuration as well?
simon_rb
Posts: 612
Joined: Wednesday 07 August 2013 19:09
Target OS: -
Domoticz version:
Location: UK
Contact:

Re: Siri / HomeKit support for Domoticz

Post by simon_rb »

Does anyone have the command to install nodes 0.12 for wheezy? All guides are for version 4.0.

Cheers
simon_rb
Posts: 612
Joined: Wednesday 07 August 2013 19:09
Target OS: -
Domoticz version:
Location: UK
Contact:

Siri / HomeKit support for Domoticz

Post by simon_rb »

I have been on this for 8 hours and cannot get it working. Does anyone have it running on wheezy and nodes 0.12? If they have could you quickly write how you got this to work. Seems there is a lot of conflicting guides out there. Some say homebridge isn't compatible with nodes 4 yet the guide still uses it. I have 0.12 installed but still no luck.
Cheers

pi@raspberrypi ~/homebridge $ npm run start
npm ERR! Linux 4.1.6+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v0.12.6
npm ERR! npm v2.11.2

npm ERR! missing script: start
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/homebridge/npm-debug.log
pi@raspberrypi ~/homebridge $
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: Siri / HomeKit support for Domoticz

Post by deennoo »

Got the same issue as you, and

When installing legacy plug-ins :

Code: Select all

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/4.2.2"
Ho to solve this ?


Have to admit the one who is provid on Domoticz Sd card run well, but i made some test, and try make it run on i386 device running wheezy.

if some one can give some help, it will be very appriciated
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
alexsh1
Posts: 169
Joined: Wednesday 30 September 2015 11:50
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8975
Location: United Kingdom
Contact:

Re: Siri / HomeKit support for Domoticz

Post by alexsh1 »

deennoo wrote:Got the same issue as you, and

When installing legacy plug-ins :

Code: Select all

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/4.2.2"
Ho to solve this ?
You do not need to do anything - this is just a warning.


I believe the image on the SD card is for ARM (Raspberry Pi) - you would need to find a binary or compile Domoticz for i386
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: Siri / HomeKit support for Domoticz

Post by deejc »

is the shim being moved to the new plugin system ?
also, will this at any point be able to reflect the current state of the devices as show in Domoticz or will it never be able to gain that level of feedback ?
Domoticz 3.5641 on RPI (Raspbian GNU/Linux 8)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests