I’m using OpenHAB and everything is working very well. Now I would like to display the lastupdate property for my items in my sitemap, but I can’t seem to find any information about how to do it without creating a new DateTime Item and updating it’s value with a rule based on changes to the original Item.
However, if I look at the Items tab on my.openhab.org/items, each item already has the last update timestamp. I would like to be able to display this on my sitemap and especially for groups.
gDusk OFF Today at 7:14 AM
hueFrontPorch 0 Today at 7:14 AM
I’d like to put that timestamp in my sitemap as an easy way to make sure the lights are going on and off when I expect.
So, do I need to create a rule and track these separately even though OpenHAB clearly already has them somewhere since it’s displaying them on the my.openhab?
Yes, you will need a rule to update a time. Something like this:
rule “Motion alarm Garage”
when Item Arduino_Motion01 received update
then
if (Arduino_Motion01.state == ON && Home_Alarm.state == ON) {
pushover("Motion in garage detected", 1)
postUpdate(Arduino_Motion01_Time, new DateTimeType()) }
end
item:
DateTime Arduino_Motion01_Time "Last Motion [%1$td %1$tb at %1$tR]"```
I don’t think it’s on anyone’s list. If it is it is a really low priority. As shown above, there is a very simple work around using Rules to make this possible.