Picture Elements card - aka MercedesMe clone
Hi,
After some tinkering (and help from Rene for the individual window opening/closing), I’m done for now with my picture elements card for a Mercedes EQS using Rene’s integration.
Clear inspiration was from the MercedesMe app, as you can readily see.
The stand-in for the card is a Mercedes EQS, which can open and close individual windows. Adjust for you car’s capabilities.
Requirements
In order to drive the picture elements, we have to define some custom sensors (basically extracting some attributes, and combining sensors).
It will make sense later on.
Images
The baseline image, as well as the individual states you can get directly from Mercedes using the steps outlined by Rene some time ago:
https://community.home-assistant.io/t/mercedes-me-component/41911/597
EDIT: Things changed on Rene’s and Mercedes’ end, use the new service call mbapi2020.download_images
from version v0.14.0-beta.1 or later.
This picture set comprises of the base image of your car type, and individual “warning” (red) sub images for states that need attention: Open or unlocked doors, open windows or trunk, tyre etc. Same as the overview image in your MercedesMe app.
The windows icon are screengrabs (reduced in size) from the (iOS) MercedesMe App, with the “vent” icon desatured (to be used as the “moving” image). Again, this will make sense later one.
The filename of these are (download them below):
window_right_open.png
window_right_vent.png
window_right_closed.png
, and
window_right_moving.png
.
The same for the left windows (window_left_*.png
)
I put all images in the www/eqs/
folder in HA.
Sensors
Please substitute your own sensor name, the XXX is just a placeholder for the name of your car. Also, put everything under the sensor:
tag.
Lets start with the definition of the door. These are: Locked
(no warning sub-image), Unlocked
, and Open
. These are all in the lock
sensor.
# Codes for open/unlocked/venting of doors and sunroof (sensor.XXX_lock):
# doorlockstatus*: true: unlocked, false: locked
# doorstatus*: true: open, false: closed
# sunroofstatus: 0: closed, 1: open, 2: vent, 7: opening, 8: closing, 11: open vent, 12: closing vent
# Codes for open/venting of windows (binary_sensor.XXX_windows_closed):
# windowstatus*: 1: open, 2: closed, 4: vent, 5: moving
- platform: template
sensors:
eqs_door_frontleft:
friendly_name: "Front Left Door"
icon_template: >
{% if not state_attr('sensor.XXX_lock', 'doorlockstatusfrontleft') %} {# door locked #}
mdi:car-door-lock
{% else %} {# door unlocked #}
mdi:car-door-lock-open
{% endif %}
value_template: >
{% set door = "frontleft" %}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+door) %} {# door closed #}
{% if not state_attr('sensor.XXX_lock', 'doorlockstatus'+door) %} {# door locked #}
Locked
{% else %} {# door unlocked #}
Unlocked
{% endif %}
{% else %} {# door open #}
Open
{% endif %}
eqs_door_frontright:
friendly_name: "Front Right Door"
icon_template: >
{% if not state_attr('sensor.XXX_lock', 'doorlockstatusfrontright') %} {# door locked #}
mdi:car-door-lock
{% else %} {# door unlocked #}
mdi:car-door-lock-open
{% endif %}
value_template: >
{% set door = "frontright" %}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+door) %} {# door closed #}
{% if not state_attr('sensor.XXX_lock', 'doorlockstatus'+door) %} {# door locked #}
Locked
{% else %} {# door unlocked #}
Unlocked
{% endif %}
{% else %} {# door open #}
Open
{% endif %}
eqs_door_rearleft:
friendly_name: "Rear Left Door"
icon_template: >
{% if not state_attr('sensor.XXX_lock', 'doorlockstatusrearleft') %} {# door locked #}
mdi:car-door-lock
{% else %} {# door unlocked #}
mdi:car-door-lock-open
{% endif %}
value_template: >
{% set door = "rearleft" %}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+door) %} {# door closed #}
{% if not state_attr('sensor.XXX_lock', 'doorlockstatus'+door) %} {# door locked #}
Locked
{% else %} {# door unlocked #}
Unlocked
{% endif %}
{% else %} {# door open #}
Open
{% endif %}
eqs_door_rearright:
friendly_name: "Rear Right Door"
icon_template: >
{% if not state_attr('sensor.XXX_lock', 'doorlockstatusrearright') %} {# door locked #}
mdi:car-door-lock
{% else %} {# door unlocked #}
mdi:car-door-lock-open
{% endif %}
value_template: >
{% set door = "rearright" %}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+door) %} {# door closed #}
{% if not state_attr('sensor.XXX_lock', 'doorlockstatus'+door) %} {# door locked #}
Locked
{% else %} {# door unlocked #}
Unlocked
{% endif %}
{% else %} {# door open #}
Open
{% endif %}
Next we look into the states of the windows. These can be: Closed
, Open
, Vent
, or Moving
:
eqs_window_frontleft:
friendly_name: "Front Left Window"
icon_template: mdi:car-door
value_template: >
{% set window = "frontleft" %}
{% if is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "2") %} {# window closed #}
Closed
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "4") %} {# window vent #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
VentDC
{% else %} {# door open #}
VentDO
{% endif %}
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "1") %} {# window open #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
OpenDC
{% else %} {# door open #}
OpenDO
{% endif %}
{% else %} {# window moving #}
Moving
{% endif %}
eqs_window_frontright:
friendly_name: "Front Right Window"
icon_template: mdi:car-door
value_template: >
{% set window = "frontright" %}
{% if is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "2") %} {# window closed #}
Closed
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "4") %} {# window vent #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
VentDC
{% else %} {# door open #}
VentDO
{% endif %}
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "1") %} {# window open #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
OpenDC
{% else %} {# door open #}
OpenDO
{% endif %}
{% else %} {# window moving #}
Moving
{% endif %}
eqs_window_rearleft:
friendly_name: "Rear Left Window"
icon_template: mdi:car-door
value_template: >
{% set window = "rearleft" %}
{% if is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "2") %} {# window closed #}
Closed
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "4") %} {# window vent #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
VentDC
{% else %} {# door open #}
VentDO
{% endif %}
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "1") %} {# window open #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
OpenDC
{% else %} {# door open #}
OpenDO
{% endif %}
{% else %} {# window moving #}
Moving
{% endif %}
eqs_window_rearright:
friendly_name: "Rear Right Window"
icon_template: mdi:car-door
value_template: >
{% set window = "rearright" %}
{% if is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "2") %} {# window closed #}
Closed
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "4") %} {# window vent #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
VentDC
{% else %} {# door open #}
VentDO
{% endif %}
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "1") %} {# window open #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
OpenDC
{% else %} {# door open #}
OpenDO
{% endif %}
{% else %} {# window moving #}
Moving
{% endif %}
And last, we have to integrate the sunroof, and the trunk. The image set has a warning image of an opened hood, but my EQS does not report the hood status, so thats not used. Maybe your car is different?
eqs_sunroof:
friendly_name: "Sunroof"
icon_template: mdi:car-door
value_template: >
{% if is_state_attr('sensor.XXX_lock', 'sunroofstatus', "2") %}
vent
{% elif is_state_attr('sensor.XXX_lock', 'sunroofstatus', "1") %}
open
{% elif is_state_attr('sensor.XXX_lock', 'sunroofstatus', "0") %}
closed
{% else %}
moving
{% endif %}
eqs_trunk:
friendly_name: "Trunk"
icon_template: mdi:car-door
value_template: >
{% if state_attr('sensor.XXX_lock', 'doorlockstatusdecklid') %}
unlocked
{% elif state_attr('sensor.XXX_lock', 'decklidstatus') %}
open
{% else %}
closed
{% endif %}
Now all thats missing is the tyre warning, these are straight foreward, albeit I did have to guess, as I didn’t have a tyre warning in my car yet.
eqs_tire_image_frontleft:
friendly_name: "Tire Warning Front Left"
icon_template: mdi:car-tire-alert
value_template: >
{% if is_state_attr('binary_sensor.XXX_tire_warning', 'tireMarkerFrontLeft', "0") %}
OK
{% else %}
Warning
{% endif %}
eqs_tire_image_frontright:
friendly_name: "Tire Warning Front Right"
icon_template: mdi:car-tire-alert
value_template: >
{% if is_state_attr('binary_sensor.XXX_tire_warning', 'tireMarkerFrontRight', "0") %}
OK
{% else %}
Warning
{% endif %}
eqs_tire_image_rearleft:
friendly_name: "Tire Warning Rear Left"
icon_template: mdi:car-tire-alert
value_template: >
{% if is_state_attr('binary_sensor.XXX_tire_warning', 'tireMarkerRearLeft', "0") %}
OK
{% else %}
Warning
{% endif %}
eqs_tire_image_rearright:
friendly_name: "Tire Warning Rear Right"
icon_template: mdi:car-tire-alert
value_template: >
{% if is_state_attr('binary_sensor.XXX_tire_warning', 'tireMarkerRearRight', "0") %}
OK
{% else %}
Warning
{% endif %}
Picture Element card
Now to the meat of the whole excercise: The Picture Element card that ties it all together.
As you can see I implemented window control on the window icons. Feel free to change those if your car does not offer them. Replace the VIN number to the one of your car in the service calls.
Also replace all the 297100
in the filenames to your filenames of the downloaded zip from earlier.
type: picture-elements
image: local/eqs/297100_car.png
transform: translate(-50%, -50%)
elements:
- type: image
entity: sensor.eqs_door_frontleft
state_image:
Open: local/eqs/297100_door_frontleft_open.png
Unlocked: local/eqs/297100_door_frontleft_unlock.png
Locked: null
style:
top: 0%
left: 0%
transform: translate(0, 0)
tap_action:
action: none
- type: image
entity: sensor.eqs_window_frontleft
state_image:
OpenDC: local/eqs/297100_window_frontleft_opendoorclosed.png
OpenDO: local/eqs/297100_window_frontleft_opendooropened.png
VentDC: local/eqs/297100_window_frontleft_ventilatedoorclosed.png
VentDO: local/eqs/297100_window_frontleft_ventilatedooropened.png
Closed: null
Moving: null
style:
top: 0%
left: 0%
transform: translate(0, 0)
tap_action:
action: none
- type: image
entity: sensor.eqs_door_frontright
state_image:
Open: local/eqs/297100_door_frontright_open.png
Unlocked: local/eqs/297100_door_frontright_unlock.png
Locked: null
style:
top: 0%
left: 0%
transform: none
- type: image
entity: sensor.eqs_window_frontright
state_image:
OpenDC: local/eqs/297100_window_frontright_opendoorclosed.png
OpenDO: local/eqs/297100_window_frontright_opendooropened.png
VentDC: local/eqs/297100_window_frontright_ventilatedoorclosed.png
VentDO: local/eqs/297100_window_frontright_ventilatedooropened.png
Closed: null
Moving: null
style:
top: 0%
left: 0%
transform: translate(0, 0)
tap_action:
action: none
- type: image
entity: sensor.eqs_door_rearleft
state_image:
Open: local/eqs/297100_door_rearleft_open.png
Unlocked: local/eqs/297100_door_rearleft_unlock.png
Locked: null
style:
top: 0%
left: 0%
transform: none
- type: image
entity: sensor.eqs_window_rearleft
state_image:
OpenDC: local/eqs/297100_window_rearleft_opendoorclosed.png
OpenDO: local/eqs/297100_window_rearleft_opendooropened.png
VentDC: local/eqs/297100_window_rearleft_ventilatedoorclosed.png
VentDO: local/eqs/297100_window_rearleft_ventilatedooropened.png
Closed: null
Moving: null
style:
top: 0%
left: 0%
transform: translate(0, 0)
tap_action:
action: none
- type: image
entity: sensor.eqs_door_rearright
state_image:
Open: local/eqs/297100_door_rearright_open.png
Unlocked: local/eqs/297100_door_rearright_unlock.png
Locked: null
style:
top: 0%
left: 0%
transform: none
- type: image
entity: sensor.eqs_window_rearright
state_image:
OpenDC: local/eqs/297100_window_rearright_opendoorclosed.png
OpenDO: local/eqs/297100_window_rearright_opendooropened.png
VentDC: local/eqs/297100_window_rearright_ventilatedoorclosed.png
VentDO: local/eqs/297100_window_rearright_ventilatedooropened.png
Closed: null
Moving: null
style:
top: 0%
left: 0%
transform: translate(0, 0)
tap_action:
action: none
- type: image
entity: sensor.eqs_sunroof
state_image:
open: local/eqs/297100_sunroof_open.png
vent: local/eqs/297100_sunroof_ventilate.png
closed: null
moving: local/eqs/297100_sunroof_open.png
style:
top: 0%
left: 0%
transform: none
- type: image
entity: sensor.eqs_trunk
state_image:
open: local/eqs/297100_trunk_open.png
unlocked: local/eqs/297100_trunk_unlock.png
closed: null
style:
top: 0%
left: 0%
transform: none
- type: image
entity: sensor.eqs_window_frontleft
title: Front Left
state_image:
OpenDC: local/eqs/window_left_open.png
OpenDO: local/eqs/window_left_open.png
VentDC: local/eqs/window_left_vent.png
VentDO: local/eqs/window_left_vent.png
Closed: local/eqs/window_left_closed.png
Moving: local/eqs/window_left_moving.png
style:
top: 43%
left: 23%
transform: translate(-50%,-50%)
tap_action:
action: call-service
service: mbapi2020.windows_move
data:
vin: W1KXXXXXXXXXXXXXX
front_left: '0'
hold_action:
action: call-service
service: mbapi2020.windows_move
data:
vin: W1KXXXXXXXXXXXXXX
front_left: '10'
double_tap_action:
action: call-service
service: mbapi2020.windows_move
data:
vin: W1KXXXXXXXXXXXXXX
front_left: '100'
- type: image
entity: sensor.eqs_window_frontright
title: Front Right
state_image:
OpenDC: local/eqs/window_right_open.png
OpenDO: local/eqs/window_right_open.png
VentDC: local/eqs/window_right_vent.png
VentDO: local/eqs/window_right_vent.png
Closed: local/eqs/window_right_closed.png
Moving: local/eqs/window_right_moving.png
style:
top: 43%
left: 77%
transform: translate(-50%,-50%)
tap_action:
action: call-service
service: mbapi2020.windows_move
data:
vin: W1KXXXXXXXXXXXXXX
front_right: '0'
hold_action:
action: call-service
service: mbapi2020.windows_move
data:
vin: W1KXXXXXXXXXXXXXX
front_right: '10'
double_tap_action:
action: call-service
service: mbapi2020.windows_move
data:
vin: W1KXXXXXXXXXXXXXX
front_right: '100'
- type: image
entity: sensor.eqs_window_rearleft
title: Rear Left
state_image:
OpenDC: local/eqs/window_left_open.png
OpenDO: local/eqs/window_left_open.png
VentDC: local/eqs/window_left_vent.png
VentDO: local/eqs/window_left_vent.png
Closed: local/eqs/window_left_closed.png
Moving: local/eqs/window_left_moving.png
style:
top: 61%
left: 23%
transform: translate(-50%,-50%)
tap_action:
action: call-service
service: mbapi2020.windows_move
data:
vin: W1KXXXXXXXXXXXXXX
rear_left: '0'
hold_action:
action: call-service
service: mbapi2020.windows_move
data:
vin: W1KXXXXXXXXXXXXXX
rear_left: '10'
double_tap_action:
action: call-service
service: mbapi2020.windows_move
data:
vin: W1KXXXXXXXXXXXXXX
rear_left: '100'
- type: image
entity: sensor.eqs_window_rearright
title: Rear Right
state_image:
OpenDC: local/eqs/window_right_open.png
OpenDO: local/eqs/window_right_open.png
VentDC: local/eqs/window_right_vent.png
VentDO: local/eqs/window_right_vent.png
Closed: local/eqs/window_right_closed.png
Moving: local/eqs/window_right_moving.png
style:
top: 61%
left: 77%
transform: translate(-50%,-50%)
tap_action:
action: call-service
service: mbapi2020.windows_move
data:
vin: W1KXXXXXXXXXXXXXX
rear_right: '0'
hold_action:
action: call-service
service: mbapi2020.windows_move
data:
vin: W1KXXXXXXXXXXXXXX
rear_right: '10'
double_tap_action:
action: call-service
service: mbapi2020.windows_move
data:
vin: W1KXXXXXXXXXXXXXX
rear_right: '100'
- type: state-label
entity: sensor.XXX_tire_pressure_front_left
title: Front Left
style:
top: 23%
left: 33%
transform: translate(-100%,-50%)
- type: image
entity: sensor.eqs_tire_image_frontleft
state_image:
Warning: local/eqs/297100_tire_frontleft.png
OK: null
title: null
style:
top: 0%
left: 0%
transform: translate(0, 0)
tap_action:
action: none
- type: state-label
entity: sensor.XXX_tire_pressure_front_right
title: Front Right
style:
top: 23%
left: 66.5%
transform: translate(0%,-50%)
- type: image
entity: sensor.eqs_tire_image_frontright
state_image:
Warning: local/eqs/297100_tire_frontright.png
OK: null
title: null
style:
top: 0%
left: 0%
transform: translate(0, 0)
tap_action:
action: none
- type: state-label
entity: sensor.XXX_tire_pressure_rear_left
title: Rear Left
style:
top: 74%
left: 33%
transform: translate(-100%,-50%)
- type: image
entity: sensor.eqs_tire_image_rearleft
state_image:
Warning: local/eqs/297100_tire_rearleft.png
OK: null
title: null
style:
top: 0%
left: 0%
transform: translate(0, 0)
tap_action:
action: none
- type: state-label
entity: sensor.XXX_tire_pressure_rear_right
title: Rear Right
style:
top: 74%
left: 66.5%
transform: translate(0%,-50%)
- type: image
entity: sensor.eqs_tire_image_rearright
state_image:
Warning: local/eqs/297100_tire_rearright.png
OK: null
title: null
style:
top: 0%
left: 0%
transform: translate(0, 0)
tap_action:
action: none
Thats it. It may have a few bugs and inconsistentcies, nothing severe that I have noticed.
Huge Thanks to Rene for providing the windows_move
service call on my request.
Thanks,
Thomas
PS
I have also a sideview version, I can elaborate if there is interest.
EDIT: See below for the sideways version.
PPS
Here is the whole sensor:
thing in one big chunk:
# Codes for open/unlocked/venting of doors and sunroof (sensor.XXX_lock):
# doorlockstatus*: true: unlocked, false: locked
# doorstatus*: true: open, false: closed
# sunroofstatus: 0: closed, 1: open, 2: vent, 7: opening, 8: closing, 11: open vent, 12: closing vent
# Codes for open/venting of windows (binary_sensor.XXX_windows_closed):
# windowstatus*: 1: open, 2: closed, 4: vent, 5: moving
- platform: template
sensors:
eqs_door_frontleft:
friendly_name: "Front Left Door"
icon_template: >
{% if not state_attr('sensor.XXX_lock', 'doorlockstatusfrontleft') %} {# door locked #}
mdi:car-door-lock
{% else %} {# door unlocked #}
mdi:car-door-lock-open
{% endif %}
value_template: >
{% set door = "frontleft" %}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+door) %} {# door closed #}
{% if not state_attr('sensor.XXX_lock', 'doorlockstatus'+door) %} {# door locked #}
Locked
{% else %} {# door unlocked #}
Unlocked
{% endif %}
{% else %} {# door open #}
Open
{% endif %}
eqs_door_frontright:
friendly_name: "Front Right Door"
icon_template: >
{% if not state_attr('sensor.XXX_lock', 'doorlockstatusfrontright') %} {# door locked #}
mdi:car-door-lock
{% else %} {# door unlocked #}
mdi:car-door-lock-open
{% endif %}
value_template: >
{% set door = "frontright" %}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+door) %} {# door closed #}
{% if not state_attr('sensor.XXX_lock', 'doorlockstatus'+door) %} {# door locked #}
Locked
{% else %} {# door unlocked #}
Unlocked
{% endif %}
{% else %} {# door open #}
Open
{% endif %}
eqs_door_rearleft:
friendly_name: "Rear Left Door"
icon_template: >
{% if not state_attr('sensor.XXX_lock', 'doorlockstatusrearleft') %} {# door locked #}
mdi:car-door-lock
{% else %} {# door unlocked #}
mdi:car-door-lock-open
{% endif %}
value_template: >
{% set door = "rearleft" %}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+door) %} {# door closed #}
{% if not state_attr('sensor.XXX_lock', 'doorlockstatus'+door) %} {# door locked #}
Locked
{% else %} {# door unlocked #}
Unlocked
{% endif %}
{% else %} {# door open #}
Open
{% endif %}
eqs_door_rearright:
friendly_name: "Rear Right Door"
icon_template: >
{% if not state_attr('sensor.XXX_lock', 'doorlockstatusrearright') %} {# door locked #}
mdi:car-door-lock
{% else %} {# door unlocked #}
mdi:car-door-lock-open
{% endif %}
value_template: >
{% set door = "rearright" %}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+door) %} {# door closed #}
{% if not state_attr('sensor.XXX_lock', 'doorlockstatus'+door) %} {# door locked #}
Locked
{% else %} {# door unlocked #}
Unlocked
{% endif %}
{% else %} {# door open #}
Open
{% endif %}
eqs_window_frontleft:
friendly_name: "Front Left Window"
icon_template: mdi:car-door
value_template: >
{% set window = "frontleft" %}
{% if is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "2") %} {# window closed #}
Closed
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "4") %} {# window vent #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
VentDC
{% else %} {# door open #}
VentDO
{% endif %}
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "1") %} {# window open #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
OpenDC
{% else %} {# door open #}
OpenDO
{% endif %}
{% else %} {# window moving #}
Moving
{% endif %}
eqs_window_frontright:
friendly_name: "Front Right Window"
icon_template: mdi:car-door
value_template: >
{% set window = "frontright" %}
{% if is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "2") %} {# window closed #}
Closed
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "4") %} {# window vent #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
VentDC
{% else %} {# door open #}
VentDO
{% endif %}
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "1") %} {# window open #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
OpenDC
{% else %} {# door open #}
OpenDO
{% endif %}
{% else %} {# window moving #}
Moving
{% endif %}
eqs_window_rearleft:
friendly_name: "Rear Left Window"
icon_template: mdi:car-door
value_template: >
{% set window = "rearleft" %}
{% if is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "2") %} {# window closed #}
Closed
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "4") %} {# window vent #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
VentDC
{% else %} {# door open #}
VentDO
{% endif %}
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "1") %} {# window open #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
OpenDC
{% else %} {# door open #}
OpenDO
{% endif %}
{% else %} {# window moving #}
Moving
{% endif %}
eqs_window_rearright:
friendly_name: "Rear Right Window"
icon_template: mdi:car-door
value_template: >
{% set window = "rearright" %}
{% if is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "2") %} {# window closed #}
Closed
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "4") %} {# window vent #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
VentDC
{% else %} {# door open #}
VentDO
{% endif %}
{% elif is_state_attr('binary_sensor.XXX_windows_closed', 'windowstatus'+window, "1") %} {# window open #}
{% if not state_attr('sensor.XXX_lock', 'doorstatus'+window) %} {# door closed #}
OpenDC
{% else %} {# door open #}
OpenDO
{% endif %}
{% else %} {# window moving #}
Moving
{% endif %}
eqs_sunroof:
friendly_name: "Sunroof"
icon_template: mdi:car-door
value_template: >
{% if is_state_attr('sensor.XXX_lock', 'sunroofstatus', "2") %}
vent
{% elif is_state_attr('sensor.XXX_lock', 'sunroofstatus', "1") %}
open
{% elif is_state_attr('sensor.XXX_lock', 'sunroofstatus', "0") %}
closed
{% else %}
moving
{% endif %}
eqs_trunk:
friendly_name: "Trunk"
icon_template: mdi:car-door
value_template: >
{% if state_attr('sensor.XXX_lock', 'doorlockstatusdecklid') %}
unlocked
{% elif state_attr('sensor.XXX_lock', 'decklidstatus') %}
open
{% else %}
closed
{% endif %}
eqs_tire_image_frontleft:
friendly_name: "Tire Warning Front Left"
icon_template: mdi:car-tire-alert
value_template: >
{% if is_state_attr('binary_sensor.XXX_tire_warning', 'tireMarkerFrontLeft', "0") %}
OK
{% else %}
Warning
{% endif %}
eqs_tire_image_frontright:
friendly_name: "Tire Warning Front Right"
icon_template: mdi:car-tire-alert
value_template: >
{% if is_state_attr('binary_sensor.XXX_tire_warning', 'tireMarkerFrontRight', "0") %}
OK
{% else %}
Warning
{% endif %}
eqs_tire_image_rearleft:
friendly_name: "Tire Warning Rear Left"
icon_template: mdi:car-tire-alert
value_template: >
{% if is_state_attr('binary_sensor.XXX_tire_warning', 'tireMarkerRearLeft', "0") %}
OK
{% else %}
Warning
{% endif %}
eqs_tire_image_rearright:
friendly_name: "Tire Warning Rear Right"
icon_template: mdi:car-tire-alert
value_template: >
{% if is_state_attr('binary_sensor.XXX_tire_warning', 'tireMarkerRearRight', "0") %}
OK
{% else %}
Warning
{% endif %}