Hi Guys,
Just got the Tesla Model 3 and off course I have added this car into HA. Now I want to automate some bits and pieces for this car.
First off all I want to have the heater on at 7:00. I have read some things in this forum and found a automation part for the model X or so. Now I have changed some bits and pieces but error during testing.
#Tesla verwarming aan om 7.00
- alias: ‘Tesla verwarming’
trigger:
- at: 7:00
platform: time
condition
condition: and
conditions:
- condition: numeric_state
entity_id: sensor.sensor.tesla_model_3_5yj3e7eaxkf378212_battery_sensor
above: 30
- condition: numeric_state
entity_id: sensor.sensor.tesla_model_3_5yj3e7eaxkf378212_temperature_sensor_outside
below: 7
- condition: state
entity_id: device_tracker.tesla_model_3_5yj3e7eaxkf378212_location_tracker
state: 'home'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: climate.set_operation_mode
data:
entity_id: climate.tesla_model_3_5yj3e7eaxkf378212_hvac_climate_system
operation_mode: 'on'
Who can help.
Cheers,
Remco
Tediore
September 27, 2019, 11:44pm
2
7:00
needs to be '07:00:00'
, condition
needs to be condition:
, and you need to correct the alignment of action:
and everything below it.
Hi Tediore,
Should this be the right alignment?
#Tesla verwarming aan om 7.00
- alias: ‘Tesla verwarming’
trigger:
- at: 07:00:00
platform: time
condition:
condition: and
conditions:
- condition: numeric_state
entity_id: sensor.sensor.tesla_model_3_5yj3e7eaxkf378212_battery_sensor
above: 30
- condition: numeric_state
entity_id: sensor.sensor.tesla_model_3_5yj3e7eaxkf378212_temperature_sensor_outside
below: 7
- condition: state
entity_id: device_tracker.tesla_model_3_5yj3e7eaxkf378212_location_tracker
state: 'home'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: climate.set_operation_mode
data:
entity_id: climate.tesla_model_3_5yj3e7eaxkf378212_hvac_climate_system
operation_mode: 'on'
This is the error I have now.
Error loading /home/homeassistant/.homeassistant/configuration.yaml: mapping values are not allowed here
in “/home/homeassistant/.homeassistant/automations.yaml”, line 125, column 10
Line 125 is the data: part.
wills106
(Will)
September 28, 2019, 4:50pm
6
This is a stab in the dark as I don’t have a Tesla and my KIA Soul EV is an older one and doesn’t have an App
Also you could try
operation_mode: 'on'
instead of
operation_mode: 'heat'
action:
- service_template: climate.set_operation_mode
data_template:
entity_id: climate.tesla_model_3_5yj3e7eaxkf378212_hvac_climate_system
operation_mode: 'heat'
- service_template: climate.set_temperature
entity_id: climate.tesla_model_3_5yj3e7eaxkf378212_hvac_climate_system
data_template:
temperature: 19
Or a simpler
action:
- service: climate.set_temperature
entity_id: climate.tesla_model_3_5yj3e7eaxkf378212_hvac_climate_system
data_template:
temperature: 19
jgon
(Javier)
September 28, 2019, 6:16pm
7
Try this:
action:
- service: climate.set_operation_mode
data:
entity_id: climate.tesla_model_3_5yj3e7eaxkf378212_hvac_climate_system
operation_mode: heat
EDIT: Try again, my paste ruined the identation
petro
(Petro)
September 28, 2019, 6:25pm
8
Just add 2 spaces in front of entity_id and temperature after the data line. Everything that goes in the data section requires more indents that the data line itself
#Tesla verwarming aan om 7.00
- alias: ‘Tesla verwarming’
trigger:
- at: 07:00:00
platform: time
condition:
condition: and
conditions:
- condition: numeric_state
entity_id: sensor.sensor.tesla_model_3_5yj3e7eaxkf378212_battery_sensor
above: 30
- condition: numeric_state
entity_id: sensor.sensor.tesla_model_3_5yj3e7eaxkf378212_temperature_sensor_outside
below: 7
- condition: state
entity_id: device_tracker.tesla_model_3_5yj3e7eaxkf378212_location_tracker
state: 'home'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: climate.set_operation_mode
data:
entity_id: climate.tesla_model_3_5yj3e7eaxkf378212_hvac_climate_system
operation_mode: heat
#Tesla verwarming aan om 7.00
- alias: ‘Tesla verwarming’
trigger:
- at: 07:00:00
platform: time
condition:
condition: and
conditions:
- condition: numeric_state
entity_id: sensor.sensor.tesla_model_3_5yj3e7eaxkf378212_battery_sensor
above: 30
- condition: numeric_state
entity_id: sensor.sensor.tesla_model_3_5yj3e7eaxkf378212_temperature_sensor_outside
below: 7
- condition: state
entity_id: device_tracker.tesla_model_3_5yj3e7eaxkf378212_location_tracker
state: 'home'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: climate.set_temperature
entity_id: climate.tesla_model_3_5yj3e7eaxkf378212_hvac_climate_system
data_template:
temperature: 19
Error loading /home/homeassistant/.homeassistant/configuration.yaml: while parsing a block mapping
in “/home/homeassistant/.homeassistant/automations.yaml”, line 7, column 5
expected , but found ‘’
in “/home/homeassistant/.homeassistant/automations.yaml”, line 25, column 6
jgon
(Javier)
September 28, 2019, 6:39pm
12
Sorry @RemcovanKuilenburg my indentation was incorrect:
action:
- service: climate.set_operation_mode
data:
entity_id: climate.tesla_model_3_5yj3e7eaxkf378212_hvac_climate_system
operation_mode: heat
@jgon I have the following.
#Tesla verwarming aan om 7.00
- alias: ‘Tesla verwarming’
trigger:
- at: 07:00:00
platform: time
condition:
condition: and
conditions:
- condition: numeric_state
entity_id: sensor.sensor.tesla_model_3_5yj3e7eaxkf378212_battery_sensor
above: 30
- condition: numeric_state
entity_id: sensor.sensor.tesla_model_3_5yj3e7eaxkf378212_temperature_sensor_outside
below: 7
- condition: state
entity_id: device_tracker.tesla_model_3_5yj3e7eaxkf378212_location_tracker
state: 'home'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: climate.set_operation_mode
data:
entity_id: climate.tesla_model_3_5yj3e7eaxkf378212_hvac_climate_system
operation_mode: heat
And that gives me some errors.
I
nvalid config for [automation]: Entity ID sensor.sensor.tesla_model_3_5yj3e7eaxkf378212_battery_sensor is an invalid entity id for dictionary value @ data[‘condition’][0][‘conditions’][0][‘entity_id’]. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 79). Please check the docs at Automation - Home Assistant
jgon
(Javier)
September 28, 2019, 6:50pm
14
RemcovanKuilenburg:
I
nvalid config for [automation]: Entity ID sensor.sensor.tesla_model_3_5yj3e7eaxkf378212_battery_sensor is an invalid entity id for dictionary value @ data[‘condition’][0][‘conditions’][0][‘entity_id’]. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 79). Please check the docs at Automation - Home Assistant
Why are using twice “sensor.sensor”?
Try with:
sensor.tesla_model_3_5yj3e7eaxkf378212_temperature_sensor_outside
instead of:
sensor.sensor.tesla_model_3_5yj3e7eaxkf378212_temperature_sensor_outside
1 Like
Hey that is the one and now checking and it is working in the validation part. So vingers crossed after reboot.
petro
(Petro)
September 28, 2019, 7:24pm
16
Remove space in front of data
petro
(Petro)
September 28, 2019, 7:26pm
17
You don’t need the top and condition. By default the conditions are anded.
Remove lines
condition: and
conditions:
petro
(Petro)
September 28, 2019, 11:50pm
19
#Tesla verwarming aan om 7.00
- alias: Tesla verwarming
trigger:
- at: "07:00:00"
platform: time
condition:
- condition: numeric_state
entity_id: sensor.tesla_model_3_5yj3e7eaxkf378212_battery_sensor
above: 30
- condition: numeric_state
entity_id: sensor.tesla_model_3_5yj3e7eaxkf378212_temperature_sensor_outside
below: 7
- condition: state
entity_id: device_tracker.tesla_model_3_5yj3e7eaxkf378212_location_tracker
state: 'home'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: climate.set_operation_mode
data:
entity_id: climate.tesla_model_3_5yj3e7eaxkf378212_hvac_climate_system
operation_mode: heat
Cheers @petro I have it now in my automation and changed the temp and some words that should be in Dutch. So tomorrow morning we know