Hi, This is my first post and I’m brand new to HA but not to home automation.
I’m getting this error when I check my configuration:
“Invalid config for [automation]: [service] is an invalid option for [automation]. Check: automation->action->0->service. (See ?, line ?).”
What am I doing wrong? I’d appreciate any suggestions.
My dir structure is this:
.
└── homeassistant
├── automations
│ ├── master_bath
│ │ ├── shower_music_sg_on.yaml
│
└── configuration.yaml
I have this include in my configuration.yaml:
automation: !include_dir_list automations
The “shower_music_sg_on.yaml” automation contains this. I’m playing a Sonos source when a switch is triple pressed after two Sonos speakers are grouped and volume set.
alias: "Turn on SG shower music"
trigger:
platform: state
entity_id: sensor.family_room_alcove_scene_state_1
to: "Pressed 3 Times"
action:
service: script.turn_on
entity_id: script.group_mast_bed_bath_sonos
delay: '00:00:01'
service: script.turn_on
entity_id: script.volume_50_mast_bed_bath_sonos
delay: '00:00:02'
service: media_player.select_source
data:
- entity_id: media_player.master_bedroom
- source: "Best of Coldplay"
Here are the two scripts that are called in the automation:
group_mast_bed_bath_sonos:
alias: Group Master Bedroom and Bath Sonos
sequence:
- data:
master: media_player.master_bedroom
entity_id: media_player.master_bath
service: sonos.join
volume_50_mast_bed_bath_sonos:
alias: Set Volume of Master Bedroom & Bath Sonos to 50%
sequence:
- data:
volume_level: 0.5
entity_id:
- media_player.master_bath
- media_player.master_bedroom
service: media_player.volume_set
I’m getting this error now: Error loading /config/configuration.yaml: mapping values are not allowed here in “/config/automations/master_bath/shower_music_sg_on.yaml”, line 14, column 11
Corrected it to match with your example - but now get this error: Invalid config for [automation]: required key not provided @ data[‘action’]. Got None required key not provided @ data[‘trigger’]. Got None. (See ?, line ?). Invalid config for [automation]: expected dict for dictionary value @ data[‘action’][4][‘data’]. Got None.(See ?, line ?).
Corrected again based on @pnbruckner suggestion and getting this error:
Invalid config for [automation]: required key not provided @ data[‘action’]. Got None required key not provided @ data[‘trigger’]. Got None. (See ?, line ?).