New Homebridge Plug-in via MakerAPI and Eventsocket

@dan.t are there any guides you recommend on using PM2 for running homebridge?

It is really 4 steps, here you go

Install pm2

npm install pm2@latest -g

make pm2 start on boot

pm2 startup

start homebridge

pm2 start homebridge

save configuration for boot

pm2 save

After that you can see the list of running apps with

pm2 list

And the logs with

pm2 logs

I use pm2 to run homebridge, and I have node 10.16.2.

Normally it works fine, but it's failed twice on me. Each time I've noticed my garage door is stuck in the "opening" state. I restarted homebridge and it wasn't fine. I haven't dug into it enough, or even looked at the logs to see what's going on. It also feels time based, aka after X many days something goes wrong. Anyways next time.

@dan.t Thanks for holding my hand on PM2...,much appreciated. How do I restart Homebridge via PM2?

Also, just completed the above steps and viewed log...have this in there so not sure whether to ignore or not:

/Users/USERNAME/.pm2/logs/homebridge-error.log last 15 lines:

0|homebrid | (node:5544) [DEP0112] DeprecationWarning: Socket.prototype._handle is deprecated

0|homebrid | (node:457) [DEP0112] DeprecationWarning: Socket.prototype._handle is deprecated

0|homebrid | (node:457) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

I started having sync issues again. Some lights are off but show on in home bridge. Same with locks. Not sure what’s going on but will try to view the logs in the morning and paste here if able.

**Update: I dont see anything strange in the logs for the time that I experienced the sync issue last night. The only batch of errors I see are:

(node:5544) [DEP0112] DeprecationWarning: Socket.prototype._handle is deprecated
(node:457) [DEP0112] DeprecationWarning: Socket.prototype._handle is deprecated
(node:457) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(node:459) [DEP0112] DeprecationWarning: Socket.prototype._handle is deprecated
(node:459) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

Do you think this can be in reverse? Homebridge to hubitat?

Can you explain what you’re asking?

Like expose all my homebridge added devices to hubitat

Not possible. There have been people saying that was a project they had in mind years ago, but nothing has ever come of it. Seems it must not be possible or feasible for some reason beyond what I understand.

The closest thing (and it’s barely close) was a project to create an application to take the place of an Apple device to run HomeKit automations (which I’m certain Apple WOULD have a problem with that kind of reverse engineering). They seem to be fine with Homebridge because there’s been no effort to shut it down or cripple it in many years, but taking away Apple TV, iPad and HomePod sales would be crossing a line they may not accept.

I read you can use virtual devices to trigger on HomeKit automations. You know a link to a tutorial on how to do that?

Also, could I pay you to edit some code? I’m trying to make the wink relay show separate relays so it translates in your app.

It doesn’t seem too hard, if I had a clue on how. He said I could update the driver for a parent child, whatever that means

Start with Homebridge. First post in this thread. Then create virtual switches in HE. Add them to Homebridge and then create HomeKit automations.

If you want one way control (HE >HomeKit Device), you need two automations.

Example:
• HE virtual switch turns ON > HomeKit Device turns ON

• HE virtual switch turns OFF > HomeKit Device turns OFF

If you want a two way sync, then you need four HomeKit Automations per device.

Example 2:

• HE virtual switch turns OFF > HomeKit Device turns OFF

• HE virtual switch turns ON > HomeKit Device turns ON

• HomeKit Device turns OFF > HE virtual switch turns OFF

• HomeKit Device turns ON > HE virtual switch turns ON

Example 3 (contact and motion sensors):

• HomeKit Device active or open > HE virtual switch turns ON

• HomeKit Device Inactive or closed > HE virtual switch turns OFF

I’m not a developer. Sorry, but you’ll need to learn to do it, or seek assistance from someone who is willing and able.

Thank you.

1 Like

I reviewed the devices that were not in sync this morning via the Hubitat web control - it seems that my hub is showing the devices as on when it is actually off. I am not sure who to get help on that but perhaps this issue is not a Homebridge or Plug-In issue after all?

I was having a similar issue with z-wave devices. I found that I couldn’t control one of my older z-wave dimmers from the device page. I reset the power to the device, hit configure, and it began working again for a couple days but that was all. I ended up replacing it with a z-wave plus dimmer and haven’t had any more issues.

1 Like

@dan.t this is the same issue I have as well.

AppleTV Gen4 13.1
Multiple iPhones running 12.4, 12.4.1 and 13.1
Hubitat at latest firmware
RPi updated to latest and greatest
NOde.js 12.0.1 with latest updates
Homebridge update to current release
Homebridge MakerAPI current release

@aaron, what do the devices show in Hubitat when the state is wrong in the Home app. With what @walksonair found, it might be that it is not Homebridge that shows the wrong status

They show on, active or unlocked. Seems like it isn’t getting updates from MakerAPI.

Sorry, but I need the answer to be a bit more clear....
Device XYZ shows on on the Home App and off in HE? And you don’t see any errors in the Homebridge logs?