Siri / HomeKit support for Domoticz

Moderator: leecollings

Post Reply
Joep
Posts: 5
Joined: Monday 08 December 2014 20:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Siri / HomeKit support for Domoticz

Post by Joep »

Using Siri with Domoticz via Apple HomeKit is difficult because Domoticz must comply for Apple’s Made for iPhone-program (MFi).
Past sunday I discovered the homebrigde project at GitHub. It is a light NodeJS server emulating the iOS HomeKit API.

I wrote a (so called) platform shim for Domoticz that imports the light switches to homebrigde (HomeKit). With that you can use any HomeKit aware app on your iPhone to control the lights. You can also use Siri to control your lights!

I wrote a simplified howto on my website, but this is in Dutch. You can find general install instructions in English on the homebrigde GitHub site. To enable Domoticz you have to enter your Domoticz server information in config.json:

Code: Select all

{
    "description": "Configuration file for Domoticz platform.",
    "platforms": [
        {
            "platform": "Domoticz",
            "name": "Domoticz",
            "server": "127.0.0.1",
            "port": "8080"
        }
    ],
    "accessories": [
    ]
}
My platform shim only supports HTTP for now. Authentication must be disabled. I'm working on that the next weeks.

If you get it running you can add your actuators to your HomeKit aware app. A free app is: Insteon+. The PIN for all actuators is 031-45-154. If you classify your actuators in rooms you can ask Siri to turn on/of or dim lights in a specific room! Hey Siri! turn on the living room lights will turn on all lights in the living room!

HomeKit is not yet fool proof. Apple is still developing it. Due the emulated API there is no actuator state feedback from/to Domoticz/HomeBrigde, but I't a lot of fun to experiment with and impress your friends!
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Siri / HomeKit support for Domoticz

Post by gizmocuz »

very nice ! Going to have a lot of fun with this, thanks for sharing !

The only thing i do not understand is how it fetches the domoticz sensors?
$ npm run start Starting HomeBridge se ... witches...

i see in the config you only supplied the platform parameters, but i do not see where any json call is called to fetch all light sensors ?

/Rob
Quality outlives Quantity!
User avatar
Dynamic
Posts: 109
Joined: Friday 12 July 2013 14:50
Target OS: -
Domoticz version:
Location: Enschede
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Dynamic »

Really, really cool! Sounds promising!
I tried to install it, but failed so far. NPM isn't working for some strange reason (I already responded at your post @Tweakers).
Shyam
Posts: 46
Joined: Sunday 11 May 2014 22:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Shyam »

I've been using https://github.com/KhaosT/HAP-NodeJS and adding the accessories manually! Your way seems much more efficient as it imports in all the accessories!

Does the Shim you wrote only apply to light switches?
Raspberry Pi B+
Rfxcomm rfxtrx433
LigthwaveRF
Byron Door Bell
Accenta Gen4 Security System Integration
HomeEasy PIR
Nest Thermostat
Geofencing
Pushover
Blog: http://www.shyambhundia.com
Joep
Posts: 5
Joined: Monday 08 December 2014 20:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Joep »

gizmocuz wrote: The only thing i do not understand is how it fetches the domoticz sensors?
In config.son you define the server parameters. In the folder platforms the Domoticz.js file exists, which does the magic by importing and process the switches.
Shyam wrote:Does the Shim you wrote only apply to light switches?
Yes, only switches. Lights, openers. What you defined. It detects if a switch is on/of or a dimmer and configures it accordingly for HomeKit.

You cannot run scenes from Siri (ex. say: Hey Siri!, run the wake-up scene!), so I want to implement reading scene information and map it to HomeKit on/off switches.
This is a WIP and post the updates here, but first I'm a couple of days off the grid to Pinkpop 8-)
D'rMorris
Posts: 138
Joined: Thursday 01 May 2014 9:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands - Sittard
Contact:

Re: Siri / HomeKit support for Domoticz

Post by D'rMorris »

Have fun at Pinkpop :)! When you get back, can you let us know how you installed NPM? I've searched various forums, but did not find an answer yet.
I'm trying to install it on my RPi B (the original one, not the V2). Seems that there is an issue with NPM on ARM6. When I had it installed, I got errors when running epm install. Now, I removed it and installed a different version and now I get segmentation fault. Any ideas?
Joep
Posts: 5
Joined: Monday 08 December 2014 20:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Joep »

I installed Domoticz and NodeJS on OSX (Mavericks) and it worked out of the box following the instructions on the GitHub repo.
So I can't help you with this. Have you checked if there is an other apt-get repo with a good NPM? A quick Google query shows a lot of NodeJS/NPN howto's for the RPi. :)
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Siri / HomeKit support for Domoticz

Post by gizmocuz »

after struggling for some hours, i found out that this node needs "node.js 0.12.x"

i got it working with node, and installed the insteon application.
I am able to control the lights with this application.

But not from siri, it does not find any rooms/lights.

i'm on ios 8.3, did i miss something ?
Quality outlives Quantity!
Joep
Posts: 5
Joined: Monday 08 December 2014 20:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Joep »

