[CARTE] Ford pass et/ou BMW connected drive

Salut tout le monde.
Je partage le code d’une carte picture-elements réalisée pour ma voiture, une Ford Focus Estate (integration Fordpass HACS).

Je ne suis pas à l’origine du code, que j’ai lourdement modifié. Voici le lien dans lequel vous retrouverez:

Lien:

Generic 'Vehicle' Card - #94 by mrgrlscz - Feature Requests - Home Assistant Community

  • le code d’origine
  • le code modifié
  • le lien pour les fichiers d’images
Le code FORDpass ici:
########################
### CARD: Ford Focus ###
########################

# Original Design: @genosonic / https://community.home-assistant.io/t/generic-vehicle-card/397844

# This card uses: 
  # - HACS "fordpass" integration https://github.com/itchannel/fordpass-ha
  # - HACS "Decluttering Card" ( templates at the end of this card) https://github.com/custom-cards/decluttering-card
  # - HACS "Honeycom Menu" https://github.com/Sian-Lee-SA/honeycomb-menu
  # - HACS "card-mod" https://github.com/thomasloven/lovelace-card-mod
  # - HACS "state-switch" https://github.com/thomasloven/lovelace-state-switch
  # - YAML anchors

### =========================================================================================================
type: picture-elements
image: /local/images/vehicle_card/vehicle_card_vertical_base_500x920.svg
style: |
  @keyframes blink {
    20% {opacity: 100;}
    50% {opacity: 0;}
    80% {opacity: 100;}
  }
  @keyframes run {
    from {transform: rotate(0deg);}
    to {transform: rotate(10deg);}
  }
  @keyframes tech {
    0% {opacity: 0;}
    100% {opacity: 0;}
  }
elements:
### CIRCLES ANIMATIONS ======================================================================================
  # SleepMode status
  - type: conditional
    conditions:
      - entity: sensor.fordpass_deepsleepinprogress
        state: 'True'
    elements:
      - type: image
        image: /local/images/vehicle_card/vehicle_card_circles_light.svg
        dark_mode_image: /local/images/vehicle_card/vehicle_card_circles_dark.svg
        style:
          animation: blink 4s infinite
          <<: &cogweel
            transform: none
            top: 10.9%
            left: '-21.7%'
            width: 143.5%
  # Ignition Status
  - type: conditional
    conditions:
      - entity: sensor.fordpass_ignitionstatus
        state_not: Run
      - entity: sensor.fordpass_deepsleepinprogress
        state_not: 'True'
    elements:
      - type: image
        image: /local/images/vehicle_card/vehicle_card_circles_light.svg
        dark_mode_image: /local/images/vehicle_card/vehicle_card_circles_dark.svg
        style:
          animation: run 2s
          <<: *cogweel
  - type: conditional
    conditions:
      - entity: sensor.fordpass_ignitionstatus
        state: Run
    elements:
      - type: image
        image: /local/images/vehicle_card/vehicle_card_circles_light.svg
        dark_mode_image: /local/images/vehicle_card/vehicle_card_circles_dark.svg
        style:
          animation: run 0.7s linear infinite
          <<: *cogweel
### TOP =====================================================================================================
  # Logo (see end of code)
  # Update time
  - type: state-label
    entity: sensor.tplt_last_refresh_ford_focus
    style:
      transform: translate(-50%,-0%) #!important
      top: 0.5%
      left: 50%
  # Tracker
  - type: state-label
    entity: sensor.tplt_device_tracker_alisecell
    prefix: 'Localisation: '
    style:
      transform: translate(-50%,-0%)  #!important
      top: 4%
      left: 50%
### UNLOCKED ================================================================================================
  - type: conditional
    conditions:
      - entity: lock.fordpass_doorlock
        state_not: 'locked'
    elements:
      - type: image
        image: /local/images/vehicle_card/vehicle_card_redalert_circle.svg
        style:
          top: 50%
          left: 50%
          width: 100%
          animation: blink 1s infinite
