Can you get HSM Status over Maker API / EventStream?

Is it possible to get the current HSM Armed / Alarm / etc. status over Maker API? And are changes in status also reported on the EventStream websocket interface?

I'd like to add support for HSM to my homebridge plugin (homebridge-hubitat - npm) using the HomeKit "Security System" service and, to do that, I need to be able to get its initial state on the startup of the homebridge plugin and need to get any change in state over the eventStream websocket interface.

Yes. @dan.t supports it in his Homebridge MakerAPI plugin

1 Like

Thanks. I'm not seeing any support for the homeKit SecuritySystem service. Do you know -- is this plugin just using the events from HSM to trigger Water / Motion / Contact sensor devices in HomeKit? If that's the case, that plugin wouldn't need the initial status information. I'm trying to go a step further and allow arming / disarming from Homekit which necessitates having the arm-stay, arm-home, disarm, alarm, etc. statuses when the Homebridge plugin starts up.

It cannot control anything in HomeKit. You need HomeKit HAP for that. This does allow you to control arming/disarming etc. if I recall. I don't use that function anymore.

I do get status of safety devices that trigger HSM. It shows up in HomeKit every time my natural gas detector goes off (which seems to happen every time my wife cooks something with wine :man_shrugging:).

Thanks. Unless there is a way to query for the state over MAKER API, the alternative solution may be a custom device driver which exposes the current state via a custom attribute which gets set by HSM / Rule Machine and also provides button devices that can be used to arm HSM. This might be easier to interface with over MakerAPI and the eventstream. Anyway, thanks for the input.

1 Like

No problem. I'm not a developer, so I'm of limited use in that regard. But I'm sure you can get better info from the devs here. I'll update the post tags to help.

1 Like

There has to be. Because the Hubitat nodes for Node-RED can do it. That integration uses MakerAPI.

Not sure that's the case. The documentation makes clear you can get events as they happen. But I'm not finding any way to query for the current state over MakerAPI if, as I need to do, you need to get the current armed / alarm states during startup of a remote application that uses MakerAPI (e.g., a homebridge plugin). I don't see any mentione of a query / get state type operation in the docs: Hubitat® Safety Monitor Interface - Hubitat Documentation

Hmm. Not exactly sure what you're looking for, but here is how you can get HSM status, arm, and disarm using MakerAPI.

You will need to know the MakerAPI app id and the access token.

status:
http://hubitat_ip_address/apps/api/maker-api-app-id/hsm/armedStatus?access_token=your_access_token

disarm:
http://hubitat_ip_address/apps/api/maker-api-app-id/hsm/disarm?access_token=your_access_token

arm:
http://hubitat_ip_address/apps/api/maker-api-app-id/hsm/arm"Mode"?access_token=your_access_token

(replace Mode by whatever mode applies - remove the quotes as well)

2 Likes

You beat me to it. :slight_smile:

Again.

2 Likes

Dude - let the old man win once in a while.

4 Likes

That was it. It was the first item on that list that I couldn't find. Greatly appreciated!

1 Like

The status / disarm / arm MakerAPI instructions worked perfectly for the HSM Intrusion feature.

Are there equivalents for the Water and Smoke monitors?

The Hubitat® Safety Monitor Interface - Hubitat Documentation documentation indicates that I can get hsmAlert alerts for Water and Smoke, and I can "disarmAll" them, but can I get the Water / Smoke monitor's individual status and disarm / arm them individually over MakerAPI? That is, is there a MakerAPI query that tells me if the Water monitoring is specifically enabled? Or Smoke? And can I enable / disable those specifically (i.e., without altering any other monitor/rule)?

Thanks for the help!

I don't remember ever seeing endpoints for those. @bravenel would likely know offhand though.

Thank you. As an FYI - the specific application is that I am adding Hubitat Safety Monitor support to my plugin for Homebridge (homebridge-hubitat - npm). I have the "intrusion" monitor working (in beta, not yet released). It allows you to control the Intrusion monitor using a HomeKit "Security System" device, as shown below, and will trigger an Alert in HomeKit if there is an Intrusion. I'm trying to similarly support the Water and Smoke rules to trigger alerts.

1 Like

While I don't use HSM, I found this in my notes from a year or so ago:

  1. Sending "disarmAll" to HSM turns off smoke/water monitoring - and disables intrusion monitoring (weird side effect, but that is the ONLY way to disable smoke/water monitoring that I know of from Maker API)
  2. After a "disarmAll" sending "disarm" re-enables smoke/water monitoring, and re-enables intrusion monitoring
  3. Sending "cancelAlerts" will turn off water/smoke/intrusion alerts if one is active
2 Likes

@bravenel : As indicated in the prior few post, is there a way to get individual HSM rule statuses / arm / disarm individual rules (specifically, Water and Smoke) in MakerAPI?

If not, could this be added? Perhaps as a simple extension to the MakerAPI interface like ... /armRule/[rule name], .../disArmRule/[rule name], .../ruleStatus/[rule name]

As an addition to HSM, I'd also suggest a simpler way to interface with HSM over MakerAPI would be to have an option in HSM ("Create Child Device [toggle]") for each rule which, if selected, would create a simple child device that could be used for control. In the case of the Intrusion Alarm, you could use the securityKeypad Capability (you would just need to add armed-night to the securityKeypad enum list) and armNight() to the commands, and some other attribute ("alarmState") to indicate if you were currently in an alarm or clear state. In the case of other rules, maybe the control is simplified to just "disarmed / armed). The goal here would be to allow HSM to be controlled over MakerAPI just like any other device would be.

1 Like

Not directly. You'd have to maintain a model of HSM state using the points the @JasonJoel mentioned.

Will take the rest under consideration...

1 Like

Thank you! Maybe the SecurityKeypad capability is closer than I thought. It turns out that if I create a virtual device with that capability, Rule machine will show "armed away", "armed home", "armed night", and "disarmed" states, so the "armed night" state must already be part of the defined "enum" and already included in Rule Machine even though it isn't shown on the web documentation. However, the web interface in Hubitat doesn't shown an "Arm Night" control -- so it looks like someone got most of the way to adding the "armNight()" feature that I suggested, but it is incomplete. As a stepping-stone to the other capabilities I suggested, could this be completed?

Not sure what you're talking about. It won't offer Arm Night unless and until you have intrusions configured for Night.

Download the Hubitat app