New Homebridge Plug-in via MakerAPI

First off, thanks for this plugin, Dan! I have everything working, but have one question please:

In Hubitat, all my Kitchen devices have unique names, such as Kitchen: Table, Kitchen: Sink, Kitchen: Peninsula, etc.

In Maker API, your app sees all the right names (ie, Kitchen: Table).

However, when Homekit discovers my Hubitat devices, it brings them in but without any names. Everything has generic names, such as Switch, Lock Mechanism, Lightbulb. So in Homekit, Kitchen:Table shows up as Switch.

Before I add all my Hubitat devices and go through the process of identifying and renaming them, is something off with my install?

Thanks.

wild guess...

is it the : in the names? Can you change one to test?

Hmmm, I just tried it with the : in the name and it still pulls in the name the right way.... So I am not able to reproduce this... One question though, did you rename the device in Hubitat after you added them to Homebridge?

@csteele - Thanks. I will try a few names without the ":" when I get home from work.

@dan.t - No I did not rename the device after adding to Homebridge.

@dan.t - I have started from scratch a few times to see if I get the names. Unfortunately, no success. Here are my steps that I follow (off top of head). Maybe I am missing something or doing something wrong?

  • Add device to Hubitat. Upon inclusion, name my device in Hubitat (ie, Kitchen: Table).
  • Add Maker API as an app to Hubitat. Select the devices I want to share with Homekit (ie, Kitchen: Table).
  • Install Homebridge (I tried as an unraid docker, and now as native install on an ubuntu VM).
  • Add Maker API plugin to Homebridge.
  • Add the URL/Token to the config.json in Homebridge. I even used your github utility (very nice!) to create the json.
  • Restart Homebridge.
  • Go to homekit on iPhone.
  • Delete any hub that's there.
  • Add a new accessory by scanning the QR code.
  • The add wizard pops up. It allows me to add my device, but it just says "Switch".
  • I cry. Haha.

I'm willing to reset whatever you need me to do. I just got into Hubitat (from Vera) so I don't have a lot of workflows/rules yet.

Thanks!

Omg. I think I may have an answer. I am at work so I cannot test yet, but.... please see attached.

All along, I have been changing the "Device Label" field in Hubitat. I have been leaving the "Device Name" field as is. I am guessing this is the issue.

Please don't laugh too hard! I will confirm when I get home.

Yup, that is it. The plugin uses the Device Name and not the Device Label. That was going to be my next question. I can say that apart from that all of your steps are correct!

1 Like

Perfect! Thank you!

Wanted to close the loop. My issues have been resolved. However, it took more than just renaming the devices. To aid those that may run into similar issue...

I had to clear out the homebridge cache:

  • I stopped the homebridge service on my Debian VM (systemctl stop homebridge).
  • I deleted the persists and accessories directories in /var/lib/homebridge.
  • Restarted the homebridge service (systemctl start homebridge).

Thanks, guys, for the help.

@dan.t - one more question going forward... what's the best way of renaming devices without wiping out shortcuts/groups/etc? Do name changes in Hubitat auto flow to Homekit?

Thanks for the feedback. Right now the plugin doesn't update the names. Let me take a look to see if there is way to make it more dynamic

1 Like

Ok, I took a look and you are not going to be happy.....

Name, Model, Manufacturer and SerialNumber must be persistent during the lifetime of the accessory. This is by Apple's specification. Especially the name can't be changed as you can go into the Home App and rename every device in there. Homekit will retain the name forever....

So, the only real option here is either what you did, resetting the cache, or, if we are talking about one or two devices only, I would do the following:

  1. Remove the device from the MakerAPI selection
  2. Wait until it is removed in HomeKit (the plugin does that every 300 seconds by default)
  3. Change the name of the device
  4. Add it back in the MakerAPI selection

The device will be added with the new name at that point in time. However, you would have to redo your automations if that one device was involved in any automations.

Sorry, but there is currently no way for me to make any more flexible.

Thanks for checking, @dan.t.