The NodeJS version is documented at the homebridge GitHub page, but I forgot to add it to my Dutch howto. Sorry :oops:
I edited the Dutch howto with the version.

It works flawless here. Are your actuator names in Domoticz English or Dutch. I use Dutch names and use the Dutch Siri.
You have to ask for room name, or device name. But if a device is named "Radio", Siri wil start radio on the iPhone. So names used by Apple are not working.

You have to create the rooms in the HomeKit (Insteon+) app. The rooms are not loaded from Domoticz as this is not possible at the moment.

Here some screenshots:

Image

Image
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Siri / HomeKit support for Domoticz

Post by gizmocuz »

ahhh .... wait wait.....

i did not do anything for quite some time (think 30 minutes)... and then in the console output from homebridge i received log lines like:

Code: Select all

New Session 54617
New Session 54618
Server Connection Established 57100
Server Connection Established 37751
Start Verify M1
Verify M1 Finished
Start Verify M1
Verify M1 Finished
Start Verify M3
M3: Verify Success
Start Verify M3
M3: Verify Success
Handle Add Pairing Info
Handle Add Pairing Info
...
and now i can turn them on ;)

how very very great this is ;).... time to use it on my live system ;)
Quality outlives Quantity!
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Siri / HomeKit support for Domoticz

Post by gizmocuz »

could you add an additional step to launch homebridge at startup of the system ?
Quality outlives Quantity!
Joep
Posts: 5
Joined: Monday 08 December 2014 20:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Joep »

I don't get you? To my howto?
That is possible, but it is system specific, so I have to figure all system start-up parameters out first.
v40jlt4
Posts: 20
Joined: Saturday 24 January 2015 13:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Netherlands
Contact:

Re: Siri / HomeKit support for Domoticz

Post by v40jlt4 »

Dynamic wrote:Really, really cool! Sounds promising!
I tried to install it, but failed so far. NPM isn't working for some strange reason (I already responded at your post @Tweakers).
Would love to get this to work, on my raspberry pi with razberry 2. but I think I have the same problem:

wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb


so far so good.

git clone https://github.com/nfarina/homebridge.git
cd homebridge
git submodule init
git submodule update
npm install


"npm install" seems to hang indefinitely on my rPi.
Last edited by v40jlt4 on Friday 12 June 2015 17:36, edited 1 time in total.
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Siri / HomeKit support for Domoticz

Post by gizmocuz »

Joep wrote:I don't get you? To my howto?
That is possible, but it is system specific, so I have to figure all system start-up parameters out first.
Thats true ;) Maybe you could add a how-to to the domoticz wiki ?

i created a pull request:

https://github.com/nfarina/homebridge/pull/25

Implemented:
- Added support for RGB lights
- Added support for Scenes
- Sorting device names
Quality outlives Quantity!
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Re: Siri / HomeKit support for Domoticz

Post by pvm »

Nice job!

Found some additional required packages, but got things running now!

Described installation on the wiki: link to wiki
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
Heisenberg
Posts: 135
Joined: Monday 27 January 2014 14:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Heisenberg »

pvm wrote:Nice job!

Found some additional required packages, but got things running now!

Described installation on the wiki: link to wiki
I followed the wiki but get this error:

Code: Select all

pi@domoticzpi ~ $ cd homebridge
pi@domoticzpi ~/homebridge $ npm run start

> [email protected] start /home/pi/homebridge
> node app.js

Starting HomeBridge server...
Couldn't find a config.json file in the same directory as app.js. Look at config-sample.json for examples of how to format your config.js and add your home accessories.

npm ERR! Linux 3.18.11-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v0.12.1
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node app.js'.
npm ERR! This is most likely a problem with the homebridge package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node app.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls homebridge
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/pi/homebridge/npm-debug.log

Raspberry Pi Type B
Raspberry Pi Type B2
RFXCOMtrx433e
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Re: Siri / HomeKit support for Domoticz

Post by pvm »

Ah, thnx.
I missed the config file part, added: HomeBridge config
(wanted to test too quickly after starting :) )
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
Heisenberg
Posts: 135
Joined: Monday 27 January 2014 14:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Heisenberg »

Nice thnx!
After installing the app Insteon+ I can add the devices and Siri works like a charm. My sunscreen now opens when I talk to Siri :)
Does npm start automatically?
Raspberry Pi Type B
Raspberry Pi Type B2
RFXCOMtrx433e
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Siri / HomeKit support for Domoticz

Post by pvm »

No it does not. Probably best to add to rc.local
I do not have time to experiment now. When somebody tested, please add to wiki
Last edited by pvm on Friday 12 June 2015 15:23, edited 1 time in total.
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
User avatar
Mediacj
Posts: 74
Joined: Wednesday 11 February 2015 16:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Mediacj »

Thanks all for making/sharing and documenting this!

With Insteon I couldn't get it authenticated because my login credentials where not accepted, so I looked for an other app and found the Homekit app Eve which has no subscription and worked flawless also with Siri in dutch.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests