Hi,
I am not able to set the count of the decimal places to 0.
In the item definition is [%.0f], in the items overview in the openhab settings is it ok, but when I use the item in a widget as Label, there a often a lot of numbers.
uid: my_energy_balance_widget
tags: []
props:
parameters:
- context: item
description: Item für Leistung Erzeugung (z. B. Number:Power)
label: Item Erzeugung
name: itemGen
required: true
type: TEXT
- context: item
description: Item für Leistung Verbrauch (z. B. Number:Power)
label: Item Verbrauch
name: itemCons
required: true
type: TEXT
- context: item
description: Item für Leistung Zähler
label: Item Zähler
name: itemCnt
required: true
type: TEXT
timestamp: Jan 9, 2026, 12:45:42 PM
component: f7-card
config:
style:
border-radius: var(--f7-card-expandable-border-radius)
box-shadow: 5px 5px 10px 1px rgba(0,0,0,0.1)
height: 120px
margin-left: 5px
margin-right: 5px
noShadow: false
slots:
default:
- component: f7-row
config:
no-gap: true
style:
align-items: center
height: 15%
justify-content: space-around
slots:
default:
- component: f7-col
config:
style:
align-items: center
display: flex
gap: 6px
justify-content: center
width: 50%
slots:
default:
- component: oh-icon
config:
height: 20
icon: material:electrical_services
style: {}
width: 20
- component: Label
config:
style:
color: "#f39c12"
font-size: 1em
font-weight: 600
text: Verbrauch
- component: f7-col
config:
style:
align-items: center
display: flex
gap: 6px
justify-content: center
width: 50%
slots:
default:
- component: oh-icon
config:
height: 20
icon: material:wb_sunny
style: {}
width: 20
- component: Label
config:
style:
color: "#2ecc71"
font-size: 1em
font-weight: 600
text: Erzeugung
- component: f7-row
config:
no-gap: true
style:
align-items: center
height: 65%
slots:
default:
- component: f7-col
config:
style:
align-items: center
display: flex
justify-content: center
padding-left: 1px
padding-right: 1px
width: 50%
slots:
default:
- component: oh-gauge
config:
bgColor: transparent
borderBgColor: rgb(224,224,224)
borderColor: "#f39c12"
borderWidth: 14
item: =props.itemCons
labelText: ""
labelTextColor: "#f39c12"
max: "2000"
min: "0"
size: 150
type: semicircle
unit: ""
valueTextColor: "#f39c12"
- component: f7-col
config:
style:
align-items: center
display: flex
justify-content: center
padding-left: 2px
padding-right: 2px
width: 50%
slots:
default:
- component: oh-gauge
config:
bgColor: transparent
borderBgColor: rgb(224,224,224)
borderColor: "#2ecc71"
borderWidth: 14
item: =props.itemGen
labelText: ""
labelTextColor: "#2ecc71"
max: "800"
min: "0"
size: 150
type: semicircle
unit: ""
valueText: ""
valueTextColor: "#2ecc71"
- component: f7-row
config:
style:
height: 10%
slots:
default:
- component: f7-col
config:
width: 100
slots:
default:
- component: Label
config:
style:
color: '=(items[props.itemCnt].state <= 0) ? "green" : "red"'
font-size: 1.2em
text-align: center
text: = 'Netzbezug ' + items.HouseActualCounter.state