### GLOBAL ==================================================================================================
  - type: custom:state-switch
    style:
      top: 50%
      left: 50%
      width: 100%
    entity: binary_sensor.tplt_ford_focus_detailed_view
    default: 'off'
    transition: slide-left # transitions: flip-x/y ; slide-left/right/up/down ; swap-left/right/up/down
    transition_time: 400
    states:
      # Overall ---------------------------------------------------------------------------------------------
      'off':
        type: picture-elements
        image: /local/images/blank_500x920.svg
        elements:
          - type: image
            image: /local/images/ford/ford_image_focus_rear.webp
            style:
              top: 47%
              left: 50.7%
              width: 176.2%
          - type: conditional
            conditions:
              - entity: sensor.fordpass_ignitionstatus
                state: 'Run'
            elements:
              - type: image
                image: /local/images/ford/ford_image_focus_rear_lights.svg
                style:
                  animation: blink 1s 2
                  top: 50%
                  left: 50%
                  width: 143%
        card_mod:
          style: |
            ha-card {
              background: none;
              border: none;
            }
      # Detailed --------------------------------------------------------------------------------------------
      'on':
        type: picture-elements
        image: /local/images/blank_500x920.svg
        elements:
          - type: image
            image: /local/images/vehicle_card/vehicle_card_generic.svg
            style:
              top: 50%
              left: 50%
              width: 130%
          # Tire Pressure Status
          - type: custom:decluttering-card
            template: dcl_ford_card_tires
            variables:
              - attribute: leftFrontTirePressure
              - top: 27%
              - left: 13%
          - type: custom:decluttering-card
            template: dcl_ford_card_tires
            variables:
              - attribute: rightFrontTirePressure
              - top: 27%
              - left: 87%
          - type: custom:decluttering-card
            template: dcl_ford_card_tires
            variables:
              - attribute: outerLeftRearTirePressure
              - top: 73%
              - left: 13%
          - type: custom:decluttering-card
            template: dcl_ford_card_tires
            variables:
              - attribute: outerRightRearTirePressure
              - top: 73%
              - left: 87%
          # Doors
          - type: custom:decluttering-card
            template: dcl_ford_card_lids
            variables:
              - item: door_fl
          - type: custom:decluttering-card
            template: dcl_ford_card_lids
            variables:
              - item: door_fr
          - type: custom:decluttering-card
            template: dcl_ford_card_lids
            variables:
              - item: door_rl
          - type: custom:decluttering-card
            template: dcl_ford_card_lids
            variables:
              - item: door_rr
          - type: custom:decluttering-card
            template: dcl_ford_card_lids
            variables:
              - item: door_hood
          - type: custom:decluttering-card
            template: dcl_ford_card_lids
            variables:
              - item: door_trunk
          # Windows
          - type: conditional
            conditions:
              - entity: binary_sensor.tplt_ford_focus_door_fl
                state: 'off'
            elements:
              - type: custom:decluttering-card
                template: dcl_ford_card_lids
                variables:
                  - item: window_fl
          - type: conditional
            conditions:
              - entity: binary_sensor.tplt_ford_focus_door_fr
                state: 'off'
            elements:
              - type: custom:decluttering-card
                template: dcl_ford_card_lids
                variables:
                  - item: window_fr
          - type: conditional
            conditions:
              - entity: binary_sensor.tplt_ford_focus_door_rl
                state: 'off'
            elements:
              - type: custom:decluttering-card
                template: dcl_ford_card_lids
                variables:
                  - item: window_rl
          - type: conditional
            conditions:
              - entity: binary_sensor.tplt_ford_focus_door_rr
                state: 'off'
            elements:
              - type: custom:decluttering-card
                template: dcl_ford_card_lids
                variables:
                  - item: window_rr
        card_mod:
          style: |
            ha-card {
              background: none;
              border: none;
            }
