L'intégration Tesla et automatisation!

type: picture-elements
image: /local/tesla/tesla4.png
elements:
  - type: state-icon
    entity: button.<nametesla>_force_data_update
    style:
      top: 2%
      left: 10%
      color: '#039be5'
    tap_action:
      action: call-service
      service: button.press
      service_data: {}
      target:
        entity_id: button.<nametesla>_force_data_update
    double_tap_action: none
    hold_action: none
  - type: conditional
    conditions:
      - entity: update.<nametesla>_software_update
        state_not: 'on'
    elements:
      - type: icon
        icon: mdi:upload-off
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 2%
          left: 64%
          color: black
  - type: conditional
    conditions:
      - entity: update.<nametesla>_software_update
        state: 'on'
    elements:
      - type: icon
        icon: mdi:upload
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 2%
          left: 64%
          color: '#039be5'
  - type: conditional
    conditions:
      - entity: binary_sensor.<nametesla>_online
        state: 'on'
    elements:
      - type: icon
        icon: mdi:check-network
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 2%
          left: 83%
          color: green
  - type: conditional
    conditions:
      - entity: binary_sensor.<nametesla>_online
        state_not: 'on'
    elements:
      - type: icon
        icon: mdi:network-off-outline
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 2%
          left: 83%
          color: black
  - type: conditional
    conditions:
      - entity: switch.<nametesla>_sentry_mode
        state: 'off'
    elements:
      - type: icon
        icon: mdi:circle-slice-8
        tap_action:
          action: call-service
          service: scene.turn_on
          service_data:
            entity_id: scene.mode_sentinelle_on
        double_tap_action: none
        hold_action: none
        style:
          top: 2%
          left: 77%
          color: black
  - type: conditional
    conditions:
      - entity: switch.<nametesla>_sentry_mode
        state: 'on'
    elements:
      - type: icon
        icon: mdi:circle-slice-8
        tap_action:
          action: call-service
          service: scene.turn_on
          service_data:
            entity_id: scene.mode_sentinelle_off
        double_tap_action: none
        hold_action: none
        style:
          top: 2%
          left: 77%
          color: red
  - type: conditional
    conditions:
      - entity: lock.<nametesla>_doors
        state: locked
    elements:
      - type: icon
        icon: mdi:lock
        tap_action:
          action: call-service
          service: lock.unlock
          service_data:
            entity_id: lock.<nametesla>_doors
        double_tap_action: none
        hold_action: none
        style:
          top: 2%
          left: 70.5%
          color: black
  - type: conditional
    conditions:
      - entity: lock.<nametesla>_doors
        state_not: locked
    elements:
      - type: icon
        icon: mdi:lock-open-variant
        tap_action:
          action: call-service
          service: lock.lock
          service_data:
            entity_id: lock.<nametesla>_doors
        double_tap_action: none
        hold_action: none
        style:
          top: 2%
          left: 70.5%
          color: '#039be5'
  - type: conditional
    conditions:
      - entity: climate.<nametesla>_hvac_climate_system
        state: 'off'
    elements:
      - type: icon
        icon: mdi:fan-off
        tap_action:
          action: call-service
          service: scene.turn_on
          service_data:
            entity_id: scene.activation_clim
        double_tap_action: none
        hold_action: none
        style:
          top: 2%
          left: 96%
          color: black
  - type: conditional
    conditions:
      - entity: climate.<nametesla>_hvac_climate_system
        state: heat_cool
    elements:
      - type: icon
        icon: mdi:air-conditioner
        tap_action:
          action: call-service
          service: scene.turn_on
          service_data:
            entity_id: scene.arret_clim
        double_tap_action: none
        hold_action: none
        style:
          top: 2%
          left: 96%
          color: '#039be5'
  - type: conditional
    conditions:
      - entity: climate.<nametesla>_hvac_climate_system
        attribute: preset_mode
        state: Normal
    elements:
      - type: icon
        icon: mdi:air-filter
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 5%
          left: 96%
          color: black
  - type: conditional
    conditions:
      - entity: climate.<nametesla>_hvac_climate_system
        attribute: preset_mode
        state: Defrost
    elements:
      - type: icon
        icon: mdi:car-defrost-front
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 5%
          left: 96%
          color: green
  - type: conditional
    conditions:
      - entity: climate.<nametesla>_hvac_climate_system
        attribute: preset_mode
        state_not: Defrost
    elements:
      - type: icon
        icon: mdi:car-defrost-front
        tap_action:
          action: call-service
          service: scene.turn_on
          service_data:
            entity_id: scene.defrost_mode
        double_tap_action: none
        hold_action: none
        style:
          top: 5%
          left: 96%
          color: black
  - type: conditional
    conditions:
      - entity: climate.<nametesla>_hvac_climate_system
        attribute: preset_mode
        state: Dog Mode
    elements:
      - type: icon
        icon: mdi:dog
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 8%
          left: 96%
          color: green
  - type: conditional
    conditions:
      - entity: climate.<nametesla>_hvac_climate_system
        attribute: preset_mode
        state_not: Dog Mode
    elements:
      - type: icon
        icon: mdi:dog
        tap_action:
          action: call-service
          service: scene.turn_on
          service_data:
            entity_id: scene.dog_mode
        double_tap_action: none
        hold_action: none
        style:
          top: 8%
          left: 96%
          color: black
  - type: conditional
    conditions:
      - entity: climate.<nametesla>_hvac_climate_system
        attribute: preset_mode
        state_not: Camp Mode
    elements:
      - type: icon
        icon: mdi:tent
        tap_action:
          action: call-service
          service: scene.turn_on
          service_data:
            entity_id: scene.camp_mode
        double_tap_action: none
        hold_action: none
        style:
          top: 11%
          left: 96%
          color: black
  - type: conditional
    conditions:
      - entity: climate.<nametesla>_hvac_climate_system
        attribute: preset_mode
        state: Camp Mode
    elements:
      - type: icon
        icon: mdi:campfire
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 11%
          left: 96%
          color: green
  - type: conditional
    conditions:
      - entity: select.<nametesla>_heated_seat_left
        state: 'Off'
    elements:
      - type: icon
        icon: mdi:heat-wave
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 36%
          left: 38%
          color: white
  - type: conditional
    conditions:
      - entity: select.<nametesla>_heated_seat_left
        state_not: 'Off'
    elements:
      - type: icon
        icon: mdi:heat-wave
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 36%
          left: 38%
          color: red
  - type: conditional
    conditions:
      - entity: select.<nametesla>_heated_seat_right
        state: 'Off'
    elements:
      - type: icon
        icon: mdi:heat-wave
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 36%
          left: 58%
          color: white
  - type: conditional
    conditions:
      - entity: select.<nametesla>_heated_seat_right
        state_not: 'Off'
    elements:
      - type: icon
        icon: mdi:heat-wave
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 36%
          left: 58%
          color: red
  - type: conditional
    conditions:
      - entity: select.<nametesla>_heated_seat_rear_left
        state: 'Off'
    elements:
      - type: icon
        icon: mdi:heat-wave
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 46%
          left: 38%
          color: white
  - type: conditional
    conditions:
      - entity: select.<nametesla>_heated_seat_rear_left
        state_not: 'Off'
    elements:
      - type: icon
        icon: mdi:heat-wave
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 6%
          left: 38%
          color: red
  - type: conditional
    conditions:
      - entity: select.<nametesla>_heated_seat_rear_center
        state: 'Off'
    elements:
      - type: icon
        icon: mdi:heat-wave
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 46%
          left: 48%
          color: white
  - type: conditional
    conditions:
      - entity: select.<nametesla>_heated_seat_rear_center
        state_not: 'Off'
    elements:
      - type: icon
        icon: mdi:heat-wave
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 46%
          left: 48%
          color: red
  - type: conditional
    conditions:
      - entity: select.<nametesla>_heated_seat_rear_right
        state: 'Off'
    elements:
      - type: icon
        icon: mdi:heat-wave
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 46%
          left: 58%
          color: white
  - type: conditional
    conditions:
      - entity: select.<nametesla>_heated_seat_rear_right
        state_not: 'Off'
    elements:
      - type: icon
        icon: mdi:heat-wave
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 46%
          left: 58%
          color: red
  - type: conditional
    conditions:
      - entity: sensor.tesla_tpms_front_left_alert
        state: 'False'
    elements:
      - type: icon
        icon: mdi:tire
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 20%
          left: 16%
          color: green
  - type: conditional
    conditions:
      - entity: sensor.tesla_tpms_front_left_alert
        state_not: 'False'
    elements:
      - type: icon
        icon: mdi:car-tire-alert
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 20%
          left: 16%
          color: red
  - type: state-label
    entity: sensor.<nametesla>_tpms_front_left
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 17%
      left: 16%
      font-size: 100%
      font-weight: normal
      color: rgb(255,255,255)
  - type: conditional
    conditions:
      - entity: sensor.tesla_tpms_front_right_alert
        state: 'False'
    elements:
      - type: icon
        icon: mdi:tire
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 20%
          left: 82%
          color: green
  - type: conditional
    conditions:
      - entity: sensor.tesla_tpms_front_right_alert
        state_not: 'False'
    elements:
      - type: icon
        icon: mdi:car-tire-alert
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 20%
          left: 82%
          color: red
  - type: state-label
    entity: sensor.<nametesla>_tpms_front_right
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 17%
      left: 82%
      font-size: 100%
      font-weight: normal
      color: rgb(255,255,255)
  - type: conditional
    conditions:
      - entity: sensor.tesla_tpms_rear_right_alert
        state: 'False'
    elements:
      - type: icon
        icon: mdi:tire
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 57%
          left: 82%
          color: green
  - type: conditional
    conditions:
      - entity: sensor.tesla_tpms_rear_right_alert
        state_not: 'False'
    elements:
      - type: icon
        icon: mdi:car-tire-alert
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 57%
          left: 82%
          color: red
  - type: state-label
    entity: sensor.<nametesla>_tpms_rear_right
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 54%
      left: 82%
      font-size: 100%
      font-weight: normal
      color: rgb(255,255,255)
  - type: conditional
    conditions:
      - entity: sensor.tesla_tpms_rear_left_alert
        state: 'False'
    elements:
      - type: icon
        icon: mdi:tire
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 57%
          left: 16%
          color: green
  - type: conditional
    conditions:
      - entity: sensor.tesla_tpms_rear_left_alert
        state_not: 'False'
    elements:
      - type: icon
        icon: mdi:car-tire-alert
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 57%
          left: 16%
          color: red
  - type: state-label
    entity: sensor.<nametesla>_tpms_rear_left
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 54%
      left: 16%
      font-size: 100%
      font-weight: normal
      color: rgb(255,255,255)
  - type: state-label
    entity: binary_sensor.<nametesla>_doors
    attribute: Driver Rear
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 48%
      left: 15%
      color: black
  - type: state-label
    entity: binary_sensor.<nametesla>_doors
    attribute: Driver Front
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 35%
      left: 15%
      color: black
  - type: state-label
    entity: binary_sensor.<nametesla>_doors
    attribute: Passenger Rear
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 48%
      left: 80%
      color: black
  - type: state-label
    entity: binary_sensor.<nametesla>_doors
    attribute: Passenger Front
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 35%
      left: 80%
      color: black
  - type: state-label
    entity: cover.<nametesla>_frunk
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 13%
      left: 48%
      color: black
  - type: state-label
    entity: cover.<nametesla>_trunk
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 63%
      left: 48%
      color: white
  - type: conditional
    conditions:
      - entity: cover.<nametesla>_charger_door
        state: open
    elements:
      - type: icon
        icon: mdi:ev-plug-tesla
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 62%
          left: 18%
          color: '#039be5'
  - type: conditional
    conditions:
      - entity: cover.<nametesla>_charger_door
        state_not: open
    elements:
      - type: icon
        icon: mdi:ev-plug-tesla
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 68%
          left: 22%
          color: black
  - type: state-label
    entity: binary_sensor.<nametesla>_charger
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 70%
      left: 22%
      font-size: 100%
      font-weight: normal
      color: black
  - type: state-label
    entity: sensor.<nametesla>_temperature_inside
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 42%
      left: 50%
      font-size: 100%
      font-weight: normal
      color: rgb(255,255,255)
  - type: icon
    icon: mdi:thermometer
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 42%
      left: 41%
      font-size: 100%
      font-weight: normal
      color: rgb(255,255,255)
  - type: state-label
    entity: sensor.<nametesla>_temperature_outside
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 17%
      left: 52%
      font-size: 100%
      font-weight: normal
      color: rgb(0,0,0)
  - type: icon
    icon: mdi:thermometer
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 17%
      left: 44%
      font-size: 100%
      font-weight: normal
      color: rgb(0,0,0)
  - type: conditional
    conditions:
      - entity: binary_sensor.<nametesla>_ischarging
        state: 'on'
      - entity: device_tracker.<nametesla>_location_tracker
        state: not_home
    elements:
      - type: icon
        icon: mdi:home-lightning-bolt-outline
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 56.5%
          left: 8%
          color: green
  - type: conditional
    conditions:
      - entity: binary_sensor.<nametesla>_ischarging
        state_not: 'on'
      - entity: device_tracker.<nametesla>_location_tracker
        state: not_home
    elements:
      - type: icon
        icon: mdi:ev-station
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 56.5%
          left: 8%
          color: green
  - type: custom:bar-card
    entity: sensor.<nametesla>_battery
    severity:
      - color: Red
        from: 0
        to: 10
      - color: Orange
        from: 11
        to: 20
      - color: LightGreen
        from: 21
        to: 100
    entity_row: true
    positions:
      icon: 'off'
      name: 'off'
      indicator: 'off'
    animation:
      state: 'on'
      speed: 5
    width: 35px
    height: 115px
    direction: up
    tap_action: none
    hold_action: none
    double_tap_action: none
    stack: vertical
    style:
      top: 64.6%
      left: 8%
      font-size: 90%
      font-weight: bold
      color: rgb(0,0,0)
  - type: conditional
    conditions:
      - entity: binary_sensor.<nametesla>_charger
        state: 'on'
    elements:
      - type: state-label
        entity: sensor.<nametesla>_charging_rate
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 65.5%
          left: 20%
          font-size: 80%
          font-weight: bold
          color: black
  - type: custom:mini-gauge-card
    min: 0
    max: 250
    measurement: ' km/h'
    decimals: 0
    entity: sensor.tesla_speed
    friendly_name: vitesse
    unit: km/h
    theme: Graphite
    severity:
      green: 0
      yellow: 90
      red: 130
    style:
      top: 67%
      left: 83%
    scale: 1.5

