OH4 - Main UI - Humidity Badge



I have a question on humidity and the badge being correctly shown in the location page.
The item has the following state:

{ "state": "0.63", "displayState": "63 %", "type": "Quantity" }

On the card itself, the displayState is used and I see correctly 63%. However on the badge it seems that the state is used and 0.63 will be rounded to 1.

Is this something wrong with the badge or something I can change in my configuration?

Item is based on mqtt generic thing. MQTT message has the following payload:

  "humidity": 63,
  "linkquality": 36,
  "temperature": 23.1

MQTT channel definition:

  - id: Luftfeuchtigkeit
    channelTypeUID: mqtt:number
    label: Luftfeuchtigkeit
    description: ""
      stateTopic: zigbee2mqtt/OG/Buro/Wetter
      transformationPattern: JSONPATH:$.humidity
      unit: "%"

Item definition:

label: Luftfeuchtigkeit
type: Number:Dimensionless
category: humidity
  - OG_Buro_Wetter
groupType: None
function: null
  - Measurement
  - Humidity
  - Point

Thanks in advance for any help.

Set unit to % on your item and it should be solved.

Thanks, this solved the issue. It was to easy maybe.

However I thought that the unit is inherited from the channel. Are you saying that a unit should be defined on an item level in all cases? :thinking:

For Number:Dimensionless, yes.

1 Like