### BOTTOM ==================================================================================================
  # Fuel
  - type: custom:config-template-card
    entities:
      - sensor.fordpass_fuel
    variables:
      - states['sensor.fordpass_fuel'].attributes.fuelLevel
    element:
      type: state-icon
      entity: sensor.fordpass_fuel
    style:
      transform: none
      top: 88.5%
      left: 1%
      '--paper-item-icon-color': |-
        "${
          vars[0]>=30 ? 'var(--subtext0)'
          : vars[0]>=15 ? 'var(--warning-color)'
          : 'var(--error-color)'
        }"
      animation: |-
        "${
          vars[0]>=30 ? 'none'
          : vars[0]>=15 ? 'blink 2s infinite'
          : 'blink 1s infinite'
        }"
  - type: custom:config-template-card
    entities:
      - sensor.fordpass_fuel
    variables:
      - states['sensor.fordpass_fuel'].attributes.fuelLevel
    element:
      type: state-label
      entity: sensor.fordpass_fuel
    style:
      transform: none
      top: 89%
      left: 8%
      color: |-
        "${
          vars[0]>=30 ? 'var(--primary-text-color)'
          : vars[0]>=15 ? 'var(--warning-color)'
          : 'var(--error-color)'
        }"
  - type: state-label
    entity: sensor.tplt_fordpass_fuel_distancetoempty_value
    prefix: 'Carburant: '
    suffix: ' km'
    style:
      transform: none
      top: 89%
      left: 20%
  # ExhaustFluid
  - type: custom:config-template-card
    entities:
      - sensor.fordpass_exhaustfluidlevel
    variables:
      - states['sensor.fordpass_exhaustfluidlevel'].attributes.exhaustFluidLevel.value
    element:
      type: state-icon
      entity: sensor.fordpass_exhaustfluidlevel
    style:
      transform: none
      top: 93.5%
      left: 1%
      '--paper-item-icon-color': |-
        "${
          vars[0]>=30 ? 'var(--subtext0)'
          : vars[0]>=15 ? 'var(--warning-color)'
          : 'var(--error-color)'
        }"
      animation: |-
        "${
          vars[0]>=30 ? 'none'
          : vars[0]>=15 ? 'blink 2s infinite'
          : 'blink 1s infinite'
        }"
  - type: custom:config-template-card
    entities:
      - sensor.fordpass_exhaustfluidlevel
    variables:
      - states['sensor.fordpass_exhaustfluidlevel'].attributes.exhaustFluidLevel.value
    element:
      type: state-label
      entity: sensor.fordpass_exhaustfluidlevel
    style:
      transform: none
      top: 94%
      left: 8%
      color: |-
        "${
          vars[0]>=30 ? 'var(--primary-text-color)'
          : vars[0]>=15 ? 'var(--warning-color)'
          : 'var(--error-color)'
        }"
  - type: state-label
    entity: sensor.tplt_fordpass_exhaustfluidlevel_urearange_value
    prefix: 'AdBlue: '
    suffix: ' km'
    style:
      transform: none
      top: 94%
      left: 20%
  # Tires Status OK
  - type: conditional
    conditions:
      - entity: sensor.tplt_tire_pressure_ford_focus
        state: 'OK'
    elements:
      - type: state-icon
        entity: sensor.tplt_tire_pressure_ford_focus
        case: first
        style:
          <<: &tires_a
            transform: none
            top: 88.5%
            left: 70%
          opacity: 0.05
      - type: state-label
        entity: sensor.tplt_tire_pressure_ford_focus
        style:
          <<: &tires_b
            transform: none
            top: 89%
            left: 77%
          opacity: 0.05
  # Tires Status LOW
  - type: conditional
    conditions:
      - entity: sensor.tplt_tire_pressure_ford_focus
        state: 'Faible'
    elements:
      - type: state-icon
        entity: sensor.tplt_tire_pressure_ford_focus
        case: first
        style:
          <<: *tires_a
          animation: blink 2s infinite
          '--paper-item-icon-color': var(--warning-color)
      - type: state-label
        entity: sensor.tplt_tire_pressure_ford_focus
        style:
          <<: *tires_b
          color: var(--warning-color)
  # Tires Status CRITICAL
  - type: conditional
    conditions:
      - entity: sensor.tplt_tire_pressure_ford_focus
        state: 'Urgent'
    elements:
      - type: state-icon
        entity: sensor.tplt_tire_pressure_ford_focus
        style:
          <<: *tires_a
          animation: blink 1s infinite
          '--paper-item-icon-color': var(--error-color)
      - type: state-label
        entity: sensor.tplt_tire_pressure_ford_focus
        case: first
        style:
          <<: *tires_b
          color: var(--error-color)
  # mileage/odometer
  - type: state-icon
    entity: sensor.fordpass_odometer
    state_color: false
    style:
      transform: none
      top: 93.5%
      left: 70%
  - type: state-label
    entity: sensor.fordpass_odometer
    style:
      transform: none
      top: 94%
      left: 77%
