|
|
(2 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
− | == <big>Overview</big> ==
| |
− | Hubitat<sup>®</sup> Safety Monitor (HSM) uses Hubitat Location Events to communicate with other apps. It reports its state using an event named '''hsmStatus''', and custom monitoring rule arming/disarming with '''hsmRules'''. It reports alert events with an event named '''hsmAlert'''. Apps can set the arm/disarm state of HSM with an event named '''hsmSetArm'''.
| |
| | | |
− | == <big>HSM events and their values</big> ==
| + | <big>'''We're moving!''' Please visit http://docs2.hubitat.com for the latest documentation.</big> |
| | | |
− | === <code><big>hsmStatus</big></code> ===
| + | <big> |
− | | + | This document is available at: http://docs2.hubitat.com/en/developer/interfaces/hubitat-safety-monitor-interface |
− | :;armedAway | + | </big> |
− | ::Intrusion alerts for ''Away'' are armed | |
− | | |
− | :; armingAway
| |
− | :: Intrusion ''Away'' arming pending exit delay
| |
− | ::
| |
− | :: '''Note''': For "armingAway", the number of seconds for exit delay is in the event data map as ''seconds''.
| |
− | | |
− | :; armedHome
| |
− | :: Intrusion alerts for ''Home'' are armed
| |
− | | |
− | :; armingHome
| |
− | :: Intrusion ''Home'' arming pending exit delay
| |
− | | |
− | :; armedNight
| |
− | :: Intrusion alerts for ''Night'' are armed
| |
− | | |
− | :; armingNight
| |
− | :: Intrusion ''Night'' arming pending exit delay
| |
− | | |
− | :; disarmed
| |
− | :: Intrusion alerts are disarmed
| |
− | | |
− | :; allDisarmed
| |
− | :: Intrusion, smoke, water and custom alerts are disarmed
| |
− | | |
− | === <code><big>hsmRules</big></code> ===
| |
− | | |
− | :;armedRule
| |
− | ::descriptionText = Name of HSM Monitoring Rule armed
| |
− | | |
− | :; disarmedRule
| |
− | :: descriptionText = Name of HSM Monitoring Rule disarmed
| |
− | | |
− | === <code><big>hsmAlert</big></code> ===
| |
− | | |
− | :;intrusion
| |
− | ::Intrusion ''Away'' alert
| |
− | | |
− | :; intrusion-home
| |
− | :: Intrusion ''Home'' alert
| |
− | | |
− | :; intrusion-night
| |
− | :: Intrusion ''Night'' alert
| |
− | | |
− | :; smoke
| |
− | :: Smoke alert
| |
− | | |
− | :; water
| |
− | :: Water alert
| |
− | | |
− | :; rule
| |
− | :: descriptionText = Name of HSM Monitoring Rule alert
| |
− | | |
− | :; cancel
| |
− | :: Alerts cancelled
| |
− | | |
− | :; arming
| |
− | :: Failed to arm due to open contact
| |
− | | |
− | === <code><big>hsmSetArm</big></code> ===
| |
− | | |
− | :;armAway
| |
− | ::Arm intrusion alerts for ''Away''
| |
− | | |
− | :; armHome
| |
− | :: Arm intrusion alerts for ''Home''
| |
− | | |
− | :; armNight
| |
− | :: Arm intrusion alerts for ''Night''
| |
− | | |
− | :; disarm
| |
− | :: Disarm intrusion alerts
| |
− | | |
− | :; disarmAll
| |
− | :: Disarm all alerts, including HSM Monitoring Rules
| |
− | | |
− | :; armAll
| |
− | :: Arm alerts for smoke, water and '''all''' HSM Monitoring Rules
| |
− | | |
− | :; CancelAlerts
| |
− | :: Stop '''all''' in progress alerts
| |
− | | |
− | === Examples ===
| |
− | | |
− | ==== App subscribes to HSM status ====
| |
− | | |
− | :;
| |
− | ::<code>subscribe (location, “hsmStatus”, statusHandler)</code>
| |
− | | |
− | ==== App subscribes to HSM Alerts ====
| |
− | | |
− | :;
| |
− | ::<code>subscribe (location, “hsmAlerts”, alertHandler)</code>
| |
− | ::
| |
− | | |
− | ==== App arms HSM ====
| |
− | | |
− | :;
| |
− | ::<code>sendLocationEvent (name: “hsmSetArm”, value: “armAway”)</code>
| |
− | | |
− | ==== Handler example for HSM alerts ====
| |
− | | |
− | :;
| |
− | ::<code>def alertHandler(evt) {</code> <code>log.info “HSM Alert: $evt.value“ + (evt.value == “rule” ? ”, $evt.descriptionText” : “”)</code> <code>// only has descriptionText for rule alert</code> <code>}</code>
| |