Well, I’ve been busy too, the battery icon fix was the same as yours however mine was sensor.leaf_charge
but now I’ve changed it to match your better suggestion.
I’ve also sorted out the other items you wanted doing, so here it is
- platform: template
sensors:
leaf_state:
value_template: "Charging: {{ states('binary_sensor.MYNISSANLEAF_charging_status') }}"
leaf_range_ac:
value_template: "A/C Milage: {{ states('sensor.MYNISSANLEAF_range_ac') }}"
leaf_range:
value_template: "Milage: {{ states('sensor.MYNISSANLEAF_range') }}"
leaf_battery:
value_template: "{{ states('sensor.MYNISSANLEAF_charge') }}"
icon_template: "{%- if states.sensor.MYNISSANLEAF_charge.state >= '95' %}mdi:battery{%- elif states.sensor.MYNISSANLEAF_charge.state == '100' %}mdi:battery{%- elif states.sensor.MYNISSANLEAF_charge.state <= '15' %}mdi:battery-outline{% else %}mdi:battery-{{(states.sensor.MYNISSANLEAF_charge.state|float / 10)|round*10}}{%- endif %}"
unit_of_measurement: '%'
- type: picture-elements
image: /local/pics/leaf.png
elements:
# Title and Program
- type: state-label
entity: sensor.leaf_state
style:
left: 0
bottom: 0
pointer-events: none
font-size: 16px
line-height: 32px
color: white
background-color: rgba(0, 0, 0, 0.3)
width: 100%
transform: initial
padding: 0 8px
# A/C Control
- type: state-icon
entity: switch.MYNISSANLEAF_climate_control
tap_action:
action: toggle
confirmation:
text: Are you sure you want to Start the car?
style:
bottom: 0
right: 0
transform: initial
color: white
line-height: 32px
padding: 8px
margin: 0 0px 0 0
# Change color of state-icon off
--paper-item-icon-color: rgb(25,25,25)
# Plug Status
- type: state-icon
entity: binary_sensor.MYNISSANLEAF_plug_status
style:
top: 0
left: 0
transform: scale(0.8)
color: rgba(255,25,25,1)
line-height: 32px
padding: 8px
margin: 0px 0px
# Change color of state-icon off
--paper-item-icon-color: rgb(25,25,25)
# Start Charge
- type: state-icon
entity: binary_sensor.MYNISSANLEAF_charging_status
tap_action:
action: call-service
service: script.leaf_charge # <== YOUR CHARGE SCRIPT HERE
confirmation:
text: Are you sure you want to Start Charging?
style:
top: 0
left: 0
transform: scale(0.8)
color: rgba(255,25,25,1)
line-height: 32px
padding: 8px
margin: 30px 0px
# Change color of state-icon off
--paper-item-icon-color: rgb(25,25,25)
# Check Status
- type: icon
icon: mdi:car-info
tap_action:
action: call-service
service: script.car_info # <== YOUR CAR INFO SCRIPT HERE
style:
top: 0
left: 0
transform: scale(0.8)
color: rgba(25,25,25,1)
line-height: 32px
padding: 8px
margin: 60px 10px
# Range
- type: state-label
entity: sensor.leaf_range_ac
style:
top: 0
right: 0
pointer-events: none
transform: initial
font-size: 12px
color: rgba(25,25,25,1)
text-shadow: rgba(0, 0, 0, 0.2) 0px 0px 2px
line-height: 32px
margin: 1px 35px 0 0
- type: icon
icon: mdi:speedometer
style:
top: 0
right: 0
pointer-events: none
transform: scale(0.8)
color: rgba(25,25,25,1)
line-height: 32px
margin: 6px 13px 0 0
- type: state-label
entity: sensor.leaf_range
style:
top: 0
right: 0
pointer-events: none
transform: initial
font-size: 12px
color: rgba(25,25,25,1)
text-shadow: rgba(0, 0, 0, 0.2) 0px 0px 2px
line-height: 32px
margin: 30px 35px
- type: icon
icon: mdi:speedometer
style:
top: 0
right: 0
pointer-events: none
transform: scale(0.8)
color: rgba(25,25,25,1)
line-height: 32px
margin: 35px 13px
- type: state-label
# Charge
entity: sensor.MYNISSANLEAF_charge
style:
top: 0
right: 0
pointer-events: none
transform: initial
font-size: 12px
color: rgba(25,25,25,1)
text-shadow: rgba(0, 0, 0, 0.2) 0px 0px 2px
line-height: 32px
margin: 59px 35px
- type: state-icon
entity: sensor.leaf_battery
style:
top: 0
right: 0
pointer-events: none
transform: scale(0.8)
color: rgba(25,25,25,1)
line-height: 32px
margin: 60px 4px 0 0
Edited to correct the placement of the icons on the left hand side.