[SOLVED] Help to understand: items and sitemap interaction

I am trying to understand what am I not completely understanding…

items example:
Group BS_Shower “Shower” (Home, BS)

Number   BS_Shower_Temperature          "Temperature"      <temperature>        (BS_Shower, gTemperature)             {channel="max:thermostat:gatewayID:deviceID:actual_temp"}

Number   BS_Shower_Heating              "Heating"          <heating>            (BS_Shower, gHeating)                 {channel="max:thermostat:gatewayID:deviceID:set_temp"} 

sitemap:
sitemap house label=“House” {
Frame label=“Basement” icon=“cellar” {
Group item=BS_Shower
}
}

    Frame label="Item Types" {
        Text label="Temperature" icon="temperature" {
            Default item=BS_Shower_Temperature label="Shower"
}
        Text label="Heating" icon="heating" {
            Default item=BS_Shower_Heating label="Shower"
}

I am struggling with understand the above, and this is in part due to my bias from doing things the fhem way and breaking what I know.

So, in the above example, the sitemap entry Group item=BS_Shower will list all items that are part of BS_Shower group. It will load them as declared in the items list, i.e. as a number with the temperature or heating icons.

In the second and third entry of Default item=BS_Shower_Temperature label=“Shower” here the Default tells the sitemap what widget to apply, and by default I assume it carries over the widget associated with the definition in the items list.

Questions arising now:
If I wanted to change the item to a setpoint with certain step / min / max values.
In the second and third entry, I can influence that directly via the sitemap.
However for the first entry, I cannot redefine it as a setpoint.
Can I define the setpoint property at the items list instead?

Finally, I really would like to understand how to make
Number BS_Shower_Heating “Heating” (BS_Shower, gHeating) {channel=“max:thermostat:gatewayID:deviceID:set_temp”} behave appropriately - i.e. how can I make it accept values from the user via BasicUI?

Thanks.

I suggest to have a look at the sitemap documentation: http://docs.openhab.org/configuration/sitemaps.html

I never used the type Default. I suggest to use always a defined type like Selection, Slider or Setpoint.

I have re-read that manual several times and keep feeling like I am against a wall…

Am I able to define the setpoint properties in the items list?
Otherwise I would not be able to make use of groups.

Do not mix item & sitemap definitions.

The items define the layer in direction of the devices.

The sitemap is the UI layer, you display the value of items with UI elements.

You need to define the Setpoint properties within the sitemap file.
You need to define the technical device properties in the items file.

For example, you may display a Number item as:

  • a slider
  • a setpoint
  • a text field (no input)
  • etc.

It’s up to you, each display element has different characteristics and some fit the use case better than others.

Setpoint item=BS_Shower_Heating label="Shower Temp [%.1f °C]" minValue=10 maxValue=45 step=1
Slider item=BS_Shower_Heating label="Shower Temp  [%.1f °C]"

You may override some display options in the sitemap, but you don’t have to.

You may even use a switch for that:

Switch item=BS_Shower_Heating label="Shower Temp  [%.1f °C]" mappings=[10="10",20="20",30="30",40="40",50="50"]

Now I understood why I thought that it is not working!
I used this:
Setpoint item=BS_Shower_Heating label=“Shower Temp [%.1f °C]” minValue=10 maxValue=45 step=1

But the temp shown in [%.1f] Is not updated.
If I hit F5 it shows the updated value.
If I check the log it also shows the change.

Do I need to set something for auto-update?
Thanks.

Maybe I answered this myself - if I have another item displayed that is a state. Then the setpoint is also updated.

Help with this one though in sitemaps:

This works:
Default item=GF_Dining_Temperature icon=“temperature” label=“Dining [%.1f °C]”

but this does not:
Number item=GF_Dining_Temperature icon=“temperature” label=“Dining [%.1f °C]”

edit Number is only a item definition! Starting to get it now.

Yes, this is sometimes challenging, because there are key words that are used in different places, and with different functions. It’s very important to understand the difference between

  • items (have a state, maybe bound to channels, this is the internal state machine of openHAB)
    and
  • widgets (different definitions how to represent a state on the UI)