Creation d'une carte bouton

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


Salut,
je passe par un script et fait appel au script pour augmenter ou diminué la température

Pour les scripts

dans button-card :

merci j’aurai du y penser …
il ne me reste plus qu’a voir pour l’oscillation

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 icons = {
                'Off': 'mdi:fan-off',
                'Swing Vertical': 'mdi:swap-vertical',
                'Swing Horizontal': 'mdi:swap-horizontal',
                'Swing Vertical And Horizontal': 'mdi:arrow-all',
                'Fixed 1': 'mdi:numeric-1-box-outline',
                'Fixed 2': 'mdi:numeric-2-box-outline',
                'Fixed 3': 'mdi:numeric-3-box-outline',
                'Fixed 4': 'mdi:numeric-4-box-outline',
                'Fixed 5': 'mdi:numeric-5-box-outline'
              };
              const mode = states['climate.climatisation'].attributes.swing_mode;
              
              // Renvoie l'icône correspondante, ou une icône par défaut si le mode n'est pas dans la liste
              return icons[mode] || 'mdi:help-rhombus-outline';
            ]]]
          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: script.climatisation_mode_de_balancement_suivant
        - 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: script.climatisation_mode_de_balancement_suivant
        - 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: script.thermostat_sam_up_temp
            data:
              climate_id: climate.climatisation
              value: 1
        - 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
alias: Climatisation - Mode de balancement suivant
icon: mdi:pan-horizontal
mode: single
sequence:
  - target:
      device_id: 34afd8f6d36ac29e7a409c5b4af231bb
    data:
      swing_mode: >
        {% set modes = [
          "Off",
          "Swing Vertical",
          "Swing Horizontal",
          "Swing Vertical And Horizontal",
          "Fixed 1",
          "Fixed 2",
          "Fixed 3",
          "Fixed 4",
          "Fixed 5"
        ] %} {% set current_mode = state_attr('climate.climatisation',
        'swing_mode') %} {% set current_index = modes.index(current_mode) if
        current_mode in modes else -1 %} {% set next_index = (current_index + 1)
        % modes | length %} {{ modes[next_index] }}
    action: climate.set_swing_mode
description: ""

voila merci a toi c’est completement resolu

1 « J'aime »

Ce sujet a été automatiquement fermé après 2 jours. Aucune réponse n’est permise dorénavant.