OH2 sitemap layout tuning

With OH3 using the UI interface I would like to reproduce the following sitemap layout of a number from a previous version:
I did the following:

  1. Install MQTT Bindings
  2. MQTT Broker configured as: HomePiServer MQTT Broker (mqtt:broker:fc45f59da5)
  3. MQTT Things configured as: HomePiServer MQTT Client (mqtt:topic:fc45f59da5:df7323a6d3)
    Both are ONLINE and tested
  4. ADD Client Channel
    ID: STAT_254_TMP_CHAN
    Label: Thermostat - Température
    Type: Number
    MQTT State Topic: Home/SF/nb/254/2/040
    Unit of Measurement: °C
    Code result:
    UID: mqtt:topic:fc45f59da5:df7323a6d3
    label: HomePiServer MQTT Client
    thingTypeUID: mqtt:topic
    configuration: {}
    bridgeUID: mqtt:broker:fc45f59da5
    location: “Maison”
    channels:
    • id: STA_254_TMP_CHAN
      channelTypeUID: mqtt:number
      label: Thermostat - Température
      description: “”
      configuration:
      stateTopic: Home/SF/nb/254/2/040
      unit: °C
  5. Create Item
    Name: STAT_254_ITEM
    Label: Thermostat - Température
    Type: Number
    Category: temperature
    Semantic Class: Sensor
  6. Link Item to Channel
    Channel:
    T Thermostat - Température ONLINE
    HomePiServer MQTT Client
    mqtt:topic:fc45f59da5:df7323a6d3:STA_254_TMP_CHAN
    Item:
    Thermostat - Température
    Number · Equipment>Sensor
    STAT_254_TMP_ITEM
  7. Add to Site MAP
    Insert Widget Inside Sitemap
    Aa (text)
    Label: Thermostat - Température
    Item: Thermostat - Température (STA_254_TMP_ITEM)
    Icon: temperature
    Code:
    sitemap Maison label=“Maison” {
    Text icon=“temperature” label=“Thermostat - Température” item=STAT_254_TMP_ITEM
    }

QUESTIONS

  1. How can I specify that this is a float variable with one decimal such as:
    [%.1f °C]
  2. Where is is possible to specify the label and value color such as:
    labelcolor=[>=28=“red”, >=24=“orange”, >=19="#E6E600", >=15=“lime”, >=0=“blue”]
    valuecolor=[>=28=“red”, >=24=“orange”, >=19="#E6E600", >=15=“lime”, >=0=“blue”]

Thanks in advance
Robert

I’ve never tried to do a sitemap through the UI but I think I can answer:

  1. If you can’t add that to the label field, go to the Item’s setting and add State Description metadata and define the “Pattern” as %.1f °C.

  2. Color and visibility are not yet supported when defining sitemaps through the UI.

OK :joy:

To be frank, what’s the reasoning ? If you want to keep your Basic UI sitemap, just do. If you want to make use of the advantages main UI gives you, abandon sitemaps i.e. stop investing work.
But maintaining sitemaps through UI ?

For the record, this can be a “relatively easy” temporary solution for people who still want to use the UI configuration method and need to add not yet supported features:

  1. Use the UI to create the sitemap page as part of the UI configuration steps
  2. Go to the code TAB of the sitemap page
  3. Copy the non json part
  4. Paste the contents into a sitemap file (e.g.Home.sitemap under openhab/conf/sitemaps)
  5. Stop openhab
  6. Save and then delete uicomponents_system_sitemap.json under openhab/userdata/jsondb.
    You may need to recover this file for further modification if necessary
  7. Verify and delete any *–uicomponents_system_sitemap.json under openhab/userdata/jsondb/backup
  8. Restart openhab
  9. Check that you are now accessing the Home.sitemap file rather than the json one
    From now on you will be able to edit and modify the sitemap as before, adding all the features that are not supported yet :grinning_face_with_smiling_eyes:
    Of course this process shall be done when your map is nearly finalized, otherwise you will iteratively need to suppress the sitemap file and restore the json to maintain the configuration up to date and then recreate a sitemap file.
    NB: Unfortunately editing the non-json and adding not supported yet features to the sitemap page doesn’t work; the unknown features are causing unrecoverable errors.
    Robert

The feature is there, but incomplete. It could be removed altogether, or fixed.

I think there is still a place for BasicUI. I personally have no plan on using them going forward but Pages are way more complex and overwhelming to some users so having the option to build a sitemap through the UI could be very useful.

But I tend to agree that those users who are migrating their already existing sitemaps the better approach will be to keep them in .sitemap files or to move over to Pages instead of recreating an existing sitemap through the UI.