Siri / HomeKit support for Domoticz

Post Reply
Joep
Posts: 17
Joined: Monday 08 December 2014 21:11
Target OS: Raspberry Pi
Domoticz version:
Contact:

Siri / HomeKit support for Domoticz

Post by Joep » Thursday 11 June 2015 8:42

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: 8526
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi
Domoticz version: beta
Location: Top of the world
Contact:

Re: Siri / HomeKit support for Domoticz

Post by gizmocuz » Thursday 11 June 2015 9:16

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: 213
Joined: Friday 12 July 2013 14:50
Target OS: -
Domoticz version:
Location: Enschede
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Dynamic » Thursday 11 June 2015 10:25

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: 101
Joined: Sunday 11 May 2014 22:11
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Shyam » Thursday 11 June 2015 10:52

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: 17
Joined: Monday 08 December 2014 21:11
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Joep » Thursday 11 June 2015 11:26

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: 296
Joined: Thursday 01 May 2014 9:01
Target OS: Raspberry Pi
Domoticz version:
Location: Netherlands - Sittard
Contact:

Re: Siri / HomeKit support for Domoticz

Post by D'rMorris » Thursday 11 June 2015 11:42

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: 17
Joined: Monday 08 December 2014 21:11
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Joep » Thursday 11 June 2015 13:04

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: 8526
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi
Domoticz version: beta
Location: Top of the world
Contact:

Re: Siri / HomeKit support for Domoticz

Post by gizmocuz » Thursday 11 June 2015 18:39

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: 17
Joined: Monday 08 December 2014 21:11
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Joep » Thursday 11 June 2015 19:07

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: 8526
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi
Domoticz version: beta
Location: Top of the world
Contact:

Re: Siri / HomeKit support for Domoticz

Post by gizmocuz » Thursday 11 June 2015 19:12

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: 8526
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi
Domoticz version: beta
Location: Top of the world
Contact:

Re: Siri / HomeKit support for Domoticz

Post by gizmocuz » Thursday 11 June 2015 19:17

could you add an additional step to launch homebridge at startup of the system ?
Quality outlives Quantity!

Joep
Posts: 17
Joined: Monday 08 December 2014 21:11
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Joep » Thursday 11 June 2015 20:31

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: 21
Joined: Saturday 24 January 2015 14:22
Target OS: Raspberry Pi
Domoticz version: V3.8035
Location: Netherlands
Contact:

Re: Siri / HomeKit support for Domoticz

Post by v40jlt4 » Thursday 11 June 2015 23:45

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: 8526
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi
Domoticz version: beta
Location: Top of the world
Contact:

Re: Siri / HomeKit support for Domoticz

Post by gizmocuz » Friday 12 June 2015 8:44

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: 925
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: Stable
Location: NL
Contact:

Re: Siri / HomeKit support for Domoticz

Post by pvm » Friday 12 June 2015 8:48

Nice job!

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

Described installation on the wiki: link to wiki
Synology NAS, PI3, ZWave, Xiamo zigbee devices, BTLE plant sensor

Heisenberg
Posts: 286
Joined: Monday 27 January 2014 15:12
Target OS: Raspberry Pi
Domoticz version:
Location: Netherlands
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Heisenberg » Friday 12 June 2015 13:33

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

[email protected] ~ $ cd homebridge
[email protected] ~/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: 925
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: Stable
Location: NL
Contact:

Re: Siri / HomeKit support for Domoticz

Post by pvm » Friday 12 June 2015 13:40

Ah, thnx.
I missed the config file part, added: HomeBridge config
(wanted to test too quickly after starting :) )
Synology NAS, PI3, ZWave, Xiamo zigbee devices, BTLE plant sensor

Heisenberg
Posts: 286
Joined: Monday 27 January 2014 15:12
Target OS: Raspberry Pi
Domoticz version:
Location: Netherlands
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Heisenberg » Friday 12 June 2015 14:41

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: 925
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: Stable
Location: NL
Contact:

Siri / HomeKit support for Domoticz

Post by pvm » Friday 12 June 2015 15:21

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, PI3, ZWave, Xiamo zigbee devices, BTLE plant sensor

User avatar
Mediacj
Posts: 97
Joined: Wednesday 11 February 2015 17:09
Target OS: Raspberry Pi
Domoticz version:
Location: Netherlands
Contact:

Re: Siri / HomeKit support for Domoticz

Post by Mediacj » Friday 12 June 2015 16:04

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 2 guests