New Homebridge Plug-in via MakerAPI

What is that local website? Pretty cool! I want to be able to do that too...mind sharing your setup?

Yes Raspbian running on a PI 3+ And starting the web interface with systemd.

I had to setup multiple instances of the Maker API on my Hubitat to accommodate the number of devices I'm making available to my Home app. See post 279 above by swiss6th.

@dan.t
Just noticed these errors in my logs. Any idea what's going on?

Homebridge log files are accessible by clicking on the first icon in the upper right of the UI.

08%20PM

1 Like

Try updating node.js:

$ sudo apt install nodejs

or to update everything:

$ sudo apt update

I'll give it a shot...thanks for the tip.

@tsviper,

There is a new flag for the config to enable debug logging, see post 353. That could tell us a bit more about why it is failing.

Thanks Dan...I'll give it a try and see what I can find out.

So here is what it puts out...any ideas?

Started Node.js HomeKit Server.
[7/12/2019, 6:23:58 PM] Loaded config.json with 0 accessories and 2 platforms.
[7/12/2019, 6:23:58 PM] ---
[7/12/2019, 6:23:58 PM] Loaded plugin: homebridge-config-ui-x
[7/12/2019, 6:23:58 PM] Registering platform 'homebridge-config-ui-x.config'
[7/12/2019, 6:23:58 PM] ---
[7/12/2019, 6:24:00 PM] Loaded plugin: homebridge-harmony
[7/12/2019, 6:24:00 PM] Registering platform 'homebridge-harmonyHub.HarmonyHubWebSocket'
[7/12/2019, 6:24:00 PM] ---
[7/12/2019, 6:24:00 PM] Loaded plugin: homebridge-hubitat-makerapi
Homebridge Version: 2.4
Plugin Version: 0.2.14
[7/12/2019, 6:24:00 PM] Registering platform 'homebridge-hubitat-makerapi.Hubitat-MakerAPI'
[7/12/2019, 6:24:00 PM] ---
[7/12/2019, 6:24:00 PM] Loading 2 platforms...
[7/12/2019, 6:24:00 PM] [HubitatC5] Initializing Hubitat-MakerAPI platform...
[7/12/2019, 6:24:00 PM] [HubitatC5 hhm:0.2.14] Setting "local_ip" not set in config, tried to determine it and found 0.0.0.0 -> I hope this is correct
[7/12/2019, 6:24:00 PM] [Config] Initializing config platform...
[7/12/2019, 6:24:00 PM] [Config] Spawning homebridge-config-ui-x with PID 666
[7/12/2019, 6:24:00 PM] Loading 0 accessories...
Load homebridge-harmonyHub.HarmonyHubWebSocket
[7/12/2019, 6:24:00 PM] [homebridge-harmonyHub.HarmonyHubWebSocket] HarmonyPlatform Init
[7/12/2019, 6:24:00 PM] [homebridge-harmonyHub.HarmonyHubWebSocket] No configuration found for homebridge-harmonyHub
Setup Payload:
X-HM://00247EEB6IFM1
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:
                       
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ 444-55-666 β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       
[7/12/2019, 6:24:00 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:00 PM] Homebridge is running on port 51827.
error at req:  connect ENETUNREACH 10.0.0.47:80 - Local (0.0.0.0:0)
error at req:  connect ENETUNREACH 10.0.0.47:80 - Local (0.0.0.0:0)
error at req:  connect ENETUNREACH 10.0.0.47:80 - Local (0.0.0.0:0)
error at req:  connect ENETUNREACH 10.0.0.47:80 - Local (0.0.0.0:0)
error at req:  connect ENETUNREACH 10.0.0.47:80 - Local (0.0.0.0:0)
(node:287) UnhandledPromiseRejectionWarning: ReferenceError: resp is not defined
    at /usr/lib/node_modules/homebridge-hubitat-makerapi/lib/util_http.js:109:97
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
(node:287) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:287) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:287) UnhandledPromiseRejectionWarning: ReferenceError: resp is not defined
    at /usr/lib/node_modules/homebridge-hubitat-makerapi/lib/util_http.js:109:97
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
(node:287) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:287) UnhandledPromiseRejectionWarning: ReferenceError: resp is not defined
    at /usr/lib/node_modules/homebridge-hubitat-makerapi/lib/util_http.js:109:97
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
(node:287) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:287) UnhandledPromiseRejectionWarning: ReferenceError: resp is not defined
    at /usr/lib/node_modules/homebridge-hubitat-makerapi/lib/util_http.js:109:97
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
(node:287) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
(node:287) UnhandledPromiseRejectionWarning: ReferenceError: resp is not defined
    at /usr/lib/node_modules/homebridge-hubitat-makerapi/lib/util_http.js:109:97
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
(node:287) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 5)
(node:287) UnhandledPromiseRejectionWarning: ReferenceError: resp is not defined
    at /usr/lib/node_modules/homebridge-hubitat-makerapi/lib/util_http.js:109:97
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
(node:287) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)
error at req:  getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443
[7/12/2019, 6:24:00 PM] [HubitatC5 hhm:0.2.14] { Error: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
  errno: 'EAI_AGAIN',
  code: 'EAI_AGAIN',
  syscall: 'getaddrinfo',
  hostname: 'registry.npmjs.org',
  host: 'registry.npmjs.org',
  port: 443 }
