Hi all,
Can anyone help a newbie with some code on a custom card. Trying to show the status of my Tesla, dependent upon what remaining range it has, and whether the charger is connected or not. Not got any error messages, but it simply does not appear to work. Basically want the icon in the card to change colour, and potentially spin and/or blink depending upon the charge level and state of being connected or now. I think I am using the correct sensors, but could be wrong (tried with “entity” and “entity_id”) ! Code is as follows:
entity: binary_sensor.mike_s_tesla_charger_sensor
icon: 'mdi:car-electric'
show_state: true
spin: false
state:
- above: 150
colour: green
condition: numeric_state
entity_id: sensor.mike_s_tesla_range_sensor
value: disconnected
- above: 100
colour: green
condition: numeric_state
entity_id: sensor.mike_s_tesla_range_sensor
styles:
card:
- animation: blink 2s ease infinite
value: connected
- above: 100
below: 150
colour: yellow
condition: numeric_state
entity_id: sensor.mike_s_tesla_range_sensor
value: disconnected
- below: 100
colour: red
condition: numeric_state
entity_id: sensor.mike_s_tesla_range_sensor
icon: 'mdi:ev-station'
spin: true
value: connected
- below: 100
colour: red
condition: numeric_state
entity_id: sensor.mike_s_tesla_range_sensor
spin: true
styles:
card:
- animation: blink 2s ease infinite
value: disconnected
type: 'custom:button-card'