Display changing items in sitemap

I’d like to Display the changing items in the sitemap. Kinda what happens in “Events.log”, but I’m too lazy to “cat” my way through it! :wink:
Is there some kind of magic to do this?

What do you mean by changing items?

In the Events.log I get something like this:

2017-09-16 12:44:26.445 [ItemStateChangedEvent     ] - Sensoren_Lux_S_lux changed from 9162.857142199999548017944062117123849020572379231452941894531250000 to 7482.184870199999629651990140644102211808785796165466308593750000
2017-09-16 12:44:28.129 [ItemCommandEvent          ] - Item 'RTR_OG_Schlafen_actualTemp' received command 20.04
2017-09-16 12:44:28.142 [ItemCommandEvent          ] - Item 'Sensoren_Temp_OG_Schlafen' received command 20.04
2017-09-16 12:44:28.147 [ItemStateChangedEvent     ] - RTR_OG_Schlafen_actualTemp changed from 20.02 to 20.04
2017-09-16 12:44:28.164 [ItemStateChangedEvent     ] - Sensoren_Temp_OG_Schlafen changed from 20.02 to 20.04
2017-09-16 12:45:03.079 [ItemStateChangedEvent     ] - Sensoren_Temp_OutN changed from 16.7 to 16.8
2017-09-16 12:45:03.442 [ItemStateChangedEvent     ] - Sensoren_Temp_KollOben changed from 42.8 to 41.9
2017-09-16 12:45:03.798 [ItemStateChangedEvent     ] - Sensoren_Temp_KollVorlauf changed from 43.0 to 40.9
2017-09-16 12:45:04.443 [ItemStateChangedEvent     ] - Sensoren_Temp_Solarsec_VL changed from 37.3 to 37.0
2017-09-16 12:45:05.110 [ItemStateChangedEvent     ] - Sensoren_Temp_Kessel2Vorlauf changed from 26.0 to 26.1
2017-09-16 12:45:05.763 [ItemStateChangedEvent     ] - Sensoren_Temp_Zirkulation changed from 29.2 to 29.0

I’d like to see that on my visu, not only if I’m logged in the console and opening Events.log! :wink:

Putting a number item in the sitemap with the item state should do it.

I don’t want to see the actual item.state, I want to see, which items changed in realtime just like it is in the log.
In part, I could just insert an iFrame, grabbing the Input of Events.log, but perhaps there’s a better solution to this…?

The short answer is no. The best you can do is install frontail and look at the logs on a separate webpage.

1 Like

That’s on my ToDo, when everything else is in place (still not all items in OH2 unfortunately)…
Then I’ll take my energy to logfiles and monitoring…

Thanks anyways! :wink:

I believe the best option would be frontail as @rlkoshak mentioned. However, if you just want to display the last changed item using an item in your sitemap, then you can do it using MQTT. I do not consider this a great option, but I was able to get it to work.

  1. Setup MQTT persistence to send a message for every item change.
  2. Create a string item that is subscribed to the topic but filters itself out.

mqtt-persistence.cfg

broker=mosquitto
topic=openhab/itemchanged
message=%1$s changed to %3$s

mqtt.persist

...
Items {
    * : strategy = everyChange
}

xxx.items

String ItemChangedMessage { mqtt="<[mosquitto:openhab/itemchanged:state:default:^(?!ItemChangedMessage).*$]" }

This message will not contain a timestamp like the log file does. Adding this would require a rule.

as a side effect of my destroying my old openHABian, I got with 1.3 frontail installed as a gift. :wink:
That’s sort of solves my use case and even betters developing new rules and stuff. So I can rewrite the rules while having frontail open and see what’s happening both on events.log and openhab.log…

Great stuff!