New Homebridge Plug-in via MakerAPI

npm -g install homebridge-hubitat-makerapi

Or you can use the Homebridge Config UI and it will tell you if there is an update available.

1 Like

Looks like every time my container station on my nas restarts it runs install.sh which checks for updates and runs that command so I should get any updates by just restarting the container. Good deal.

All,

I have just published a new version of the plugin.
Version 0.3.0 has now support for buttons. By default, Buttons are limited to a single push of button number 1. There is an advanced configuration setting “programmable_buttons” that allows you to trigger Homekit scenes from Hubitat. This can be helpful to interact with Homekit only devices. E.g. a button press in HE can trigger a “HomeKit only Lock” to lock or unlock. See the README homebridge-hubitat-makerapi/README.md at master · danTapps/homebridge-hubitat-makerapi · GitHub for detailed instructions.

5 Likes

You are the absolute man! Now I can make the washer/dryer automations in Homekit.

Sidenote, do you know why power outlets show up as switches in Homekit? I've noticed that for awhile and I'm not sure why they don't register as plugs.

Well, I tried out the new button option, can't seem to get it to work using iris buttons or the Samsung button.

My logs show this in HE

2019-10-07 09:32:19.747 pm infoSamsung Button button 1 was pushed

and Homebridge

[10/7/2019, 9:32:19 PM] [Hubitat hhm:0.3.1] Change Event (Socket): (Samsung Button:372) [PUSHED] is 1

I am assuming that you are trying to get the programmable button to work. Did you configure the “programmable_button” setting in your config.json? The README that is linked above gives you an example. You can also PM me your config and I can take a look.

As to the plugs, fairly simple, a power outlet is basically a switch. It supports on/off. The plugin really can’t distinguish between the two.

Dan, do you know whether a dedicated RPI3 would be faster than sharing a Mac Mini Server for running Homebridge? My mac mini gets hit with many requests as its my family's media hub....

Anything dedicated is usually better but I don't think resources are the issue. Homebridge has a very small footprint and doesn't require tons of CPU cycles. All depending on how many plugins you have configured
though.

Based on the logs that I got so far, I can clearly see that the WebSocket connection was successfully established but that there is no data on the socket. The trigger is usually a reboot of the HE hub or a loss of connection between Homebridge and the HE hub. The issue you are having occurs with less than a handful of people so it is not easy to track down. I can't reproduce it no matter what I do... I don't see resource contention as the culprit here as the logs indicated that the functions are executed in a normal speed.

I am going to drop a new version in a bit with a few changes in the hopes that it will magically solve your issue....

Oh I'll take magic anytime it solves anything for me :slight_smile: Thankya!

Sent you my config.

You are really the best, I greatly appreciate all the work you do.

1 Like

Thanks. I found the issue and will release a new version today.

1 Like

All, just published version 0.3.3 with the following changes:

  • Fixed programmable button implementation
  • further automated testing on websocket connection
  • reloading of attribute states via HTTP if websocket connection is "broken"
  • some refactoring
4 Likes

All,

I am not a programmer and I am feeling like a complete idiot. I managed to setup the RPI and I think my problem is the config.json file because everything else seems to be OK. I think I setup the MakerAPI part correctly. However, in the sample config file in the setup instructions, it has this language:

"bridge": {
"name": "Homebridge",
"username": "_________",
"port": 51826,
"pin": "
"

Is this supposed to be inserted before this part (below is taken from the setup instructions - - I modified it in my setup with my unique info):

{
"platform": "Hubitat-MakerAPI",
"name": "Hubitat",
"app_url": "http://192.168.10.169/apps/api/YOUR_APPS_ID/",
"access_token": "THIS-SHOULD-BE-YOUR-TOKEN",
"polling_seconds": 300,
"temperature_unit": "F",
"mode_switches": true,
"hsm": true,
"debug": false,
"programmable_buttons":
[ "97", "98" ],
"excluded_capabilities": {
"HUBITAT-DEVICE-ID-1": [ "Switch", "TemperatureMeasurement" ]
},
"excluded_attributes": {
"HUBITAT-DEVICE-ID-1": [ "power", "humidity" ]
},
"logFile": {
"enabled": true, "path": "", "file": "", "compress": true, "keep": 5, "size": "10m"
}
}

So the name and username in that top part - - stupid question -- but am I supposed to change that?

Thanks!

Yes, it's not entirely clear that you must have both sections... the top part is for "homebridge" (the part that faces apple) and as many of the bottom pieces as you have plugins. One plug-in = one bottom portion. 6 plug-ins = 6 bottom portions.

The username and pin should be made unique, but if you don't mind everyone in the planet having your username&pin, you can leave them :slight_smile:

The username and pin (and port) were taken from the sample file so those are not mine. I can change them to be unique but where do I make the corresponding changes to match? That username looks like a MAC address. Kind of lost. Do I leave the port as-is?

I guess what I am asking is - where do I get the username and pin and port information to insert here?

You invent them :smiley:

It does look like a MAC, but isn't. It's just a number and a format. The number gets used within iOS HomeKit as the unique Appliance, which may explain it's MAC like history.

You enter (or scan) the PIN when you join the Homebridge (Appliance) to iOS HomeKit. So it can be anything but needs to be in that format.

Port should be left as the default value: 51826

This has been incredibly helpful - and thanks for the alert that I published everything to the internet lol. I found my way around. I deleted Homebridge from the iOS app and changed the username and pin. I then re-added it to iOS.

Running homebridge on the RPI starts - and no errors - so I thought I had it. But during the startup comments displayed, after it loads MakerAPI, it says "Plugin not configured in config.json, disabled plugin". But I did configure it - at least I thought so. I re-read the directions 5 times. All of this is there - (properly configured with the data from Hubitat Maker API app):

"platform": "Hubitat-MakerAPI",
"name": "Hubitat",
"app_url": "http://192.168.10.169/apps/api/YOUR_APPS_ID/",
"access_token": "THIS-SHOULD-BE-YOUR-TOKEN",

Any thoughts? Thanks so much for your help by the way.

hang on - I think I see the issue

You need to change the settings for app_url and access_token with the values shown in you MakerAPI app on Hubitat.

You can also PM me you full config content and a screenshot of the examples shown at the bottom in MakerAPI and I should get you up and running in now time