My OpenHAB is integrated with my alarm.
I have the following items that register who has armed/disarmed the alarm and when:
Number Tex_Alarm_Status "Alarm status [MAP(tex_alarmstatus.map):%s]" <alarm> (gAlarm, gAlarmlogging)
Number Tex_Alarm_User "User[MAP(tex_alarmusers.map):%s]" <man_3> (gAlarm, gAlarmlogging)
DateTime Tex_Alarm_Status_Update "Timestamp of arming/disarming the alarm [%1$td.%1$tm.%1$tY %1$tT]" <clock> (gAlarm, gAlarmlogging)
I want to show a table in BasicUI showing the last arm/disarm events. Something like: User Status Time
John Armed 26.05.2017 19:27:39
Kate Disarmed 26.05.2017 18:20:30
John Armed 25.05.2017 19:27:39
Obviously sorted on “time” (newest record first).
Does anyone have an idea how to pull this of?
All three items are persisted in InfluxDB (EveryChange).
I first considered Grafana, but that seems to be more for graphs.
Also, I think the challenge is that these three items are technically independent from each other. They don’t have a common key field. They are updated ‘almost’ at the same time (by a rule), but there could be some milliseconds time difference between their updates…
That was essentially what I was suggesting for ‘special items’, if you only wanted the last three or four, or the last per user. No faffing with database and graphs, where only recent action is of interest.
If monthly analysis or whatever is really needed, then go with your variation.
If I would need to see the last 10 records, I would have to add 10 additional items.
Each item being a string and containing user name, arm/disarm status and a time-stamp.
A rule (triggered by arming/disarming the alarm) would update these values (oldest value removed, newest value added).
I realize this could work.
I was just wondering, is there no way to leverage persistence for this? I would like apply this approach to multiple items (not just the alarm), and maybe keep more than 10 records. My number of items would explode with this approach.