# Homekit-bridged + mDNS issue

**URL:** <https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594>\
**Category:** General\
**Created:** [6 November 2019 13:35 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594 "2019-11-06T13:35:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sapster77](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sapster77/32/14335_2.png) [@sapster77](https://discourse.nodered.org/u/sapster77)\
**Post date:** [6 November 2019 13:35 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/1 "2019-11-06T13:35:57Z")

</div>

Hi,  
I have run out of ideas and places to search, so I'm hoping someone may have an idea on what to try with regards to the following:

I have migrated my system to a Raspberry Pi 4 from a 3 and are now facing issues with my node-re-contrib-homekit+bridged nodes. All the items (openhab home automation) I expose to homekit via node red keeps dropping of from the native homekit app when I move from one mesh router to the other. I have google Wifi (mesh - 3 pucks) in my home and the homekit app and automations made in node-red function perfectly when my phone is connected to the same google access point as the raspberry. But when I move to another access point homekit nodes go "no response" immediately when I see my phone jumping from the "office" puck the "kitchen" one for example. I am thinking it is some kind of mDNS issue, but I am honestly not skilled enough to figure out how to troubleshoot it?

Things to note:

- Native homekit things like door sensors work fine - all the time.
- An Apple TV is the homekit hub.

I realize there is an mDNS config in the homekit-bridged setup, but I don't know what goes where?

Does anyone have any ideas?

Thank you!  
Cheers,  
Peter

---

<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:** [6 November 2019 13:45 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/2 "2019-11-06T13:45:49Z")

</div>

If you get the "no response", it is most likely due to the home-kit-hub not actually being the hub. It looks like it works, but in reality it doesn't. I gave up on these homekit-bridged nodes for the same reason. Every time you change something in your network (or even restart NR), these nodes will not communicate properly with the hub.

What could help in the short term: rename your "Home" on your i-device, logout the ATV, reboot the i-device login the ATV, and with fingers crossed, it works again. For longer term I would recommend [homebridge-mqtt](https://github.com/cflurin/homebridge-mqtt#readme), it might be little more convoluted to setup, but is extremely robust and have not failed me since the first setup. Whatever I restart/change in my network, this keeps working.

---

<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:** [6 November 2019 14:02 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/3 "2019-11-06T14:02:35Z")

</div>

> [@bakman2](#):
>
> For longer term I would recommend [homebridge-mqtt](https://github.com/cflurin/homebridge-mqtt#readme), it might be little more convoluted to setup, but is extremely robust ..

I agree 🙂

Adding the accessories can be easily done using node-red. I defined an object with all my accessories and used a function-node to add all them with one click.

---

<div class="post-metadata">

**Author:** ![sapster77](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sapster77/32/14335_2.png) [@sapster77](https://discourse.nodered.org/u/sapster77)\
**Post date:** [6 November 2019 15:29 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/4 "2019-11-06T15:29:32Z")

</div>

Thanks for your quick answers.  
I just thought the problem was a mDNS thing, since it keeps working when connected to the same google wifi puck that the raspberry is on, and only fails when I am automatically switched to another one. When moving back to the first wifi puck, accessories in homekit comes back online automatically.

I have however seen many say the same about Homebridge-mqtt as you. Looked into it a while back and thought it sounded like it was complicated to set up and to figure out where to start:-) But I think I will have a look at it again!

---

<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:** [6 November 2019 15:41 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/5 "2019-11-06T15:41:16Z")

</div>

Installation for the RPI: see [https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-Raspbian](https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-Raspbian)

Node-red example:

> **[cflurin/homebridge-mqtt](https://github.com/cflurin/homebridge-mqtt/wiki/homebridge2NodeRED)**
>
> Homebridge-mqtt is a Plugin for Homebridge. Contribute to cflurin/homebridge-mqtt development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![sapster77](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sapster77/32/14335_2.png) [@sapster77](https://discourse.nodered.org/u/sapster77)\
**Post date:** [6 November 2019 15:53 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/6 "2019-11-06T15:53:45Z")

</div>

Sweet! I will give it a go:-) Thanks.

---

<div class="post-metadata">

**Author:** ![sapster77](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sapster77/32/14335_2.png) [@sapster77](https://discourse.nodered.org/u/sapster77)\
**Post date:** [7 November 2019 12:48 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/7 "2019-11-07T12:48:10Z")

</div>

So I am fighting a little with getting homeberidge to start...I have checked my config.json in the validator and in visual studio where it seems fine, but I keep getting the error in the log...

```auto
3:42:02 openhab homebridge[23046]: at Module.load (internal/modules/cjs/loader.js:653:32)
Nov 07 13:42:02 openhab homebridge[23046]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
Nov 07 13:42:02 openhab systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE
Nov 07 13:42:02 openhab systemd[1]: homebridge.service: Failed with result 'exit-code'.
Nov 07 13:42:05 openhab systemd[1]: homebridge.service: Service RestartSec=3s expired, scheduling restart.
Nov 07 13:42:05 openhab systemd[1]: homebridge.service: Scheduled restart job, restart counter is at 29.
Nov 07 13:42:05 openhab systemd[1]: Stopped Homebridge.
Nov 07 13:42:05 openhab systemd[1]: Started Homebridge.
Nov 07 13:42:06 openhab homebridge[23080]: [11/7/2019, 1:42:06 PM] There was a problem reading your config.json file.
Nov 07 13:42:06 openhab homebridge[23080]: [11/7/2019, 1:42:06 PM] Please try pasting your config.json file here to validate it: http://jsonlint.com
Nov 07 13:42:06 openhab homebridge[23080]: [11/7/2019, 1:42:06 PM]
Nov 07 13:42:06 openhab homebridge[23080]: /usr/lib/node_modules/homebridge/lib/server.js:218
Nov 07 13:42:06 openhab homebridge[23080]: throw err;
Nov 07 13:42:06 openhab homebridge[23080]: ^
Nov 07 13:42:06 openhab homebridge[23080]: Error: EACCES: permission denied, open '/var/lib/homebridge/config.json'
Nov 07 13:42:06 openhab homebridge[23080]: at Object.openSync (fs.js:443:3)
Nov 07 13:42:06 openhab homebridge[23080]: at Object.readFileSync (fs.js:343:35)
Nov 07 13:42:06 openhab homebridge[23080]: at Server._loadConfig (/usr/lib/node_modules/homebridge/lib/server.js:212:28)
Nov 07 13:42:06 openhab homebridge[23080]: at new Server (/usr/lib/node_modules/homebridge/lib/server.js:56:38)
Nov 07 13:42:06 openhab homebridge[23080]: at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:32:16)
Nov 07 13:42:06 openhab homebridge[23080]: at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
Nov 07 13:42:06 openhab homebridge[23080]: at Module._compile (internal/modules/cjs/loader.js:778:30)
Nov 07 13:42:06 openhab homebridge[23080]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
Nov 07 13:42:06 openhab homebridge[23080]: at Module.load (internal/modules/cjs/loader.js:653:32)
Nov 07 13:42:06 openhab homebridge[23080]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
Nov 07 13:42:06 openhab systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE
Nov 07 13:42:06 openhab systemd[1]: homebridge.service: Failed with result 'exit-code'.
^C
[13:42:08] openhabian@openhab:/var/lib/homebridge$ ls
accessories config.json persist
[13:42:18] openhabian@openhab:/var/lib/homebridge$

```

My config.json looks like this.

```auto
{
    "bridge": {
      "name": "Homebridge",
      "username": "CC:22:3D:E3:CE:30",
      "port": 51827,
      "pin": "031-45-954"
    },

    "mqtt": {
        "platform": "mqtt",
        "name": "mqtt",
        "url": "mqtt://127.0.0.1",
        "username": "xxxx",
        "password": "xxxx"
      }
      
}   

```

Any ideas? I am out of things to try...🙂

---

<div class="post-metadata">

**Author:** ![sapster77](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sapster77/32/14335_2.png) [@sapster77](https://discourse.nodered.org/u/sapster77)\
**Post date:** [7 November 2019 13:01 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/8 "2019-11-07T13:01:24Z")

</div>

Well....a reboot did it:-)

```auto
Nov 07 13:51:45 openhab homebridge[26925]: [11/7/2019, 1:51:45 PM] Loaded config.json with 0 accessories and 0 platforms.
Nov 07 13:51:45 openhab homebridge[26925]: [11/7/2019, 1:51:45 PM] ---
Nov 07 13:51:46 openhab homebridge[26925]: [11/7/2019, 1:51:46 PM] Loaded plugin: homebridge-mqtt
Nov 07 13:51:46 openhab homebridge[26925]: homebridge API version: 2.4
Nov 07 13:51:46 openhab homebridge[26925]: [11/7/2019, 1:51:46 PM] Registering platform 'homebridge-mqtt.mqtt'
Nov 07 13:51:46 openhab homebridge[26925]: [11/7/2019, 1:51:46 PM] ---
Nov 07 13:51:46 openhab homebridge[26925]: Load homebridge-mqtt.mqtt
Nov 07 13:51:46 openhab homebridge[26925]: [11/7/2019, 1:51:46 PM] [homebridge-mqtt.mqtt] config undefined in '/var/lib/homebridge', irrelevant by multiple homebridge instances.
Nov 07 13:51:46 openhab homebridge[26925]: Setup Payload:
Nov 07 13:51:46 openhab homebridge[26925]: X-HM://0023ISZJ6LEMD
Nov 07 13:51:46 openhab homebridge[26925]: Scan this code with your HomeKit app on your iOS device to pair with Homebridge:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]: Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]: ┌────────────┐
Nov 07 13:51:46 openhab homebridge[26925]: │ 031-45-954 │
Nov 07 13:51:46 openhab homebridge[26925]: └────────────┘
Nov 07 13:51:46 openhab homebridge[26925]:
Nov 07 13:51:46 openhab homebridge[26925]: [11/7/2019, 1:51:46 PM] Homebridge is running on port 51827.

```

Seems to run now and I can pair with it in homekit.  
I got mosquitto MQTT running on localhost, but it still seems to complain about this:

```auto
 [homebridge-mqtt.mqtt] config undefined in '/var/lib/homebridge', irrelevant by multiple homebridge instances.

```

Don't know if it matters...but I got the example running in node-red looking like this:

 ![54](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/2441a6d965689d63e71a696cd3961a29004dd106.png)  
and I can inject commands to the MQTT topics. Is it correctly understood that my "add office lamp" node with this payload

```auto
{"name":"office_lamp","service":"Switch"}

```

Should then be adequate to have that lamp appear in homekit? I am asking because it doesn't:-) Or must it also be defined in the config.json somehow?  
Sorry for possible misunderstandings - I am trying to wrap my head around this:-)

Cheers,

---

<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:** [7 November 2019 13:17 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/9 "2019-11-07T13:17:48Z")

</div>

> [@sapster77](#):
>
> [homebridge-mqtt.mqtt] config undefined in '/var/lib/homebridge'

where did you store `config.json`?

---

<div class="post-metadata">

**Author:** ![sapster77](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sapster77/32/14335_2.png) [@sapster77](https://discourse.nodered.org/u/sapster77)\
**Post date:** [7 November 2019 13:57 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/10 "2019-11-07T13:57:34Z")

</div>

in /var/lib/homebridge/config.json

initially I was using /.homebridge , but in the raspberry pi install instructions it stated to use var/lib/homebridge...

---

<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:** [7 November 2019 14:01 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/11 "2019-11-07T14:01:43Z")

</div>

I see, I'd use `.homebridge` (this is also the folder I use)  
It seems that `var/lib/homebridge` is only used for the Systemd Service.

Edit:

`*NOTE: Your config.json file MUST be inside of .homebridge, which is inside of your home folder. On macOS and Linux, the full path for your config.json would be ~/.homebridge/config.json. Any error messages will contain the exact path where your config is expected to be found.*`

---

<div class="post-metadata">

**Author:** ![sapster77](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sapster77/32/14335_2.png) [@sapster77](https://discourse.nodered.org/u/sapster77)\
**Post date:** [7 November 2019 14:24 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/12 "2019-11-07T14:24:48Z")

</div>

Ok - just tried that.  
It does however seems to be looking in /var/lib/homebridge for the file.

```auto
Nov 07 15:21:56 openhab homebridge[28662]: [11/7/2019, 3:21:56 PM] config.json (/var/lib/homebridge/config.json) not found.
Nov 07 15:21:57 openhab homebridge[28662]: [11/7/2019, 3:21:57 PM] Loaded plugin: homebridge-mqtt
Nov 07 15:21:57 openhab homebridge[28662]: homebridge API version: 2.4
Nov 07 15:21:57 openhab homebridge[28662]: [11/7/2019, 3:21:57 PM] Registering platform 'homebridge-mqtt.mqtt'
Nov 07 15:21:57 openhab homebridge[28662]: [11/7/2019, 3:21:57 PM] ---
Nov 07 15:21:57 openhab homebridge[28662]: Load homebridge-mqtt.mqtt
Nov 07 15:21:57 openhab homebridge[28662]: [11/7/2019, 3:21:57 PM] [homebridge-mqtt.mqtt] config undefined in '/var/lib/homebridge', irrelevant by multiple homebridge instances.
Nov 07 15:21:57 openhab homebridge[28662]: Setup Payload:
Nov 07 15:21:57 openhab homebridge[28662]: X-HM://0023ISYWYLEMD
Nov 07 15:21:57 openhab homebridge[28662]: Scan this code with your HomeKit app on your iOS device to pair with Homebridge:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]: Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]: ┌────────────┐
Nov 07 15:21:57 openhab homebridge[28662]: │ 031-45-154 │
Nov 07 15:21:57 openhab homebridge[28662]: └────────────┘
Nov 07 15:21:57 openhab homebridge[28662]:
Nov 07 15:21:57 openhab homebridge[28662]: [11/7/2019, 3:21:57 PM] Homebridge is running on port 43735.
^C

```

---

<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:** [7 November 2019 14:28 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/13 "2019-11-07T14:28:36Z")

</div>

Sorry, this is also new for me, I installed homebridge 3 years ago!

Try to delete /var/lib/homebridge and restart

Edit: check the path:

`/home/pi/.homebride/config.json`

on my pi:

```auto
pi@rpi5:~ $ find .homebridge/config.json
.homebridge/config.json
```

---

<div class="post-metadata">

**Author:** ![sapster77](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sapster77/32/14335_2.png) [@sapster77](https://discourse.nodered.org/u/sapster77)\
**Post date:** [7 November 2019 15:35 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/14 "2019-11-07T15:35:49Z")

</div>

There we go:-) This look better!

Can you confirm that the rest of the configuration is done within node-red and not in the config.json?  
I already tried adding a lamp (as per your example) and it shows in the log, but not within the homekit app...?

```auto
[11/7/2019, 4:33:02 PM] [mqtt] setValue false, name 'office_lamp' undefined.
[11/7/2019, 4:33:23 PM] [mqtt] addAccessory true, accessory 'office_lamp', service_name 'office_lamp' is added.

```

```auto
16:28:44] openhabian@openhab:~/.homebridge$ homebridge
[11/7/2019, 4:30:00 PM] Loaded config.json with 0 accessories and 1 platforms.
[11/7/2019, 4:30:00 PM] ---
[11/7/2019, 4:30:01 PM] Loaded plugin: homebridge-mqtt
homebridge API version: 2.4
[11/7/2019, 4:30:01 PM] Registering platform 'homebridge-mqtt.mqtt'
[11/7/2019, 4:30:01 PM] ---
[11/7/2019, 4:30:01 PM] Loading 1 platforms...
[11/7/2019, 4:30:01 PM] [mqtt] Initializing mqtt platform...
[11/7/2019, 4:30:01 PM] [mqtt] homebridge-mqtt v0.5.2
Setup Payload:
X-HM://0023ISZJ60716
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:

Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐
    │ 031-45-954 │
    └────────────┘

[11/7/2019, 4:30:01 PM] [mqtt] Number of cached Accessories: 0
[11/7/2019, 4:30:01 PM] [mqtt] clientId = homebridge-mqtt_c18e6816
[11/7/2019, 4:30:01 PM] [mqtt] Connecting..
[11/7/2019, 4:30:01 PM] Homebridge is running on port 51827.
[11/7/2019, 4:30:01 PM] [mqtt] connected (url = http://127.0.0.1)

```

---

<div class="post-metadata">

**Author:** ![sapster77](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sapster77/32/14335_2.png) [@sapster77](https://discourse.nodered.org/u/sapster77)\
**Post date:** [7 November 2019 15:39 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/15 "2019-11-07T15:39:08Z")

</div>

You're the man. Thanks! restart of homekit got it going - lamp is showing up now:-)  
this is cool! Now I got something to work with:-)

---

<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:** [7 November 2019 15:41 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/16 "2019-11-07T15:41:15Z")

</div>

> [@sapster77](#):
>
> I already tried adding a lamp (as per your example) and it shows in the log, but not within the homekit app...?

Did you pair ( Add Accessory) `homebridge` in the home app?  
You'll need your pin `031-45-954`

---

<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:** [7 November 2019 15:44 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/17 "2019-11-07T15:44:36Z")

</div>

> [@sapster77](#):
>
> Can you confirm that the rest of the configuration is done within node-red and not in the config.json?

Correct, just add the accessories you need within node-red.

---

<div class="post-metadata">

**Author:** ![bohtho](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bohtho/32/6153_2.png) [@bohtho](https://discourse.nodered.org/u/bohtho)\
**Post date:** [14 November 2019 22:06 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/18 "2019-11-14T22:06:48Z")

</div>

> [@cflurin](#):
>
> Adding the accessories can be easily done using node-red. I defined an object with all my accessories and used a function-node to add all them with one click.

I have been using Homebridge-MQTT for years but I am wondering about this. As I understand it you can’t create a mega message to add all devices directly? What is the gist of your function node?

---

<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 November 2019 06:39 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/19 "2019-11-15T06:39:57Z")

</div>

I have a tab with a setup like:

 ![19](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c734342a6b52b764ba5dc1e121029ed5b7414c91.jpeg)

In the first function node, setup all devices:

```auto
m = msg.payload
if(m){
t = "homebridge/to/add"
}else{
t = "homebridge/to/remove"
    
}
 node.send({topic:t,payload:{"name":"netatmo_temperature","service_name":"netatmo_temperature","service":"TemperatureSensor"}})
 node.send({topic:t,payload:{"name":"netatmo_co2","service_name":"netatmo_co2","service":"CarbonDioxideSensor"}})
 node.send({topic:t,payload:{"name":"netatmo_humidity_indoor","service_name":"netatmo_humidity_indoor","service":"HumiditySensor"}})
 node.send({topic:t,payload:{"name":"netatmo_humidity_outdoor","service_name":"netatmo_humidity_outdoor","service":"HumiditySensor"}})
....etc

```

---

<div class="post-metadata">

**Author:** ![sapster77](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sapster77/32/14335_2.png) [@sapster77](https://discourse.nodered.org/u/sapster77)\
**Post date:** [23 November 2019 08:51 UTC](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594/20 "2019-11-23T08:51:21Z")

</div>

So much good info here:-)  
I have got homebridge/MQTT running flawlessly now with 40-50 items for a few weeks with great stability.  
Got one thing I can't figure out - maybe you guys have an idea...

I have a few "real" Apple HomeKit items as well that I would like use in the flows. Is that in some way possible?  
Specifically I have a door sensor and a temp sensor, whose data I would like to get into homebridge and then send out via homebridge/from/# topic . In my case it is sent to OpenHab, but I guess that's irrelevant.

Any ideas?  
Thanks:-)

[Next page](https://discourse.nodered.org/t/homekit-bridged-mdns-issue/17594.md?page=2)
