bonjour
j’ai crée une carte pour ma clim mais j’ai un problème les trois boutons centrale oscillation, -,+ ne fonctionne pas
je n’arrive pas a corriger quelq’un peu m’aider svp merci.
type: custom:button-card
entity: climate.climatisation
size: 8%
show_name: true
color: "#318CE7"
state:
- value: "on"
color: yellow
- value: "off"
color: "#318CE7"
styles:
icon:
- left: 5%
- top: "-32%"
name:
- color: "#318CE7"
- left: 32%
- top: 12%
- font-size: 28px
- position: absolute
card:
- height: 160px
custom_fields:
temps:
- position: absolute
- width: 100%
buttons:
- position: absolute
- bottom: 15px
- left: 50%
- transform: translateX(-50%)
- width: 90%
custom_fields:
temps:
card:
type: custom:button-card
entity: climate.climatisation
show_icon: false
show_name: false
styles:
card:
- background: none
- box-shadow: none
grid:
- grid-template-areas: "\"current setpoint\""
- grid-template-columns: auto auto
- column-gap: 50px
- place-content: center
custom_fields:
current:
- font-size: 18px
- font-weight: bold
setpoint:
- font-size: 18px
- color: rgba(255,255,255,0.6)
custom_fields:
current: |
[[[
return `<span style="font-size: 12px; font-weight: normal; color: rgba(255,255,255,0.8); margin-right: 8px;">Actuelle</span><span style="font-size: 24px; font-weight: bold;">${states['climate.climatisation'].attributes.current_temperature}°</span>`
]]]
setpoint: |
[[[
return `<span style="font-size: 12px; font-weight: normal; color: rgba(255,255,255,0.6); margin-right: 8px;">Demandée</span><span style="font-size: 24px; font-weight: bold; color: rgba(255,255,255,0.6);">${states['climate.climatisation'].attributes.temperature}°</span>`
]]]
buttons:
card:
type: horizontal-stack
cards:
- type: custom:button-card
entity: climate.climatisation
show_name: false
icon: mdi:snowflake
tap_action:
action: call-service
service: climate.set_hvac_mode
service_data:
entity_id: climate.climatisation
hvac_mode: cool
styles:
card:
- border-radius: 12px
- background-color: rgba(110, 110, 110, 0.3)
icon:
- color: rgba(255, 255, 255, 0.8)
- type: custom:button-card
entity: climate.climatisation
show_name: false
icon: |
[[[
const mode = states['climate.climatisation'].attributes.swing_mode;
if (mode == 'Off') return 'mdi:fan-off';
if (mode == 'Swing Vertical') return 'mdi:swap-vertical';
if (mode == 'Swing Horizontal') return 'mdi:swap-horizontal';
return 'mdi:arrow-all';
]]]
styles:
card:
- border-radius: 12px
- background-color: rgba(110, 110, 110, 0.3)
icon:
- color: |
[[[
if (states['climate.climatisation'].attributes.swing_mode != 'Off') return 'var(--primary-color)';
return 'rgba(255, 255, 255, 0.8)';
]]]
tap_action:
action: call-service
service: climate.set_swing_mode
service_data_template:
entity_id: climate.climatisation
swing_mode: |
[[[
const climate_entity = states['climate.climatisation'];
const modes = ['Off', 'Swing Vertical', 'Swing Horizontal', 'Swing Vertical And Horizontal', 'Fixed 1', 'Fixed 2', 'Fixed 3', 'Fixed 4', 'Fixed 5'];
let current_index = 0;
if (climate_entity && climate_entity.attributes && climate_entity.attributes.swing_mode) {
const found_index = modes.indexOf(climate_entity.attributes.swing_mode);
if (found_index > -1) {
current_index = found_index;
}
}
const next_index = (current_index + 1) % modes.length;
return modes[next_index];
]]]
- type: custom:button-card
entity: climate.climatisation
show_name: false
icon: mdi:minus
styles:
card:
- border-radius: 12px
- background-color: rgba(110, 110, 110, 0.3)
icon:
- color: rgba(255, 255, 255, 0.8)
tap_action:
action: call-service
service: climate.set_temperature
service_data_template:
entity_id: climate.climatisation
temperature: >-
[[[ return
states['climate.climatisation'].attributes.temperature - 0.5;
]]]
- type: custom:button-card
entity: climate.climatisation
show_name: false
icon: mdi:plus
styles:
card:
- border-radius: 12px
- background-color: rgba(110, 110, 110, 0.3)
icon:
- color: rgba(255, 255, 255, 0.8)
tap_action:
action: call-service
service: climate.set_temperature
service_data_template:
entity_id: climate.climatisation
temperature: >-
[[[ return
states['climate.climatisation'].attributes.temperature + 0.5;
]]]
- type: custom:button-card
entity: climate.climatisation
show_name: false
icon: mdi:power
styles:
card:
- border-radius: 12px
- background-color: rgba(110, 110, 110, 0.3)
icon:
- color: rgba(255, 255, 255, 0.8)
tap_action:
action: call-service
service: climate.turn_off
service_data:
entity_id: climate.climatisation
hvac_modes:
- "off"
- auto
- cool
- heat
- dry
- fan_only
min_temp: 17
max_temp: 30
target_temp_step: 1
fan_modes:
- Auto
- Quiet
- Low
- Medium Low
- Medium
- Medium High
- High
preset_modes:
- Power 50
- Power 75
- Power 100
swing_modes:
- "Off"
- Swing Vertical
- Swing Horizontal
- Swing Vertical And Horizontal
- Fixed 1
- Fixed 2
- Fixed 3
- Fixed 4
- Fixed 5
current_temperature: 26
temperature: 24
fan_mode: Auto
preset_mode: null
swing_mode: "Off"
merit_a_feature: "OFF"
merit_b_feature: "OFF"
air_pure_ion: "OFF"
self_cleaning: "OFF"
outdoor_temperature: null
icon: mdi:air-conditioner
friendly_name: Climatisation
supported_features: 441