# Homekit users - which nodes have you installed?

**URL:** https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044
**Category:** General
**Created:** [12 May 2019 16:26 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044 "2019-05-12T16:26:41Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![877](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/877/32/8207_2.png) [@877](https://discourse.nodered.org/u/877)
#### Post date: [12 May 2019 16:26 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/1 "2019-05-12T16:26:41Z")

</div>

I'm using the [Homekit bridged node](https://github.com/NRCHKB/node-red-contrib-homekit-bridged) , however there is a [known bug](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/12) which means that node red needs restarting after every deploy (otherwise the Homekit nodes do not work).

The developer is working on a fix, which I am grateful for their hard work. But in the meantime, I'm interested what nodes other Homekit users are using.

As to be honest it is quite a nuisance to restart node red after each minor change/deployment.

Thanks 🙂

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [12 May 2019 16:50 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/2 "2019-05-12T16:50:09Z")

</div>

I started with the homekit node, but have switched to [homebridge-mqtt](https://github.com/cflurin/homebridge-mqtt), this made everything so much faster and I haven't had any issues with homekit and can create any type of homekit device I want.

Deploy and the device is instantly added/removed, updated etc.  
(yes it will require mqtt and homebridge but it is worth it).

---

<div class="post-metadata">

### Author: ![877](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/877/32/8207_2.png) [@877](https://discourse.nodered.org/u/877)
#### Post date: [12 May 2019 17:41 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/3 "2019-05-12T17:41:50Z")

</div>

@bakman2 thanks for the speedy reply, I will give that a look.

I’m currently running Node Red and Mosquitto MQQT on a Raspberry Pi3, I take it it’s no problem to also install home bridge on that setup?

Did you just follow the homebridge Raspberry Pi setup guide?

> **[nfarina/homebridge](https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi)**
>
> HomeKit support for the impatient. Contribute to nfarina/homebridge development by creating an account on GitHub.

Thanks 👍

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [12 May 2019 17:56 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/4 "2019-05-12T17:56:42Z")

</div>

I have it running in a [docker container](https://github.com/oznu/docker-homebridge/wiki/Homebridge-on-Raspberry-Pi) on the pi. If you have docker/compose installed you can start at step 3.

---

<div class="post-metadata">

### Author: ![877](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/877/32/8207_2.png) [@877](https://discourse.nodered.org/u/877)
#### Post date: [12 May 2019 18:30 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/5 "2019-05-12T18:30:52Z")

</div>

Cheers, I will have a look. Not used Docker before so I will give it a google 👍

---

<div class="post-metadata">

### Author: ![877](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/877/32/8207_2.png) [@877](https://discourse.nodered.org/u/877)
#### Post date: [13 May 2019 20:15 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/6 "2019-05-13T20:15:50Z")

</div>

@bakman2 I now have Homebridge running under docker, might I trouble you for some info?

I have the Homebridge hub showing up on my phone Home app, but having trouble with the MQQT setup.

I'm pretty sure it's the config.json, here it is:

```auto
{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },
    "platforms": [
        {
            "platform": "mqtt",
            "name": "mqtt",
            "url": "http://192.168.1.95",
            "port": "1883",
            "topic_type": "multiple",
            "topic_prefix": "homebridge",
            "username": "",
            "password": "",
            "qos": 1
        }
    ],
    "accessories": []
}

```

I don't have a username or password for Mosquitto MQQT server, in node red the fields are blank. I've tried lots of variations but it just won't connect, I get the "server restart is taking a long time" error.

Apologies as this is not technically a node red issue 😊

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [13 May 2019 20:33 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/7 "2019-05-13T20:33:17Z")

</div>

Where do you get this error ? In homebridge/docker ?

Removing the username & password keys helps ?

---

<div class="post-metadata">

### Author: ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)
#### Post date: [13 May 2019 20:42 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/8 "2019-05-13T20:42:47Z")

</div>

If you don't need the username and the password, you have to remove these parameters:

```auto
{
	"bridge": {
		"name": "Homebridge",
		"username": "CC:22:3D:E3:CE:30",
		"port": 51826,
		"pin": "031-45-154"
	},
	"platforms": [{
		"platform": "mqtt",
		"name": "mqtt",
		"url": "http://192.168.1.95",
		"port": "1883",
		"topic_type": "multiple",
		"topic_prefix": "homebridge",
		"qos": 1
	}],
	"accessories": []
}

```

---

<div class="post-metadata">

### Author: ![877](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/877/32/8207_2.png) [@877](https://discourse.nodered.org/u/877)
#### Post date: [13 May 2019 20:52 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/9 "2019-05-13T20:52:27Z")

</div>

@bakman2 In the Homebridge UI [http://192.168.1.95:8080](http://192.168.1.95:8080)

Hi @cflurin I tried removing those fields and get the same error.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [13 May 2019 20:55 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/10 "2019-05-13T20:55:08Z")

</div>

I don't use the UI, don't know what the output is.

Could you try from the commandline ?  
`docker restart homebridge` (or whatever it is called - `docker ps` will show the container name)  
followed by  
`docker logs -f homebridge`

---

<div class="post-metadata">

### Author: ![877](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/877/32/8207_2.png) [@877](https://discourse.nodered.org/u/877)
#### Post date: [13 May 2019 21:11 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/11 "2019-05-13T21:11:44Z")

</div>

Yes no problem, mine is called homebridge\_homebridge\_1 for some reason.

Here is the output:

```auto
[5/13/2019, 8:17:47 PM] Homebridge is running on port 51826.
[5/13/2019, 9:05:32 PM] [Config] Changes to config.json saved.
[5/13/2019, 9:05:39 PM] [Config] Homebridge restart request received
[5/13/2019, 9:05:39 PM] [Config] Executing restart command: killall -9 homebridge && killall -9 homebridge-config-ui-x
Killed
Killed
-U /homebridge -P /homebridge/node_modules -C
[5/13/2019, 9:05:44 PM] Loaded config.json with 0 accessories and 1 platforms.
[5/13/2019, 9:05:44 PM] ---
[5/13/2019, 9:05:44 PM] Loaded plugin: homebridge-dummy
[5/13/2019, 9:05:44 PM] Registering accessory 'homebridge-dummy.DummySwitch'
[5/13/2019, 9:05:44 PM] ---
[5/13/2019, 9:05:44 PM] Loaded plugin: homebridge-config-ui-x
[5/13/2019, 9:05:44 PM] Registering platform 'homebridge-config-ui-x.config'
[5/13/2019, 9:05:44 PM] ---
[5/13/2019, 9:05:44 PM] Loading 1 platforms...
[5/13/2019, 9:05:44 PM] Error: The requested platform 'mqtt' was not registered by any plugin.
    at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:134:13)
    at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:327:45)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:90:36)
    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
[5/13/2019, 9:05:44 PM] Got SIGTERM, shutting down Homebridge...
[5/13/2019, 9:05:46 PM] [Config] Console v4.4.0 is listening on :: port 8080
-U /homebridge -P /homebridge/node_modules -C
[5/13/2019, 9:05:53 PM] Loaded config.json with 0 accessories and 1 platforms.
[5/13/2019, 9:05:53 PM] ---
[5/13/2019, 9:05:53 PM] Loaded plugin: homebridge-dummy
[5/13/2019, 9:05:53 PM] Registering accessory 'homebridge-dummy.DummySwitch'
[5/13/2019, 9:05:53 PM] ---
[5/13/2019, 9:05:53 PM] Loaded plugin: homebridge-config-ui-x
[5/13/2019, 9:05:53 PM] Registering platform 'homebridge-config-ui-x.config'
[5/13/2019, 9:05:53 PM] ---
[5/13/2019, 9:05:53 PM] Loading 1 platforms...
[5/13/2019, 9:05:53 PM] Error: The requested platform 'mqtt' was not registered by any plugin.
    at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:134:13)
    at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:327:45)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:90:36)
    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)

```

and it repeats the same over and over.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [13 May 2019 21:17 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/12 "2019-05-13T21:17:51Z")

</div>

Quite clear 😉

With docker you can link the config file to your local filesystem (else it will reside inside the container which will be overwritten when you update the container).  
Did you install homebridge using the docker-compose method ?

---

<div class="post-metadata">

### Author: ![877](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/877/32/8207_2.png) [@877](https://discourse.nodered.org/u/877)
#### Post date: [13 May 2019 21:25 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/13 "2019-05-13T21:25:33Z")

</div>

Ah after reading through the log I think I see my mistake.

I installed the plugin via command line "sudo npm install -g homebridge-mqtt", but I think I installed it to the wrong folder.

I now just went into the Homebridge UI and installed the plugin, and after reboot it started first time!

 ![39](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/307661def50410fb64608074464a56617e8d9719.png)

Why don't you like using the UI? Probably I like it as it seems nice and safe and squishy 😆

Tomorrows task, learn more about creating flows with this new tool!

Thanks for your help!!! 👍

Ps also many thanks to @cflurin for the plugin 👍

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [13 May 2019 21:27 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/14 "2019-05-13T21:27:35Z")

</div>

UI is very nice, I am just more comfortable on the commandline as I can see stuff happening 😉

I like homebridge-mqtt a lot, don't hesitate if you got questions.

---

<div class="post-metadata">

### Author: ![877](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/877/32/8207_2.png) [@877](https://discourse.nodered.org/u/877)
#### Post date: [13 May 2019 21:30 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/15 "2019-05-13T21:30:53Z")

</div>

Yes that's true, I would have fixed the error if I knew how to read the log 😊

Thanks for all the help, I really appreciate it! 👍

I have to get some sleep now but I will have a good look tomorrow and start setting things up, I'll let you know how I get on. 😄

---

<div class="post-metadata">

### Author: ![877](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/877/32/8207_2.png) [@877](https://discourse.nodered.org/u/877)
#### Post date: [14 May 2019 18:15 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/16 "2019-05-14T18:15:55Z")

</div>

OK so I have had an hour looking at it and I am impressed with the responsiveness! 👍

I've created a couple of simple flows to add/remove a switch and to control the switch state from node red.

 ![34](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/269b79fcb3bee73917bfc078e2b6a76da4a6d390.png)

I have to admit I am struggling with the whole concept of how to build flows. I 'think'' the whole thing runs on mqtt nodes, and each device is individually controlled by sending different payloads?

My existing mqtt setup uses this format:

house/lounge/sensor  
house/kitchen/light  
garage/light  
and so on......

This does not seem possible with this setup, as everything uses the same topic, but with a different payload.

So for now I am unsure how to create a simple flow such as the below example of a dashboard switch and a Homekit switch controlling a Sonoff via mqtt.

 ![24](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/68ddb36dbb8d9ed2883de6aed873768a50f8d156.png)

I will continue to read as I'm sure I am misunderstanding something, any hints and tips would be much appreciated! 😄

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [14 May 2019 18:31 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/17 "2019-05-14T18:31:53Z")

</div>

With the MQTT-out node, you can set msg.topic in the incoming msg and leave the topic blank in the MQTT node. That way, multiple mqtt messages with different topics can use the same node.

in your example, it you had a `change` node after each `inject` node that built msg.topic with the correct topic, they could all use one mqtt-out node.

For mqtt-in nodes, you can use `#` as a widl card you could have `homebridge/from/#` which would get both topic `homebridge/from/response` and `homebridge/from/get`, just use a switch node to directthe message to the leg of the flow you want.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [14 May 2019 19:52 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/18 "2019-05-14T19:52:30Z")

</div>

Example flow I use with homekit

```auto
[{"id":"534c1b6.4260ee4","type":"mqtt out","z":"fb27fd4d.7e296","name":"","topic":"","qos":"0","retain":"false","broker":"228872c0.fd94d6","x":579,"y":138,"wires":[]},{"id":"4c9b626f.ae5614","type":"mqtt in","z":"fb27fd4d.7e296","name":"","topic":"homebridge/from/set/Fan","qos":"2","datatype":"json","broker":"228872c0.fd94d6","x":156,"y":92,"wires":[["7b840a95.24a784"]]},{"id":"df38a4fd.368268","type":"mqtt in","z":"fb27fd4d.7e296","name":"","topic":"homebridge/from/set/Boiler","qos":"2","datatype":"json","broker":"228872c0.fd94d6","x":166,"y":138,"wires":[["7b840a95.24a784"]]},{"id":"db5998c2.7eaf78","type":"mqtt in","z":"fb27fd4d.7e296","name":"","topic":"homebridge/from/set/Kleine Lamp","qos":"2","datatype":"json","broker":"228872c0.fd94d6","x":186,"y":184,"wires":[["7b840a95.24a784"]]},{"id":"7b840a95.24a784","type":"function","z":"fb27fd4d.7e296","name":"","func":"destination_topic = []\nm = msg.payload.value\nsource_topic = msg.topic\n\ndestination_topic[\"homebridge/from/set/Fan\"] = \"livingroom/fan/cmnd/POWER\" \ndestination_topic[\"homebridge/from/set/Boiler\"] = \"Boiler/relay/0/set\" \ndestination_topic[\"homebridge/from/set/Kleine Lamp\"] = \"livingroom/switch/cmnd/POWER\" \n\nif(m){\n return {topic:destination_topic[source_topic],payload:1}\n}\nelse{\n return {topic:destination_topic[source_topic],payload:0}\n}\n","outputs":1,"noerr":0,"x":441,"y":138,"wires":[["534c1b6.4260ee4","41619320.1d614c"]]},{"id":"41619320.1d614c","type":"debug","z":"fb27fd4d.7e296","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":578,"y":198,"wires":[]},{"id":"228872c0.fd94d6","type":"mqtt-broker","z":"","name":"mqtt","broker":"10.0.0.202","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""}]

```

---

<div class="post-metadata">

### Author: ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)
#### Post date: [15 May 2019 07:14 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/19 "2019-05-15T07:14:54Z")

</div>

It doesn't work this way. Please read the doc.  
You should also be familiar with the HomeKit protocol (HAP)

Example to turn on a lamp:

```auto
topic: homebridge/to/set

payload: 
{
 	"name": "flex_lamp",
 	"service_name": "light",
 	"characteristic": "On",
 	"value": true
 }

```

The `name` and the `service_name` can you define for your device.  
the `characteristic` `On` and the `value` `true` or `fasle` have to be conform with the HAP.

Have a look here for all services and characteristcs:

[https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/gen/HomeKitTypes.js](https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/gen/HomeKitTypes.js)

and here for an introduction:

[https://github.com/cflurin/homebridge-mqtt/wiki/homebridge2NodeRED](https://github.com/cflurin/homebridge-mqtt/wiki/homebridge2NodeRED)

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [15 May 2019 07:31 UTC](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044/20 "2019-05-15T07:31:23Z")

</div>

It works that way towards my devices, not to homekit. Perhaps it is a bad example I would agree :')

[Next page](https://discourse.nodered.org/t/homekit-users-which-nodes-have-you-installed/11044.md?page=2)