Pour le sensor tesla_speed, ajout du sensor

    tesla_speed:
      friendly_name: 'vitesse'
      unit_of_measurement: 'km/h'
      value_template: "{{ state_attr('device_tracker.<nametesla>_location_tracker', 'speed') * 1.60934  | float(0) }}"

le *1.60934, c’est pacre que la vitesse arrive en miles/h :slight_smile:

scene.yaml:

  name: Activation_clim
  entities:
    climate.<nametesla>_hvac_climate_system:
      hvac_modes:
      - heat_cool
      - 'off'
      preset_modes:
      - Normal
      - Defrost
      - Keep On
      - Dog Mode
      - Camp Mode
      preset_mode: Normal
      attribution: Data provided by Tesla
      friendly_name: <nametesla> Hvac (climate) system
      icon: mdi:air-filter
      state: heat_cool
  icon: mdi:air-filter
  metadata: {}
- id: '1685086068783'
  name: Arret_clim
  entities:
    climate.<nametesla>_hvac_climate_system:
      hvac_modes:
      - heat_cool
      - 'off'
      preset_modes:
      - Normal
      - Defrost
      - Keep On
      - Dog Mode
      - Camp Mode
      attribution: Data provided by Tesla
      friendly_name: <nametesla> Hvac (climate) system
      icon: mdi:air-filter
      state: 'off'
  icon: mdi:air-filter
  metadata: {}