### HoneyComb & Tap Actions =================================================================================
  - type: image
    title: null
    image: /local/images/vehicle_card/vehicle_card_vertical_base_500x920.svg
    style:
      top: 50%
      left: 50%
      width: 100%
      animation: tech 2s infinite
    hold_action:
      action: call-service
      service: honeycomb
      service_data:
        entity: null
        active: false
        autoclose: true
        audio: null
        size: 300
        spacing: 4
        animation_speed: 50
        buttons:
          # button 1
          - skip
          # button 2
          - skip
          # button 3
          - icon: mdi:lock-check
            color: var(--subtext1)
            tap_action:
              action: call-service
              service: lock.lock
              service_data:
                entity_id: lock.fordpass_doorlock
          # button 4
          - skip
          # button 5
          - icon: mdi:engine
            color: var(--subtext1)
            tap_action:
              action: call-service
              service: switch.toggle
              service_data:
                entity_id: switch.fordpass_ignition_switch
          # button 6
          - icon: mdi:lock-open-variant-outline
            color: var(--subtext1)
            tap_action:
              action: call-service
              service: lock.unlock
              service_data:
                entity_id: lock.fordpass_doorlock
    tap_action:
      action: call-service
      service: input_boolean.toggle
      service_data:
        entity_id: input_boolean.vehicle_card_helper_ford_focus
    double_tap_action:
      action: none
  # Logo
  - type: image
    title: null
    image: /local/images/ford/ford_logo_pass.png
    style:
      transform: none
      top: 3.5%
      left: 7%
      width: 10%
    tap_action:
      action: fire-dom-event
      browser_mod:
        service: browser_mod.navigate
        data:
          path: /nova-dashboard/map
    hold_action: none

##############################
### DECLUTTERING TEMPLATES ###
##############################

# ### FORD ==================================================================================================
# # lids
# dcl_ford_card_lids:
  # element:
    # type: image
    # entity: binary_sensor.tplt_ford_focus_[[item]]
    # state_image:
      # 'on': /local/images/vehicle_card/vehicle_card_[[item]].svg
      # 'off': /local/images/blank_30x30.svg
    # style:
      # top: 50%
      # left: 50%
      # width: 130%
      # # animation: strobe 2s infinite
# # tire pressure
# dcl_ford_card_tires:
  # element:
    # type: custom:config-template-card
    # entities:
      # - sensor.fordpass_tirepressure
    # variables:
      # - >-
        # states['sensor.fordpass_tirepressure'].attributes.[[attribute]]
    # element:
      # type: state-label
      # entity: sensor.fordpass_tirepressure
      # attribute: '[[attribute]]'
      # suffix: ' bars'
    # style:
      # top: '[[top]]'
      # left: '[[left]]'
      # color: |-
        # "${
          # vars[0]>=2.1 ? 'var(--primary-text-color)'
          # : vars[0]>=1.7 ? 'var(--warning-color)'
          # : 'var(--error-color)'
        # }"
      # animation: |-
        # "${
          # vars[0]>=2.1 ? 'none'
          # : vars[0]>=1.7 ? 'blink 2s infinite'
          # : 'blink 1s infinite'
        # }"





