Display a list of events historically in MainUI/Sitemap

Hi guys,

I am in the process of migrating all my Zigbee sensors from the Xiaomi Ecosystem to Zigbee2mqtt.
The Xiaomi Home app has a nice view which shows events historically in a list e.g. when motion got detected, when vibrations happened, when doors got opened/closed, etc.

I was wondering if I can also make sch a list in OH3?
I remember it was not possible (or very cumbersome) in the old UI, but maybe the new UI has some option for this?

See screenshot for an example:

This sort of list is definitely doable, but will still be fairly cumbersome. You would need to incorporate a rule as well. Widgets don’t really have access to historical data (except in the special circumstance of charts). So to accomplish this would you would need a rule that records (and prunes old) events and stores them in the state of some proxy item. In this case, my first choice would probably be a string item with a state that is just a JSON of the time and event data. Then, the widget could work with the proxy item fairly easily to create that list.

I made some time ago this for the Xiaomi zigbee devices to show the zigbee events like you show.
The code for it is in the topic. It allows some formatting of the icons & colors depending on the type of event as you can see from the screenshot.
Example indeed uses the json as it comes from the Xiaomi cloud (with some cleaning). So if you migrate to zigbee2mqtt you would need some way of enumerating the events and make some json from it.

1 Like