[7/12/2019, 6:24:01 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:02 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:03 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:04 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:13 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:14 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:15 PM] [Config] Console v4.5.1 is listening on :: port 8080
[7/12/2019, 6:24:15 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:16 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:17 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:18 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:19 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:20 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:21 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:22 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:23 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:24 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:25 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:26 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:27 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:28 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:29 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:30 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:31 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:32 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:33 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
      pi : TTY=pts/1 ; PWD=/home/pi/homebridge ; USER=root ; COMMAND=/bin/journalctl -o cat -n 500 -f -u homebridge
pam_unix(sudo:session): session opened for user root by (uid=0)
[7/12/2019, 6:24:34 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:35 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:36 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:37 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:38 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:39 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:40 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:41 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:42 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:43 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:44 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:45 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6
[7/12/2019, 6:24:46 PM] [HubitatC5 hhm:0.2.14] Configuration of cached accessories not done, wait for a bit... 6

Okay if I restart homebridge after booting up the errors go away. I'm starting to think it has something to do with my pi setup and not homebridge or the plugin. Looks like it can't get my local IP on boot up but then a restart of the plugin grabs it. I may just have to rebuild my pi from scratch...thanks again for all the help.

Just buy a new PI 4 :wink: gives you a good reason :smile:

So true! :rofl:

Hi,

I have been a user migrated from Iris for 6 months, I am very happy with Hubitat and extremely grateful for the community code sharing.

I found from Smartthings that "bigeazy000" said that someone wrote a plugin for homebridge to control Eco Plugs wifi outlet with ST. The plugin info is here:

He confirmed that it worked for him. I am not sure how much work is needed to port it to Hubitat, hopefully it won't take too much work and someone would be kind enough to help???

There's no need to 'port to Hubitat'

It's a Homebridge plugin, which means it's runs on the nodeJS that also runs the Hubitat plugin.

There are at least 1,600 Homebridge plugins. I'd suggest multiple homebridge instances so that the crash of one doesn't crash all of your plugins.

A Homebridge plugin extends the functionality of Apple's HomeKit. A Ecoplug plugin extends Apple's HomeKit to see and control Eco Plugs.

Install the plugin, and your Eco Plugs show up in Apple's Home app.

Same with Hubitat... add the Hubitat plugin to Homebridge and Hubitat devices show up in Apple's Home app.

I have minimal knowledge of programming, only copy the codes of device and app to make them work in HE. I thought with "Homebridge (Habitat)" installed in HE, the installation of Eco Plugs homebridge plugin will make Eco Plugs controllable in HE. You seemed suggested that it's the other way around.
The instruction of "Install this plugin using: sudo npm install -g homebridge-ecoplug" is foreign to me. How do I use "sudo npm install -g homebridge-ecoplug" in windows 10? I kind of know that it's similar to DOS command, can I do this in "Windows PowerShell"? How do get it install (cd) to HE? I have searched the internet, still not clear to me. Sorry for these basic questions. I greatly appreciate your response and help.

You can use a windows 10 pc that’s always on, but you must run those commands from a command prompt (run as an administrator). Do not try to use powershell, it will fail. Also, if you close the command prompt, you shut down homebridge.

Are you saying that it needs a dedicated PC having the command prompt open to make it work? It would not be able to rely on Hubitat hub to do it? Thank you.

Homebridge is a node.js application. It needs a dedicated processor to run on. You can do this on a Raspberry Pi, a mac, in a docker container, on a pc, or on a Linux computer.

The Raspberry Pi is the most cost effective in the long run because the energy usage is low. There are lots of guides out there for that part of it. Start here...

After you get the Homebridge server setup, come back to this thread at the beginning and you can tackle the Hubitat portion.

1 Like

Will get a Raspberry Pi, thank you for the advice.

1 Like

You'll like it. The Maker API version of this that @dan.t created is so fast and stable. I'm able to trust HomeKit devices in automations again. I recently bought a Xiaomi Aqara Hub HomeKit edition, and I'm able to mix it into automations, and even pair Xioami devices to the Aqara Hub, but use them in HE like they were directly paired, And it feels that way too, since it's reaction time is instant.