Sitemaps are great because they are easy to set up. But that also means your opportunities for customization are limited.
In MainUI, you have a lot more customization available but that makes it more complicated.
You can change the label for the new Item to include the timestamp (you can change the label of an Item from a rule) but it’s still not going to look like you describe I think.
rule "AddLocalDay2Datestamp"
when
System started or
Item localDay2Timestamp changed or
Item localDay2Condition changed
then
if (localDay2Condition.state != NULL && localDay2Timestamp.state != NULL) {
localDay2Condition.label = "Forecast on " + localDay2Timestamp.state.format("%1$td.%1$tm.%1$tY") +" [%s]"
}
end
Only thing I need to think about, are the “if” conditions actually really needed …
Down the line it would not break a thing here, if states are not proven. Its just manipulating output strings. As long as openHABian and bindings are running properly, the items should always have proper value. And if not, well then I can see a weired or no output for short time …
But same when “if” condition doesn’t allow string manipulation, I will see either an old output or no output …
Well, the point is, if the datatype isn’t of type DateTime, the format string won’t be valid, this will (most likely) lead to a nullPointerException and in consequence the rule will fail at this point. If the if condition is the last line of code (except the conditional code of course) this will do no harm, but it’s bad style not to check
Well, in that specific case I have a different view, that string output might not be correct, proven or not. Its just a string output manipulation.
Unlike a rule where something fundamental does happen. In those cases there’s no discussion about it. I usually proof extensiv various states, before allowing any real device is allowed to get in charge.