- id: '1685086183030'
  name: Dog mode
  entities:
    climate.<nametesla>_hvac_climate_system:
      hvac_modes:
      - heat_cool
      - 'off'
      preset_modes:
      - Normal
      - Defrost
      - Keep On
      - Dog Mode
      - Camp Mode
      preset_mode: Dog Mode
      attribution: Data provided by Tesla
      friendly_name: <nametesla> Hvac (climate) system
      icon: mdi:dog
      state: heat_cool
  icon: mdi:dog
  metadata: {}
- id: '1685135349320'
  name: Mode_sentinelle_on
  entities:
    lock.<nametesla>_doors:
      attribution: Data provided by Tesla
      friendly_name: <nametesla> Doors
      supported_features: 0
      state: locked
    lock.<nametesla>_charge_port_latch:
      attribution: Data provided by Tesla
      icon: mdi:ev-plug-tesla
      friendly_name: <nametesla> Charge port latch
      supported_features: 1
      state: locked
    cover.<nametesla>_frunk:
      attribution: Data provided by Tesla
      device_class: door
      icon: mdi:car
      friendly_name: <nametesla> Frunk
      supported_features: 1
      state: closed
    cover.<nametesla>_trunk:
      attribution: Data provided by Tesla
      device_class: door
      icon: mdi:car-back
      friendly_name: <nametesla> Trunk
      supported_features: 1
      state: closed
    cover.<nametesla>_windows:
      attribution: Data provided by Tesla
      device_class: awning
      icon: mdi:car-door
      friendly_name: <nametesla> Windows
      supported_features: 3
      state: closed
    switch.<nametesla>_sentry_mode:
      attribution: Data provided by Tesla
      icon: mdi:shield-car
      friendly_name: <nametesla> Sentry mode
      state: 'on'
    select.<nametesla>_heated_seat_left:
      state: 'Off'
    select.<nametesla>_heated_seat_right:
      state: 'Off'
    select.<nametesla>_heated_seat_rear_left:
      state: 'Off'
    select.<nametesla>_heated_seat_rear_center:
      state: 'Off'
    select.<nametesla>_heated_seat_rear_right:
      state: 'Off'
  icon: mdi:circle-slice-8
  metadata: {}