My friend (who just moved to Hubitat as well) was telling me that Hue and Homekit are able to handle name changes. When he has a name mismatch, he is prompted to pick which name "wins". He was mentioning over a drink so let me see if I can get details/confirm. I understand native Hue to Homekit (no Homebridge middleman) may be different but you never know. :slight_smile:

any luck on this one? Thanks!

I have been running this setup for about 3 weeks. I have noticed that since I've updated to the most recent iOS, my devices are not reporting the correct status. I can control every thing just fine. However, if I close the Home app down and reopen, the devices are not reporting the correct state.

After looking at this a bit more, I noticed that the first three octets for these addresses: "Setting MakerAPI post URL to http://x.x.x.x:20010/event at http://X.x.x.x/apps/api/1/" were different. I found that another network adapter was enabled causing this issue with eventing. After disabling the second network adapter, the issues seems to be resolved.

Hi @dan.t,

I was looking at my config and wanted to compare it to the output your site generated. I think your site does not properly format the app_url portion. The Github readme has quotes around the URL string, your site does not resulting in invalid JSON. I think the site will help people create new config files for sure! Great work.

1 Like

@dan.t worked like a charm. As @Curtis.Wyffels mentioned, I did have to add "" around the app_url. Other than that and updating my username and pin, I had it up and running in no time. Much better than the piecemeal config I had before. The dimmers seem like the respond smoother also.

I noticed that my HSM and Mode Status (with the latest Homebridge/Device) does not update on the Home App.

For instance, if I turn on the "Mode - Home" switch. Hubitat will switch over to Home mode but it will not turn on the switch. However, if I quit homebridge and start it again the status will update. Any tips on how to resolve this?

{
  "bridge": {
    "name": "Homebridge",
    "username": "CC:22:3D:E3:XX:XX",
    "port": 51826,
    "pin": "031-45-XXX"
  },
  "description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",
  "platforms": [{
    "platform": "Hubitat-MakerAPI",
    "name": "Hubitat",
    "app_url": "http://10.0.3.4/apps/api/18",
    "access_token": "XXXXXXX",
    "excluded_capabilities": {
      "HUBITAT-DEVICE-ID-9": ["Switch"]
    },
    "excluded_attributes": {
      "HUBITAT-DEVICE-ID-9": ["switch"]
    },
    "temperature_unit": "F",
    "mode_switches": true,
    "hsm": true,
    "debug": false
  }]
}

Sorry for the delay, just release a new version 0.4.8 that fixes that issue

Thank you for the feedback!!!! I just fixed that and it is now properly escaped

I have a feeling that you might have several IP addresses on your homebridge server and that the plugin registers the wrong one with MakerAPI. I just made an improvement in the latest version release (0.4.8) that tries to match the Hubitat IP into a subnet covered by your local IP addresses. Please update your plugin once by running the command

npm -g install homebridge-hubitat-makerapi

and restart homebridge. Let me know if that solves your issues

Also, there is a mistake in your config.json. Are you trying to filter out the switch attribute for device ID 9 or is that just a copy and paste? If you are actually trying to filter it out, than change "HUBITAT-DEVICE-ID-9" to just "9" without the HUBITAT-DEVICE-ID- in front of it

1 Like

Thanks for the feedback and glad you got it running. I just release a new version trying to address these types of issues with a better detection of local IP addresses and which one to use.

1 Like

Thanks for the assistance @dan.t

So I updated the homebridge plugin on my Raspberry Pi and restarted Homebridge but the same issue persists.

I also fixed the filter issue in my config.json and specified the local IP of my Raspberry Pi for Local IP

{
  "bridge": {
    "name": "Homebridge",
    "username": "CC:22:3D:E3:CF:XX",
    "port": 51826,
    "pin": "031-45-XXX"
  },
  "description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",
  "platforms": [{
    "platform": "Hubitat-MakerAPI",
    "name": "Hubitat",
    "app_url": "http://10.0.3.4/apps/api/18",
    "access_token": "XXXX",
    "local_ip": "10.0.3.5",
    "excluded_capabilities": {
      "9": ["Switch"]
    },
    "excluded_attributes": {
      "9": ["switch"]
    },
    "temperature_unit": "F",
    "mode_switches": true,
    "hsm": true,
    "debug": false
  }]
}