Item transformation

I wonder if it is possible to have something like this:

Contact Boiler_ok               "Caldeira OK"               (All, gHeating)  {channel="modbus:data:qmq2:inputs_qmq2:i6:contact"}
Contact Boiler_problem          "Caldeira anomalia"         (All, gHeating)  {INVERT(Boiler_ok)}

Instead of defining a rule to invert the state.


MAP transformation to say whatever for the message that’s received? May need to change the boiler problem item to something other than Contact just check the doc’s to see what available.

Have you seen the use of MAP to transform the text displayed for a standard state e.g. for CLOSED display “Alarm !!”
Sitemaps offer the ability to color text depending on state e.g. red to indicate a problem.
Custom icons allow you to display say a tick or a big red light depending on state.
Sitemap visibility= options allow you to display different labels depending on state.
Sitemap visibility= options allow you to completely hide a line depending on state e.g. only show when there is an alarm.

All of which is to say you don’t need a second Item for that purpose.

I’m using the item in a habpanel widget, which uses its state to display. That’s why I think I have to manipulate the state, not the text.

Habpanel offers you the choice of using raw state or server formatted state.

As your channel is Modbus, you can also invert with a transform in the channel definition. I do.