Lightning strikes are scary enough, but add the cost of an EV charging while a lightning strikes and it can cost a fortune.
Again a little automation can help to protect the home and precious EV.
The component used for lightning warning is the Blitzortung component.
Automation:
# Lightning notification
- alias: Lightning notification
id: lightning_notification
mode: single
trigger:
- platform: state
entity_id: sensor.blitzortung_lightning_counter
condition:
- condition: numeric_state
entity_id: sensor.blitzortung_lightning_counter
above: 0
action:
- choose:
# Ligtning warning when car not charging
- conditions:
- condition: or
conditions:
- condition: state
entity_id: sensor.car1_plug_connection_state
state: 'disconnected'
- condition: state
entity_id: sensor.car2_plug_connection_state
state: 'disconnected'
sequence:
- service_template: notify.pushover
data_template:
title: "Warning - lightning detected!"
message: "Lightning has been detected within {{(states('sensor.blitzortung_lightning_distance'))}} kilometers of our home. Be careful if outdoors."
data:
priority: 0
sound: "pianobar"
- service: rest_command.rhasspy_speak
data_template:
payload_data: "Lightning has been detected within {{(states('sensor.blitzortung_lightning_distance'))}} kilometers of our home."
- choose:
# Ligtning warning when car charging and tv off
- conditions:
- condition: and
conditions:
- condition: state
entity_id: remote.living_room_hub
state: 'off'
- condition: or
conditions:
- condition: state
entity_id: sensor.car1_plug_connection_state
state: 'connected'
- condition: state
entity_id: sensor.car2_plug_connection_state
state: 'connected'
sequence:
- service_template: notify.pushover
data_template:
title: "Warning - lightning detected!"
message: "Lightning has been detected within {{(states('sensor.blitzortung_lightning_distance'))}} kilometers of our home. Disconnect car from charging!"
data:
priority: 0
sound: "pianobar"
- service: rest_command.rhasspy_speak
data_template:
payload_data: "Lightning has been detected within {{(states('sensor.blitzortung_lightning_distance'))}} kilometers of our home. Disconnect car from charging!"
# Ligtning warning when car charging and tv on
- conditions:
- condition: and
conditions:
- condition: state
entity_id: remote.living_room_hub
state: 'on'
- condition: or
conditions:
- condition: state
entity_id: sensor.car1_plug_connection_state
state: 'connected'
- condition: state
entity_id: sensor.car2_plug_connection_state
state: 'connected'
sequence:
- service: notify.living_room_media_center
data_template:
title: "Warning - lightning detected!"
message: "Lightning has been detected within {{(states('sensor.blitzortung_lightning_distance'))}} kilometers of our home. Disconnect car from charging!"
data:
duration: 15
font-size: max
transparency: 50%
position: bottom-right
- service_template: notify.pushover
data_template:
title: "Warning - lightning detected!"
message: "Lightning has been detected within {{(states('sensor.blitzortung_lightning_distance'))}} kilometers of our home. Disconnect car from charging!"
data:
priority: 0
sound: "pianobar"
- service: rest_command.rhasspy_speak
data_template:
payload_data: "Lightning has been detected within {{(states('sensor.blitzortung_lightning_distance'))}} kilometers of our home. Disconnect car from charging!"