[powermax] Introduce some new channels for better status reporting (#10624)

* [powermax] Introduce some new channels for better status reporting

* New panel channels:
    - Ringing indicator (the siren is currently sounding)
    - Date/time the last message was received from the panel
    - List of all active alarms and alerts (similar to panel's
      Memory list, but items get removed from the list as conditions
      resolve)
* New zone channels:
    - Alarmed indicator (zone is in alarm, or has an alarm in memory)
    - Tamper alarm indicator (same but for a tamper condition)
    - Inactive indicator
    - Tamper indicator (zone is actively tampered right now)
    - Last status message received for this zone, and when
* Use descriptive names for zones in log messages. If you create a
  Thing for a zone, it will use that Thing's label in all reporting
  for that zone. If there's no Thing then it will attempt to use the
  zone label from the panel (e.g. "Basement").
* Clear all channels during startup to keep from displaying stale
  values loaded from persistence
* Also includes some minor SAT fixes (checkstyle, spotbugs)

Signed-off-by: Ron Isaacson <isaacson.ron@gmail.com>

* Incorporate review feedback from lolodomo

Signed-off-by: Ron Isaacson <isaacson.ron@gmail.com>
This commit is contained in:
Ron Isaacson
2021-09-08 12:58:35 -04:00
committed by GitHub
parent 0a1f23f98d
commit d4983c4991
19 changed files with 793 additions and 276 deletions

View File

@@ -17,6 +17,20 @@
</state>
</channel-type>
<channel-type id="last_message_time" advanced="true">
<item-type>DateTime</item-type>
<label>Last Message Time</label>
<description>Timestamp when the most recent message of any kind was received from the panel</description>
<state readOnly="true" pattern="%1$tH:%1$tM"></state>
</channel-type>
<channel-type id="active_alerts">
<item-type>String</item-type>
<label>Active Alarms and Alerts</label>
<description>List of active alarms and alerts</description>
<state readOnly="true" pattern="%s"></state>
</channel-type>
<channel-type id="trouble">
<item-type>Switch</item-type>
<label>Trouble Detected</label>
@@ -31,6 +45,13 @@
<state readOnly="true"></state>
</channel-type>
<channel-type id="ringing">
<item-type>Switch</item-type>
<label>Ringing</label>
<description>Whether or not the alarm siren is currently ringing</description>
<state readOnly="true"></state>
</channel-type>
<channel-type id="system_status">
<item-type>String</item-type>
<label>System Status</label>
@@ -107,6 +128,36 @@
<description>Whether or not the zone is bypassed</description>
</channel-type>
<channel-type id="alarmed">
<item-type>Switch</item-type>
<label>Zone Alarmed</label>
<description>Whether or not the zone has an active alarm condition, or has had an active alarm since the memory was
last cleared</description>
<state readOnly="true"></state>
</channel-type>
<channel-type id="tamper_alarm">
<item-type>Switch</item-type>
<label>Zone Tamper Alarm</label>
<description>Whether or not the zone's sensor has an active tamper condition, or has had an active tamper condition
since the memory was last cleared</description>
<state readOnly="true"></state>
</channel-type>
<channel-type id="inactive">
<item-type>Switch</item-type>
<label>Zone Inactive</label>
<description>Whether or not the zone's sensor is inactive (loss of supervision)</description>
<state readOnly="true"></state>
</channel-type>
<channel-type id="tampered">
<item-type>Switch</item-type>
<label>Zone Tampered</label>
<description>Whether or not the zone's sensor is reporting a tamper condition</description>
<state readOnly="true"></state>
</channel-type>
<channel-type id="armed">
<item-type>Switch</item-type>
<label>Zone Armed (Switch)</label>
@@ -121,6 +172,20 @@
<state readOnly="true"></state>
</channel-type>
<channel-type id="zone_last_message">
<item-type>String</item-type>
<label>Zone Last Status Message</label>
<description>The most recent status message reported by the zone</description>
<state readOnly="true" pattern="%s"></state>
</channel-type>
<channel-type id="zone_last_message_time">
<item-type>DateTime</item-type>
<label>Zone Last Status Time</label>
<description>Timestamp when Zone Last Status Message was received</description>
<state readOnly="true" pattern="%1$tH:%1$tM"></state>
</channel-type>
<channel-type id="pgm_status" advanced="true">
<item-type>Switch</item-type>
<label>PGM Status</label>

View File

@@ -17,8 +17,11 @@
<channel id="with_zones_bypassed" typeId="with_zones_bypassed"/>
<channel id="trouble" typeId="trouble"/>
<channel id="alert_in_memory" typeId="alert_in_memory"/>
<channel id="ringing" typeId="ringing"/>
<channel id="pgm_status" typeId="pgm_status"/>
<channel id="mode" typeId="mode"/>
<channel id="last_message_time" typeId="last_message_time"/>
<channel id="active_alerts" typeId="active_alerts"/>
<channel id="event_log_1" typeId="event_log"/>
<channel id="event_log_2" typeId="event_log"/>
<channel id="event_log_3" typeId="event_log"/>

View File

@@ -17,8 +17,11 @@
<channel id="with_zones_bypassed" typeId="with_zones_bypassed"/>
<channel id="trouble" typeId="trouble"/>
<channel id="alert_in_memory" typeId="alert_in_memory"/>
<channel id="ringing" typeId="ringing"/>
<channel id="pgm_status" typeId="pgm_status"/>
<channel id="mode" typeId="mode"/>
<channel id="last_message_time" typeId="last_message_time"/>
<channel id="active_alerts" typeId="active_alerts"/>
<channel id="event_log_1" typeId="event_log"/>
<channel id="event_log_2" typeId="event_log"/>
<channel id="event_log_3" typeId="event_log"/>

View File

@@ -21,6 +21,12 @@
<channel id="last_trip" typeId="last_trip"/>
<channel id="low_battery" typeId="system.low-battery"/>
<channel id="bypassed" typeId="bypassed"/>
<channel id="alarmed" typeId="alarmed"/>
<channel id="tamper_alarm" typeId="tamper_alarm"/>
<channel id="inactive" typeId="inactive"/>
<channel id="tampered" typeId="tampered"/>
<channel id="last_message" typeId="zone_last_message"/>
<channel id="last_message_time" typeId="zone_last_message_time"/>
</channels>
<config-description>