Faut enlever ce code, qui remplace le state par défaut par un state d’un attribut temperature.
comme tu utilise une entité qui a déja la température en state, pas besoin de ce bout de code.
state_display: >
[[[ return
states['sensor.xiaomi_salle_a_manger_temperature'].attributes.temperature
+ ' °C' ]]]
modifier:
type: custom:button-card
aspect_ratio: 5/1
custom_fields:
date:
card:
type: custom:button-card
entity: sensor.date_time
show_icon: false
show_state: true
show_name: false
tap_action:
action: none
hold_action:
action: none
weather:
card:
type: custom:button-card
entity: sensor.xiaomi_salle_a_manger_temperature
layout: icon_state
icon: mdi:home
show_state: true
show_icon: true
show_name: false
size: 40%
styles:
card:
- background: none
- border: none
state:
- font-size: 1em
icon:
- left: 15px
tap_action:
action: none
hold_action:
action: none
weather2:
card:
type: custom:button-card
entity: weather.niderhoff
show_state: true
show_icon: false
show_name: false
state_display: >
[[[ return states['weather.niderhoff'].attributes.temperature + ' °C'
]]]
styles:
state:
- font-size: 1.6em
- font-weight: bold
card:
- background: none
- border: none
tap_action:
action: none
hold_action:
action: none
styles:
card:
- background: none
- border: none
custom_fields:
date:
- position: absolute
- left: 10%
- top: 30%
weather:
- position: absolute
- left: 60%
- top: 15%
weather2:
- position: absolute
- left: 75%
- top: 50%