Version BMW (BMW Connected Drive):

N’hésitez pas à commenter, et/ou partager vos cartes ! @+

2 « J'aime »

J’ai passé ma carte BMW (intégration BMW connected drive) au format decluttering-template récemment, pour l’afficher deux modèles différents: une Série 1 et un X2. Voici le code correspondant!

Code BMW
################################
### CARD: BmW (template DCL) ###
################################

# Original Design: @genosonic / https://community.home-assistant.io/t/generic-vehicle-card/397844

# This card IS A DECLUTTERING TEMPLATE and uses: 
  # - "BMW Connected Drive" integration https://www.home-assistant.io/integrations/bmw_connected_drive
  # - HACS "Decluttering Card" ( templates & card example at the end of this file) https://github.com/custom-cards/decluttering-card
  # - HACS "Honeycom Menu" https://github.com/Sian-Lee-SA/honeycomb-menu
  # - HACS "card-mod" https://github.com/thomasloven/lovelace-card-mod
  # - HACS "state-switch" https://github.com/thomasloven/lovelace-state-switch
  # - YAML anchors


### GLOBAL ==================================================================================================
dcl_vehicle_card_bmw: # !! This card IS A DECLUTTERING TEMPLATE !!
  card:
    type: picture-elements
    image: /local/images/vehicle_card/vehicle_card_vertical_base_500x920.svg
    style: |
      @keyframes blink {
        20% {opacity: 100;}
        50% {opacity: 0;}
        80% {opacity: 100;}
      }
      @keyframes tech {
        0% {opacity: 0;}
        100% {opacity: 0;}
      }
    elements:
    ### CIRCLES =============================================================================================
      - type: image
        image: /local/images/vehicle_card/vehicle_card_circles_light.svg
        dark_mode_image: /local/images/vehicle_card/vehicle_card_circles_dark.svg
        style:
          <<: &cogweel
            transform: none
            top: 10.9%
            left: '-21.7%'
            width: 143.5%
    ### TOP =================================================================================================
      # logo (see end of code)
      # device tracker
      - type: state-label
        entity: sensor.tplt_device_tracker_bmw_[[serie]]
        prefix: 'Localisation: '
        style:
          transform: translate(-50%,-0%)  #!important
          top: 4%
          left: 50%
    ### UNLOCKED ============================================================================================
      - type: conditional
        conditions:
          - entity: binary_sensor.bmw_[[serie]]_door_lock_state
            state_not: 'off'
        elements:
          - type: image
            image: /local/images/vehicle_card/vehicle_card_redalert_circle.svg
            style:
              top: 50%
              left: 50%
              width: 100%
              animation: blink 1s infinite
    ### GLOBAL ==============================================================================================
      - type: custom:state-switch
        style:
          top: 50%
          left: 50%
          width: 100%
        entity: binary_sensor.tplt_bmw_[[serie]]_detailed_view
        default: 'off'
        transition: slide-left # transitions: flip-x/y ; slide-left/right/up/down ; swap-left/right/up/down
        transition_time: 400
        states:
          # Overall -----------------------------------------------------------------------------------------
          'off':
            type: picture-elements
            image: /local/images/blank_500x920.svg
            elements:
              - type: image
                image: /local/images/bmw/bmw_image_[[serie]].png
                style:
                  top: '[[image_top]]' # !important quoting due to dcl nesting
                  left: '[[image_left]]' # !important quoting due to dcl nesting
                  width: '[[image_width]]' # !important quoting due to dcl nesting
            card_mod:
              style: |
                ha-card {
                  background: none;
                  border: none;
                }
          # Detailed ----------------------------------------------------------------------------------------
          'on':
            type: picture-elements
            image: /local/images/blank_500x920.svg
            elements:
              - type: image
                image: /local/images/vehicle_card/vehicle_card_generic.svg
                style:
                  top: 50%
                  left: 50%
                  width: 130%
              # Doors
              - type: custom:decluttering-card
                template: dcl_bmw_card_lids
                variables:
                  - serie: '[[serie]]' # !important quoting due to dcl nesting
                  - item: door_fl
              - type: custom:decluttering-card
                template: dcl_bmw_card_lids
                variables:
                  - serie: '[[serie]]' # !important quoting due to dcl nesting
                  - item: door_fr
              - type: custom:decluttering-card
                template: dcl_bmw_card_lids
                variables:
                  - serie: '[[serie]]' # !important quoting due to dcl nesting
                  - item: door_rl
              - type: custom:decluttering-card
                template: dcl_bmw_card_lids
                variables:
                  - serie: '[[serie]]' # !important quoting due to dcl nesting
                  - item: door_rr
              - type: custom:decluttering-card
                template: dcl_bmw_card_lids
                variables:
                  - serie: '[[serie]]' # !important quoting due to dcl nesting
                  - item: door_hood
              - type: custom:decluttering-card
                template: dcl_bmw_card_lids
                variables:
                  - serie: '[[serie]]' # !important quoting due to dcl nesting
                  - item: door_trunk
              # Windows
              - type: conditional
                conditions:
                  - entity: binary_sensor.tplt_bmw_[[serie]]_door_fl
                    state: 'off'
                elements:
                  - type: custom:decluttering-card
                    template: dcl_bmw_card_lids
                    variables:
                      - serie: '[[serie]]' # !important quoting due to dcl nesting
                      - item: window_fl
              - type: conditional
                conditions:
                  - entity: binary_sensor.tplt_bmw_[[serie]]_door_fr
                    state: 'off'
                elements:
                  - type: custom:decluttering-card
                    template: dcl_bmw_card_lids
                    variables:
                      - serie: '[[serie]]' # !important quoting due to dcl nesting
                      - item: window_fr
              - type: conditional
                conditions:
                  - entity: binary_sensor.tplt_bmw_[[serie]]_door_rl
                    state: 'off'
                elements:
                  - type: custom:decluttering-card
                    template: dcl_bmw_card_lids
                    variables:
                      - serie: '[[serie]]' # !important quoting due to dcl nesting
                      - item: window_rl
              - type: conditional
                conditions:
                  - entity: binary_sensor.tplt_bmw_[[serie]]_door_rr
                    state: 'off'
                elements:
                  - type: custom:decluttering-card
                    template: dcl_bmw_card_lids
                    variables:
                      - serie: '[[serie]]' # !important quoting due to dcl nesting
                      - item: window_rr
            card_mod:
              style: |
                ha-card {
                  background: none;
                  border: none;
                }
    ### BOTTOM ==============================================================================================
      # Fuel
      - type: custom:config-template-card
        entities:
          - sensor.bmw_[[serie]]_remaining_fuel
        variables:
          - states['sensor.bmw_[[serie]]_remaining_fuel']
        element:
          type: state-icon
          entity: sensor.bmw_[[serie]]_remaining_fuel
        style:
          transform: none
          top: 88.5%
          left: 1%
          '--paper-item-icon-color': |-
            "${
              vars[0]>=30 ? 'var(--subtext0)'
              : vars[0]>=15 ? 'var(--warning-color)'
              : 'var(--error-color)'
            }"
          animation: |-
            "${
              vars[0]>=30 ? 'none'
              : vars[0]>=15 ? 'blink 2s infinite'
              : 'blink 1s infinite'
            }"
      - type: custom:config-template-card
        entities:
          - sensor.bmw_[[serie]]_remaining_fuel
        variables:
          - states['sensor.bmw_[[serie]]_remaining_fuel']
        element:
          type: state-label
          entity: sensor.bmw_[[serie]]_remaining_fuel
        style:
          transform: none
          top: 89%
          left: 8%
          color: |-
            "${
              vars[0]>=30 ? 'var(--primary-text-color)'
              : vars[0]>=15 ? 'var(--warning-color)'
              : 'var(--error-color)'
            }"
      - type: state-label
        entity: sensor.bmw_[[serie]]_remaining_range_fuel
        prefix: 'Autonomie: '
        style:
          transform: none
          top: 89%
          left: 20%
      # Check Control Status OK
      - type: conditional
        conditions:
          - entity: binary_sensor.bmw_[[serie]]_check_control_messages
            state: 'off'
        elements:
          - type: state-icon
            entity: binary_sensor.bmw_[[serie]]_check_control_messages
            case: first
            style:
              <<: &check_a
                transform: none
                top: 88.5%
                left: 70%
              opacity: 0.05
          - type: state-label
            entity: binary_sensor.bmw_[[serie]]_check_control_messages
            style:
              <<: &check_b
                transform: none
                top: 89%
                left: 77%
              opacity: 0.05
      # Mileage
      - type: state-icon
        entity: sensor.bmw_[[serie]]_mileage
        icon: mdi:counter
        style:
          transform: none
          top: 93.5%
          left: 70%
      - type: state-label
        entity: sensor.bmw_[[serie]]_mileage
        style:
          transform: none
          top: 94%
          left: 77%
    ### HoneyComb & Tap Actions =============================================================================
      - type: custom:decluttering-card
        template: dcl_bmw_card_honeycomb
        variables:
          - serie: '[[serie]]' # !important quoting due to dcl nesting
      # Logo
      - type: image
        title: null
        image: /local/images/bmw/bmw_logo_[[serie]].png
        style:
          transform: none
          top: '[[logo_top]]' # !important quoting due to dcl nesting
          left: '[[logo_left]]' # !important quoting due to dcl nesting
          width: '[[logo_width]]' # !important quoting due to dcl nesting
        tap_action:
          action: fire-dom-event
          browser_mod:
            service: browser_mod.navigate
            data:
              path: /nova-dashboard/map
        hold_action: none
      # Check Control Status NotOK
      - type: conditional
        conditions:
          - entity: binary_sensor.bmw_[[serie]]_check_control_messages
            state: 'on'
        elements:
          - type: state-icon
            entity: binary_sensor.bmw_[[serie]]_check_control_messages
            case: first
            style:
              <<: *check_a
              animation: blink 2s infinite
              '--paper-item-icon-color': var(--warning-color)
          - type: state-label
            entity: binary_sensor.bmw_[[serie]]_check_control_messages
            style:
              <<: *check_b
              color: var(--warning-color)

