Get location of thing within page via item

  • Platform information:
    • Hardware: Raspberry Pi 4, arm
    • OS: Linux
    • Java Runtime Environment: running in Docker
    • openHAB version: 5.0.0

Hello,

Please see the following thing:

UID: deconz:temperaturesensor:BLA:BLUB
label: Multisensor-1 (Temperature)
thingTypeUID: deconz:temperaturesensor
configuration:
  lastSeenPolling: 1440
  id: "45"
bridgeUID: deconz:deconz:BLA
location: Wohnzimmer
channels:
  - id: temperature
    channelTypeUID: deconz:temperature
    label: Temperature
    description: Current temperature
    configuration: {}
  - id: last_updated
    channelTypeUID: deconz:last_updated
    label: Last Updated
    description: The date and time when the sensor was last updated.
    configuration: {}
  - id: battery_level
    channelTypeUID: system:battery-level
    label: Battery Level
    description: Battery level as a percentage (0-100%)
    configuration: {}
  - id: battery_low
    channelTypeUID: system:low-battery
    label: Low Battery
    description: Low battery warning with possible values on (low battery) and off
      (battery ok)
    configuration: {}
  - id: last_seen
    channelTypeUID: deconz:last_seen
    label: Last Seen
    description: The date and time when the sensor was last seen.
    configuration: {}

It has the following item associated:

version: 1
items:
  Multisensor1Temperature_Temperature:
    type: Number
    dimension: Temperature
    label: Temperature
    icon: Temperature
    format: '%.2f %unit%'
    tags:
      - Point
    channel: deconz:temperaturesensor:BLA:BLUB:temperature

I’m displaying the temperature of this sensor on a page like this:

config:
  hideNavbar: true
  label: Dashboard Waveshare
  sidebar: false
  visibleTo:
    - role:administrator
    - user:SOME_USER
blocks:
  - component: oh-block
    config: {}
    slots:
      default:
        - component: oh-grid-row
          config: {}
          slots:
            default:
              - component: oh-grid-col
                config: {}
                slots:
                  default:
                    - component: oh-label-card
                      config:
                        footer: =dayjs(items['Multisensor1Temperature_LastUpdated'].state).format('HH:mm').replace("Invalid
                          Date", "--:--") + " | " +
                          (Number.parseFloat(items['Multisensor1Humidity_Humidity'].state)*100).toFixed(0)
                          + " %" +
                          items['Multisensor1_Temperature_Low_Battery'].state.replace("NULL",
                          "").replace("OFF", "").replace("ON", " | 🪫")
                        label: =Number.parseFloat(items["Multisensor1Temperature_Temperature"].state).toFixed(1)
                          + "°C"
                        title: Wohnzimmer
masonry: []
grid: []
canvas: []

As you can see, the room name Wohnzimmer is duplicated (on page via title and on thing via location).

Is it possible to somehow get the thing’s location value via the item on the page so that I can maintain all the location on the thing level and don’t have to duplicate them?

Thank you and have a nice weekend

There is not really any way to do this. The ui widgets are not built to interact with Things. Any information you want available will need to be part of the Item itself.