I don’t get it anymore,
If I look at example automation.yaml files, mine looks the same.
But mine doesn’t work.
I am new to yaml, so if it could be a beginners mistake.
Here is my automations.yaml
- alias: 'lamp_woonkamer'
# Lamp woonkamer
trigger:
- platform: sun
# Possible values: sunset, sunrise
event: sunset
# Optional time offset. This example is 45 minutes.
offset: '-00:30:00'
action:
- service: switch.turn_on
- entity_id: switch.lamp_woonkamer
- alias: 'luchtverfrisser_uit'
# Luchtverfrisser uit
trigger:
- platform: time
# When 'at' is used, you cannot also match on hour, minute, seconds.
# Military time format.
at: '22:32:00'
action:
- service: switch.turn_off
- entity_id: switch.luchtverfrisser
- alias: luchtverfrisser_aan
# Luchtverfrisser aan
trigger:
- platform: time
# When 'at' is used, you cannot also match on hour, minute, seconds.
# Military time format.
at: '09:32:00'
action:
- service: switch.turn_on
- entity_id: switch.luchtverfrisser
- alias: luchtverfrisser_niet_thuis
trigger:
- platform: state
entity_id: device_tracker.phone_phone, device_tracker.kim_greatlte
# Optional
from: 'home'
# Optional
to: 'not_home'
# If given, will trigger when state has been the to state for X time.
for:
seconds: '/5'
action:
- service: switch.turn_off
- entity_id: switch.luchtverfrisser
Still lost with automation and yaml. The more I read, the more I’m confused.
Back in the day when I wrote in Cobol and RPG3 I had documentation telling me what belongs in which column, with yaml I can’t find something like that.
I’m trying to detect my tasmota devices for wich I have to set option 19 to 1. Works fine in the web console and should be doable via an automation in hass, too.
2019-03-19 15:37:43 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: expected dict for dictionary value @ data['action'][1]['data']. Got None
extra keys not allowed @ data['action'][1]['payload']. Got '1'
extra keys not allowed @ data['action'][1]['topic']. Got 'sonoffs/cmnd/SetOption19'. (See /home/homeassistant/.homeassistant/configuration.yaml, line 73). Please check the docs at https://home-assistant.io/components/automation/
Line 73 of configuration.yaml being the line where automations.yaml is included.
Can somebody point me in any direction where I can find documentation about what goes where with or without hyphen? For instance, in automation documentation alias is used with a hyphen and in automation 2 doc it is used without.
Help us help you. Please format your automations so that all indentation is properly displayed. Otherwise we are obliged to decipher your unformatted automation … and that’s no fun.
Use the instructions shown in the banner at the top of the page. Alternately, use markdown’s code-blocks which is to simply add three backticks ``` before and after your code.