##############################
### DECLUTTERING TEMPLATES ###
##############################

# lids
dcl_bmw_card_lids:
  element:
    type: image
    entity: binary_sensor.tplt_bmw_[[serie]]_[[item]]
    state_image:
      'on': /local/images/vehicle_card/vehicle_card_[[item]].svg
      'off': /local/images/blank_30x30.svg
    style:
      top: 50%
      left: 50%
      width: 130%

# honeycomb
dcl_bmw_card_honeycomb:
  element:
    type: image
    title: null
    image: /local/images/vehicle_card/vehicle_card_vertical_base_500x920.svg
    style:
      top: 50%
      left: 50%
      width: 100%
      animation: tech 2s infinite
    hold_action:
      action: call-service
      service: honeycomb
      service_data:
        entity: null
        active: false
        autoclose: true
        audio: null
        size: 300
        spacing: 4
        animation_speed: 50
        buttons:
          # button 1
          - icon: mdi:bullhorn
            color: var(--subtext1)
            tap_action:
              action: call-service
              service: button.press
              service_data:
                entity_id: button.bmw_[[serie]]_sound_horn
          # button 2
          - icon: mdi:car-light-alert
            color: var(--subtext1)
            tap_action:
              action: call-service
              service: button.press
              service_data:
                entity_id: button.bmw_[[serie]]_flash_lights
          # button 3
          - icon: mdi:lock-check
            color: var(--subtext1)
            tap_action:
              action: call-service
              service: lock.lock
              service_data:
                entity_id: lock.bmw_[[serie]]_lock
          # button 4
          - icon: mdi:air-purifier-off
            color: var(--subtext1)
            tap_action:
              action: call-service
              service: button.press
              service_data:
                entity_id: button.bmw_[[serie]]_deactivate_air_conditioning
          # button 5
          - icon: mdi:air-filter
            color: var(--subtext1)
            tap_action:
              action: call-service
              service: button.press
              service_data:
                entity_id: button.bmw_[[serie]]_activate_air_conditioning
          # button 6
          - icon: mdi:lock-open-variant-outline
            color: var(--subtext1)
            tap_action:
              action: call-service
              service: lock.unlock
              service_data:
                entity_id: lock.bmw_[[serie]]_lock
    tap_action:
      action: call-service
      service: input_boolean.toggle
      service_data:
        entity_id: input_boolean.vehicle_card_helper_bmw_[[serie]]
    double_tap_action:
      action: call-service
      service: button.press
      service_data:
        entity_id: button.bmw_[[serie]]_refresh_from_cloud

