New Homebridge Plug-in via MakerAPI and Eventsocket


#1

I am happy to announce that the first public beta of a modified Homebridge Plug-in is available for installation! This new plugin does not rely on the "Homebridge App" in Hubitat and utilizes the MakerAPI and Eventsocket to communicate with Hubitat.

A few caveats upfront:

  • HSM and Modes are currently not support. I am waiting for a new Hubitat release to implement those
  • You will have to redo all of your room assignments in the Home App on your phone

Installation:

1. Hubitat MakerAPI App Configuration

  • Under the Hubitat Web Interface, Click on Apps in the left side menu.
  • Click on the button +Add Built-In App
  • Select Maker API from the list of apps
  • Enable Allow Access via Local IP Address
  • Tap Done and you are finished with the App configuration.
  • Go into the newly added Maker API app
  • Select the devices you would like to have available via HomeKit.
  • At the bottom you see a few examples of access URLs. You will need two parts of this (App URL and Access Token)
    • example: http://192.168.10.169/apps/api/132/devices/[Device ID]?access_token=148fc06d-7627-40b0-8435-8d0cc31617ab
      • The App URL is http://192.168.10.169/apps/api/132/
      • The Access Token is 148fc06d-7627-40b0-8435-8d0cc31617ab
    • Remember these two values for later
  • Tap Done and you are finished with the App configuration.

2. Homebridge Plugin Installation:

  1. Install homebridge using: npm i -g homebridge (For Homebridge Install: Homebridge Instructions)
  2. Install Hubitat plugin using: npm i -g homebridge-hubitat-makerapi
  3. Update your configuration file. See sample config.json snippet below.

Config.json Settings Example

Example of all settings. Not all settings are required. Read the breakdown below

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

  • platform & name Required
    This information is used by homebridge to identify the plugin and should be the settings above. The platform name has to be "Hubitat-MakerAPI", name can be of you choosing.
  • app_url & access_token Required
    This is the base URL and access token for MakerAPI, check step 1 of the installation instructions on how to obtain the value Notice: The app_url in the example above may be different for you.

Thanks to @tonesto7 for all the work he put in the original plug-in. I merely reworked what he had done.

I have done quite some testing and this plugin is running for me for a few weeks now but I am sure that there are some bugs in there that I didn't find yet. I'd appreciate any feedback you can provide me!


Homebridge Plug-in
#2

I started using your add-on to HubConnect the last few days and have been happy with the results vs. the Homebridge app. I don't, however, have any plans to fire-up my old ST or wink hubs. What would be the pros/cons of using your MakerAPI version vs. the HubConnect version (other than HubConnect allowing connections to other hubs)?


#3

It's really a users choice:

  • The HubConnect implementation is the better choice if you have multiple hubs or want to bridge SmartThings and Hubitat
  • The MakerAPI is for the people that don't live in a multiple hub environment or rather want to stick to "Built-In" apps. HubConnect still requires a community app to be installed and configured.

Again, it is a users choice. I have both running at the same time :slight_smile: and the good news is that I don't see any slowdowns of my Hubitat anymore!


#4

I will implement this today!!

Question 1: did you do a npm remove of the tonesto7 Homebridge plugin?

Question 2: does this delete your cache and device resulting in setting up your iPhone pairing again?


#5

Answer: No, I did not. They "could" live side-by-side for no apparent reason. It will load the new plugin once you change your config.json to the new platform name

Answer: Yes, you will have to redo the device assignments and room setups as each device will get a new internal ID. You shouldn't have to re-add the homebridge bridge and the devices should just show up as long as you don't change the "bridge" information in your config.json


#6

Does anyone have a dummies guide to installing homebridge on a pi?
I've attempted it many times, all without success, I cant understand where its going wrong :expressionless:


#7

Have you tried the instructions here: homebridge/README.md at master · nfarina/homebridge · GitHub


#8

This is the best how-to article:


#9

That guide pointed to by @dan.t seems most correct. I followed another and ran into problems and ultimately found advice to use --unsafe-perm, which fixed my problem(s). This guide suggests:

sudo npm install -g --unsafe-perm homebridge


#10

Yeah, followed this in that page.

Note: If you're running on a Raspberry Pi, you should have a look at the Wiki.


#11

Hi can anyone tell me how do I go by using the new homebridge with Hubconnect? or point me to the correct thread for that. thanks


#12

Take a look here:


#13

There seems to be a typo in your config.json example

the app url on my system needs to be of the format

"app_url": "http://192.168.0.232/apps/api/103/",


#14

You might consider including in the caveats that now events from all your devices are "shared" with HomeKit. One advantage of the old homebridge app, it could be argued, was that you would select which devices you wanted to port over to HomeKit. Im not sure how I feel about this yet. Is there any way to filter out only the specific HE devices you want to have on HomeKit? For me its only a couple of virtual presence switches, for example.


#15

Thanks, I corrected it in my post


#16

That is not entirely correct. The homebridge plugin listens to the eventsocket and the homebridge plugin filters out the events that are not meant for devices that are actually configured in the MakerAPI. HomeKit will never see those


#17

Ah right, my bad on that. I do have nearly all my devices enabled in MakerAPI already, for use with node-red and influxdb. Can I run a second instance of MakerAPI with only select devices enabled just for home bridge?


#18

Yes, that is what I do. In the next HE updated you will be able to give more meaning full names to each MakerAPI instance


#19

Great work on this Dan...So far so good on my setup. Will report back if I encounter any issues.

Also for others who have an issue with the first caveat, just create a few virtual switches for modes/HSM and setup a few Rule Machine rules until Hubitat updates the MakerAPI to have this capability.

Feature request: It would be great down the road as you improve your plugin to be able to exclude capabilities like the old plugin had. Not a huge deal but would be nice as I have several multi-sensors that I would rather not have all the measurements showing up in Homekit.


#20

Great thank you, I will take a look at that post