awakefie
(Aaron Wakefield)
July 3, 2020, 2:15pm
1
So I am getting the follow error: "Invalid config for [switch]: required key not provided @ data[‘platform’]. Got None. (See /config/configuration.yaml, line 30). "
switch:
- platform: template
switches:
MB_Roku:
value_template: "{{ is_state_attr('remote.master_bedroom', 'current_activity', 'Roku-MB') }}"
turn_on:
service: remote.turn_on
data:
entity_id: remote.master_bedroom
activity: '37206484'
turn_off:
service: remote.turn_on
data:
entity_id: remote.master_bedroom
activity: 'PowerOff'
MB_Chromecast:
value_template: "{{ is_state_attr('remote.master_bedroom', 'current_activity', 'Cast-MB') }}"
turn_on:
service: remote.turn_on
data:
entity_id: remote.master_bedroom
activity: '37206532'
turn_off:
service: remote.turn_on
data:
entity_id: remote.master_bedroom
activity: 'PowerOff'
MB_Bedtime:
value_template: "{{ is_state_attr('remote.master_bedroom', 'current_activity', 'Bedtime-MBR') }}"
turn_on:
service: remote.turn_on
data:
entity_id: remote.master_bedroom
activity: '37206568'
turn_off:
service: remote.turn_on
data:
entity_id: remote.master_bedroom
activity: 'PowerOff'
Apologies if I messed up the code block. This is my first post. Any help would be appreciated.
petro
(Petro)
July 3, 2020, 2:24pm
2
remove all the capital letters on each switch name. I.e. MB_Chromecast should be mb_chromecast.
Also, you can be lazy and provide the name of the activity instead of the activity #. Choice is yours.
awakefie
(Aaron Wakefield)
July 3, 2020, 2:39pm
3
Thanks for the help
switch:
- platform: template
switches:
mb_roku:
value_template: "{{ is_state_attr('remote.master_bedroom', 'current_activity', 'Roku-MB') }}"
turn_on:
service: remote.turn_on
data:
entity_id: remote.master_bedroom
activity: '37206484'
turn_off:
service: remote.turn_on
data:
entity_id: remote.master_bedroom
activity: 'PowerOff'
mb_chromecast:
value_template: "{{ is_state_attr('remote.master_bedroom', 'current_activity', 'Cast-MB') }}"
turn_on:
service: remote.turn_on
data:
entity_id: remote.master_bedroom
activity: '37206532'
turn_off:
service: remote.turn_on
data:
entity_id: remote.master_bedroom
activity: 'PowerOff'
mb_bedtime:
value_template: "{{ is_state_attr('remote.master_bedroom', 'current_activity', 'Bedtime-MBR') }}"
turn_on:
service: remote.turn_on
data:
entity_id: remote.master_bedroom
activity: '37206568'
turn_off:
service: remote.turn_on
data:
entity_id: remote.master_bedroom
activity: 'PowerOff'
New Error: "Invalid config for [switch]: required key not provided @ data[‘platform’]. Got None. (See /config/configuration.yaml, line 29). "
Thanks for the help!
Any other ideas?
petro
(Petro)
July 3, 2020, 3:01pm
4
Do you have more than 1 switch section?
awakefie
(Aaron Wakefield)
July 3, 2020, 3:24pm
5
This is the entire file: switch.yaml
petro
(Petro)
July 3, 2020, 3:26pm
6
Ok, remove switch from switch.yaml. It’s already called out in configuration.yaml.
Edit: To clarify I’m referring to the word switch:
at the top of switch.yaml.
1 Like
awakefie
(Aaron Wakefield)
July 3, 2020, 3:50pm
7
That did the trick! I can’t tell you how much I appreciate your help. Not just this interaction, but your previous posts helping others with similar issues. I am a newb at HASS making the conversion over from Openhab and the jump from JSON/XML to YAML has been tougher than expected. Every little bit of help makes a huge difference.
THANK YOU!
A
1 Like