Markarea based on item value

Hi,
I’m try to use create a chart that highlights when my water heater is active or not. The item provides possible values range from 1-4 (representing different stages), heating is only active when item is in state 3. I couldn’t find any document/example on how to configure a chart with markarea that only show when item is in specific value. Anybody can help with an example? Many thanks!

I think the easiest will be to create a Switch Item that is ON for 3 and OFF for everything else. Then chart the Switch.

You can use a rule or profile.

1 Like

Thank you! I’m not a big fan of using rules to sync value, not tried profile before, do you happen to have an example?

Edit: my first attempt with range profile failed, always ON for unknown reason:

Switch                  heating_active                       "Geothermal Heating Active"                                            <settings>       (gNilanHeating)               {channel="modbus:data:Heating:RegulationModeRead:xxxxxx:number"[profile="system:range", lower="1.9", upper="2.1", inverted="true"]}

I never understood why people resist using a simple rule to do something simple. It’s not like you get charged per rule or something.

I don’t know the Range profile so I can’t help with that. I’d probably use a Map transform with:

3=ON
=OFF

I don’t support text based configs any more so probably can’t help much with that part. The docs do have an example though.

I think if an item has value that is simply derived or transformed from underlying channel, it’s more clear and maintainable to define such logic together with the item so in the future when I update the item I don’t need to remember there are some rules that I have to change as well. For more complex logic I’d keep in rules - just my preference.
Regarding the range profile actually I managed to make it to work by changing inverted=“false”, I misunderstood when the range profile send ON command. What confused me was the change to inverted doesn’t take effect after saving the items file and I had to remove the item and re-add it with the change to make it work.
Anyways thanks a lot for the help, now I gained some experience with profile :slight_smile: