Does anyone know how to programmatically retrieve the state presentation from the rules?
In the .items file, you could define something like this:
Number Livingroom_Temperature "Temperature [%.1f °C]" // e.g. "23.5 °C"
When displayed in sitemap, it shows “Temperature 23.5 °C”. I am trying to get that value in a .rules file, but invoking item.getLabel() only returns “Temperature”. I am hoping not to have to define the formatting again in the .rules file.
At this point, I agree with Rick. I don’t think it’s possible. There is nothing to indicate that the formatting information even makes it to the GenericItem class. The only relevant method there is getLabel. There must be another mechanism to store the formatting info and used it in the sitemap.
This is unfortunate as the information needs to be duplicated again. My use case is to send an email alert with the same formatted labels as seen on the sitemap.