New Homebridge Plug-in via MakerAPI

I have created the file with your page, however I am not sure where to then add it into HOOBS, if I try to add it to the config tab it says it can’t do that. I am assuming my format is somehow incorrect.

hoobs should create it's own config file. You will only need to update the section for the HE platform.

I’m not sure what you mean

Within Hoobs, you should be able to simply PASTE the configuration JSON data from @dan.t's https://dantapps.github.io/ site, once you fill in the required data on his site.

1 Like

I do not see any menu like that anywhere in my HOOBS portal. Config only shows Homebridge config editor, there is no side menu like that. Nor is there anything like that under Plugins

Under Config there is just for Homebridge and nothing for the API. I have tried adding it to the main editor page and it will not accept it.

Maybe share some screenshots? It’s very hard to help troubleshoot without any info.

What version of HOOBS are you running?

@dan.t

I decided to upgrade to latest versions of all apps/drivers and RPi apps. After updating I am seeing this new error. Thoughts on what needs to be done?

What version of node.js are you on? I am going to try to replicate it. However, if you are on the latest hubitat release, I doubt that you will have an issue as it doesn't use websockets anymore. And npm is complaining about the websocket packages

Everything is working just was curious about the errors.

I'm about to pull my remaining hair out over getting this configured correctly. I was able to successfully get one Z-Wave switch installed and configured via MakerAPI and added it to Homebridge. Works great. My question is, how do I add a second switch? Do I add all of the switches to the same MakerAPI under "Select Devices," or do I create a separate MakerAPI app entry for each one? And then how do I configure my config.json for the multiple switches?

Here's what I have so far in the relevant section of my config.json:
{
"platform": "Hubitat-MakerAPI",
"name": "Hubitat",
"app_url": "http://10.0.1.173/apps/api/3/",
"local_ip": "10.0.1.3",
"access_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"local_port": 20010,
"polling_seconds": 300
}

Do I add another block just like this one for the other switch, or can I combine multiple switches into one block? And how do I do that?

Yes, that. :slight_smile:

Make no changes to your config.json. What you posted worked for ALL the devices you selected (just one) so leave it that way. :slight_smile:

The combination of creating a MakerAPI instance and connecting that to Homebridge is like building a highway. (A reuse of a previous metaphor :slight_smile: ) Now you have ONE car able to use your fine highway. Lift the barrier and let the rest of the cars onto the highway. :slight_smile: (selecting devices within the single instance of MakerAPI.)

1 Like

Okay, but when I do that and launch Homebridge, I get:

uncaughtException: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: xxxxxxx-xxxx-xxxx-xxxx-99754b1fb662
[3/6/2020, 11:12:52 PM] Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: xxxxxxx-xxxx-xxxx-xxxx-99754b1fb662
at Bridge.Accessory.addBridgedAccessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:268:13)
at Server._configCachedPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:396:18)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:93:8)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
uncaughtException: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: xxxxxxx-xxxx-xxxx-xxxx-99754b1fb662
[3/6/2020, 11:12:52 PM] Got SIGTERM, shutting down Homebridge...

You have two Platform definitions?

You're using this config builder tool?
https://dantapps.github.io/

It builds a perfectly good config.json for you... if you fill in the blanks accurately :slight_smile:

The config.json is designed to be confusing, it has "platformS" (plural) and "platform" (singular) that must have burned hundreds by now.

You want ONE of each. "platform" (singular) inside a "platforms":[ ]

That seems to be what you pasted, but since you didn't include the plural part, I'm giving guidance that you may not want/need. :slight_smile:

Guess I didn't include enough of my config.json:

"platforms": [
{
"name": "Hue",
"users": {
"1234567890": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"1234567890": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
},
"lights": true,
"nupnp": true,
"resource": true,
"platform": "Hue"
},
{
"name": "Config",
"port": 8581,
"auth": "form",
"theme": "blue",
"tempUnits": "f",
"log": {
"method": "file",
"path": "/Users/rockycarr1/.homebridge/logfile.log"
},
"platform": "config"
},
{
"platform": "Hubitat-MakerAPI",
"name": "Hubitat",
"app_url": "http://10.0.1.173/apps/api/3/",
"local_ip": "10.0.1.3",
"access_token": "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"local_port": 20010,
"polling_seconds": 300
}

I tried removing the section for Hue and the section for Config-ui-x, and still get the same error.

EDIT: I cleared the cachedAccessories and the error vanished...but now the lights don't work! Okay, back to square one.

Homebridge thinks it 'owns' the Accessory. Yet you're trying to add a second Accessory, using the same UUID.

You've probably started and stopped and deployed variations of the config that have ruined the 'highway'. :slight_smile:

Think about this before doing... I'm about to suggest you remove your existing Homebridge/HomeKit connector. You will lose any Room definitions in Apple's Home app. With only ONE switch, it sounds like it's worth it.

In your .homebridge directory, try deleting "persist" and "accessories":
rm ~.homebridge/persist/*
rm ~.homebridge/accessories/*

The next time Homebridge starts, it will recreate those. Depending on you Linux skills you may choose an alternate plan.

Next, replace your config.json with this:

{
    "bridge": {
        "name": "Homebridge",
        "username": "E9:7A:AA:FA:DC:08",
        "port": 51936,
        "pin": "836-76-741"
    },
    "mdns": {
        "interface": "10.0.1.3"
    },
    "platforms": [
        {
            "platform": "Hubitat-MakerAPI",
            "name": "Hubitat MakerAPI",
            "app_url": "http://10.0.1.173/apps/api/3",
            "access_token": "access_token",
            "local_ip": "10.0.1.3",
            "local_port": 20010,
            "mode_switches": false,
            "hsm": false,
            "debug": false,
        }
    ]
}

REPLACE access_token with yours. This file uses a completely new Username and Pin in the Bridge section. THAT will overcome the duplicate UUID.

VERIFY that your MakerAPI is still using that same URL especially the /3 at the end.

2 Likes

I'll give this a try tomorrow. It's late where I am. Thanks for all of your help.

1 Like

Everything is working now, thanks to @csteele!

Okay, maybe I spoke too soon! Everything works when I run Homebridge manually, but when I run Homebridge as a service on my Mac (sudo hb-service start), It throws up permissions errors in the logs and none of my Homebridge stuff will work. "Error: EACCES: permission denied, open '/Users/rockycarr1/.homebridge/homebridge-hubitat.log'"

Here's the contents of the log:
[3/8/2020, 11:19:21 AM] [Hubitat MakerAPI hhm:0.4.11] Configuration of cached accessories not done, wait for a bit... 2
[3/8/2020, 11:19:21 AM] [Hubitat MakerAPI hhm:0.4.11] Setting "local_ip" not set in config, tried to determine it and found 10.0.1.20 -> I hope this is correct
[3/8/2020, 11:19:21 AM] [Hubitat MakerAPI hhm:0.4.11] latest version on npmjs is 0.4.11
[3/8/2020, 11:19:21 AM] [Hubitat MakerAPI hhm:0.4.11] your version of the plugin is up2date
[3/8/2020, 11:19:21 AM] [Hubitat MakerAPI hhm:0.4.11] Device Added (Cache) - Name Backyard Lights , ID 2
[3/8/2020, 11:19:21 AM] [Hubitat MakerAPI hhm:0.4.11] Device Added (Cache) - Name Breakfast Nook Dimmer, ID 33
[3/8/2020, 11:19:22 AM] [Hubitat MakerAPI hhm:0.4.11] Fetching Hubitat-MakerAPI devices. This can take a while depending on the number of devices configured!
[3/8/2020, 11:19:22 AM] [Hubitat MakerAPI hhm:0.4.11] Refreshing All Device Data
[3/8/2020, 11:19:22 AM] [Hubitat MakerAPI hhm:0.4.11] Received All Device Data
[3/8/2020, 11:19:22 AM] [Hubitat MakerAPI hhm:0.4.11] Starting receiver
[3/8/2020, 11:19:22 AM] [Hubitat MakerAPI hhm:0.4.11] Set communcation_broken to false
[3/8/2020, 11:19:22 AM] [Hubitat MakerAPI hhm:0.4.11] Setting MakerAPI post URL to http://10.0.1.20:20010/event at http://10.0.1.173/apps/api/3/
[3/8/2020, 11:19:22 AM] [Hubitat MakerAPI hhm:0.4.11] homebridge-hubitat-makerapi server listening on 20010
[3/8/2020, 11:19:22 AM] [Hubitat MakerAPI hhm:0.4.11] MakerAPI postURL successfully activated

I don't see any errors, but none of my Homebridge accessories will respond in the Home app.

I don't know what that is....

I use launchctl and have a .plist for it.

launchctl unload ~/library/launchagents/com.homebridge.server.plist
launchctl load ~/library/launchagents/com.homebridge.server.plist

been working great for years..

Delete that file once and try it again