Hi all,
I’ve been doing some basic things in Home Assistant, and I would like to get into a deeper knowledge of it. I love it and I want to learn all I can, but for now, I’m stucked in basic things.
My problem is that I want to create a button in the Lovelace which lets me turn on a switch (which activates an elecctrice heater) for a certain period of time (like a timer).
I’ve been searching in the community blog and there are a lot of people doing this, but in my case it does not work, and I don’t know why it is.
The post I’ve been using for my automation is the following: https://community.home-assistant.io/t/edit-yaml-through-lovelace/135386
For the moment I have this; in the config.yaml:
# Proves de temporitzador
input_boolean:
radiador_timer_enable:
name: Timer Enable
#initial: on
icon: mdi:timer
input_number:
radiador_timer:
name: On Timer (mins)
#initial: 30
min: 1
max: 120
step: 1
mode: box
icon: mdi:alarm
In my scripts.yaml there is this:
script:
alias: heater timer script
sequence:
- delay: '00:{{ states("input_number.temp_cuina") | int }}:00'
- service: switch.turn_off
entity_id: switch.cuina_rad
And my automation.yaml is:
- id: '001'
#name: Heater Off Delay
- alias: switch_heater_offdelay
trigger:
- platform: state
entity_id: switch.cuina_rad
to: 'on'
condition:
- condition: state
entity_id: input_boolean.radiador_timer_enable
state: 'on'
action:
- service: script.turn_off
entity_id: script.heater timer script
- service: script.heater timer script
#turning off timer enable cancels timer
- id: '002'
- alias: au_heater_cancel_tmr
trigger:
- platform: state
entity_id: input_boolean.radiador_timer_enable
to: 'off'
action:
- service: script.turn_off
entity_id: script.heater timer script
#name: Heater Off Cancels Timer
- id: '003'
- alias: au_heater_offcancelstimer
trigger:
- platform: state
entity_id: switch.cuina_rad
to: 'off'
action:
- service: script.turn_off
entity_id: script.heater timer script
All the yaml seems correct, but when I validate the configuration in the control server, there appears the following errors:
Invalid config for [automation]: required key not provided @ data[‘action’]. Got None
required key not provided @ data[‘trigger’]. Got None. (See /config/configuration.yaml, line 13).
Invalid config for [automation]: not a valid value for dictionary value @ data[‘action’][0][‘entity_id’]. Got None. (See /config/configuration.yaml, line 13).
Invalid config for [automation]: required key not provided @ data[‘action’]. Got None
required key not provided @ data[‘trigger’]. Got None. (See /config/configuration.yaml, line 13).
Invalid config for [automation]: not a valid value for dictionary value @ data[‘action’][0][‘entity_id’]. Got None. (See /config/configuration.yaml, line 13).
Invalid config for [automation]: required key not provided @ data[‘action’]. Got None
required key not provided @ data[‘trigger’]. Got None. (See /config/configuration.yaml, line 13).
Invalid config for [automation]: not a valid value for dictionary value @ data[‘action’][0][‘entity_id’]. Got None. (See /config/configuration.yaml, line 13).
I don’t know why is that, could someone help me?
Thanks in advance.