mysmarthome/packages/tesla.yaml

58 lines
2.0 KiB
YAML
Raw Normal View History

2019-04-17 22:46:06 +00:00
homeassistant:
2020-09-27 01:20:27 +00:00
# customize:
2019-04-17 22:46:06 +00:00
# The scan_interval is now set to 6 hours
2020-02-05 23:28:38 +00:00
# Leaving it to the default (which is 5 minutes, or 300 seconds) will drain battery at a rate of
2019-04-17 22:46:06 +00:00
# 10 miles per day (or 3% battery use) on an average. Use this setting carefully!
tesla:
username: !secret tesla_username
password: !secret tesla_password
scan_interval: 21600
###############################################################################
2020-02-05 23:28:38 +00:00
# _ _ _
# /\ | | | | (_)
# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
2019-04-17 22:46:06 +00:00
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
2020-02-05 23:28:38 +00:00
#
2019-04-17 22:46:06 +00:00
###############################################################################
automation:
- alias: Notify Charging Status
initial_state: true
trigger:
- platform: state
2020-02-05 23:28:38 +00:00
entity_id: binary_sensor.tesla_model_3_charger_sensor
2019-04-17 22:46:06 +00:00
action:
- service: script.notify_me
data_template:
message: "Tesla Car Charge Status changed to: {{ trigger.to_state.state| upper }}"
- alias: Notify Door Status
initial_state: true
trigger:
- platform: state
2020-02-05 23:28:38 +00:00
entity_id: lock.tesla_model_3_door_lock
2019-04-17 22:46:06 +00:00
condition:
- condition: template
value_template: '{{ trigger.from_state.state | lower != "unknown" }}'
action:
- service: script.notify_me
data_template:
message: "Tesla Door is now: {{ trigger.to_state.state | upper }}"
- alias: Notify Charger Switch State
initial_state: true
trigger:
- platform: state
2020-02-05 23:28:38 +00:00
entity_id: switch.tesla_model_3_charger_switch
2019-04-17 22:46:06 +00:00
condition:
- condition: template
value_template: '{{ trigger.from_state.state | lower != "unknown" }}'
action:
- service: script.notify_me
data_template:
2020-02-05 23:28:38 +00:00
message: "Tesla Door is now: {{ trigger.to_state.state| upper }}"