- id: '1685135555279'
  name: Mode_sentinelle_off
  entities:
    switch.<nametesla>_sentry_mode:
      state: 'off'
  icon: mdi:circle-slice-8
  metadata: {}
- id: '1685179411379'
  name: Defrost mode
  entities:
    climate.<nametesla>_hvac_climate_system:
      hvac_modes:
      - heat_cool
      - 'off'
      preset_modes:
      - Normal
      - Defrost
      - Keep On
      - Dog Mode
      - Camp Mode
      preset_mode: Defrost
      attribution: Data provided by Tesla
      friendly_name: <nametesla> Hvac (climate) system
      icon: mdi:car-defrost-front
      state: heat_cool
  icon: mdi:car-defrost-front
  metadata: {}
- id: '1685202049813'
  name: Camp mode
  entities:
    climate.<nametesla>_hvac_climate_system:
      hvac_modes:
      - heat_cool
      - 'off'
      preset_modes:
      - Normal
      - Defrost
      - Keep On
      - Dog Mode
      - Camp Mode
      preset_mode: Camp Mode
      attribution: Data provided by Tesla
      icon: mdi:tent
      friendly_name: <nametesla> Hvac (climate) system
      supported_features: 17
      state: none
  icon: mdi:tent
  metadata: {}
2 « J'aime »