WebThingsIO / schemas

A Web of Things schema repository
https://webthings.io/schemas/
5 stars 8 forks source link

Alarm Capability #36

Closed benfrancis closed 5 years ago

benfrancis commented 5 years ago

Closes #31.

I have shied away from the enum because the three states (ok, warning and emergency) felt a bit arbitrary, but you may disagree.

Looking at the Zigbee specification I note there are many other options a "warning device" using the IAS WD cluster can specify, including:

For the time being I have opted for the simplest possible solution with a single boolean AlarmProperty. Is this enough to get started with? Perhaps we could extend this in future.

To be honest I'm struggling to justify the need for the AlarmEvent in addition to the AlarmProperty, though it feels like a natural use of an event.

hobinjk commented 5 years ago

The main thing I've been going back and forth with is that it would be good to have a popup in the gateway when an alarm occurs and the current easiest way is with an event IIRC. On one hand special-casing alarm properties is weird, on the other hand it's redundant to have an event that would essentially say this (or in the current specification, some) property changed

mrstegeman commented 5 years ago

I think the main benefit you get with the event is that you can have a more explanatory text string, like "CO levels have reached X", which can be helpful when determining whether or not to dismiss the physically audible/visible alarm.

hobinjk commented 5 years ago

I agree to some extent, but then why wouldn't the description of the CO alarm property be "CO levels have exceeded X"? Both the property and the event have a way of providing a static human-readable description. If the event gets a payload then it can at least provide dynamic updates ("CO levels are at X which is greater than the threshold Y") but that adds a burden to thing implementations that doesn't necessarily seem worth it when the CO alarm thing wanting to provide the information in an event could also have a numeric CO level property

mrstegeman commented 5 years ago

Another possibility is having an event fire as a sort of precursor to the alarm property being tripped, like “CO is reaching potentially unhealthy levels”, whereas the property may mean “Time to leave your house.”

This is why I think the event should be optional. It may not be necessary in all cases, but could be useful in others.

mrstegeman commented 5 years ago

@benfrancis We should probably get this merged before we release 0.8.