##############################
### CARD example: BmW 116i ###
##############################

# type: custom:decluttering-card
# template: dcl_vehicle_card_bmw
# variables:
  # - serie: 116i
  # - image_top: 48%
  # - image_left: 53%
  # - image_width: 130%
  # - logo_top: 3%
  # - logo_left: 4%
  # - logo_width: 20%


Hello,

Super vos cartes :slight_smile:
question : Avez-vous créé un sensor pour le kilométrage quotidien?

Salut. Non, je n’en ai pas eu le besoin.

Quand tu dis que t’en as pas eu besoin ca veut dire que tu l’as deja ou c’est une donnee qui ne t’intéresse pas?

Je veux dire que l’info ne m’intéresse pas. En tout cas l’idée ne m’est pas venue.
Aucune des deux intégrations (Ford et Bmw) ne fournit cette info.
Tu en fais/ferais quoi ?

C’est juste pour avoir le kilométrage quotidien. Par exemple tu pourrais calculer ta conso moyenne de carburant sur un trajet.

La data est là il faut la calculer .c’est juste que je n’y suis pas arrivé :pensive:

Je veux dire qu’il n’y a pas de capteur natif journalier.
Personnellement je n’y trouve pas d’intérêt.
Faudrait faire un template qui se RAZ à 23’59 et qui prend la valeur de « mileage a l’instant T » - « mileage à 00:00 (autre template sensor ?) ».

Hello,
Finalement j’y suis arrivé. J’ai cree un input number qui prend le mileage a 00h00 et je fais la diff entre l’actuel et l’input que je mets dans un sensor.
Si ca interesse je metterai le detail.

Je suis interessé. Tu penses qu’on peut calculer la conso journalière ?
Merci à toi

hello,
j’ai crée une entrée input_number comme celle-là:


j’ai cree un sensor dans mon sensors.yaml:

- platform: template
  sensors:
    daily_mileage:
      unique_id: daily_XXX_mileage
      friendly_name: "Kilométrage quotidien"
      unit_of_measurement: "km"
      value_template: "{{ (states('sensor.XXX_mileage') | int - states('input_number.last_daily_reset') | int) }}"

et pour finir j’ai créé une automatisation :

alias: Réinitialiser le kilométrage quotidien
trigger:
  - platform: time
    at: "00:00:00"
action:
  - service: input_number.set_value
    data:
      entity_id: input_number.last_daily_reset
      value: "{{ states('sensor.XXX_mileage') }}"

Du coup en traçant le sensor j’ai mon kilométrage quotidien :slight_smile:
j’espère que cela t’aidera

Merci, je testerai quand l’api de Ford reviendra, c’est KO depuis ce matin

1 « J'aime »