I have keep getting this error and I don’t understand why
I’ve cheked the other post about this error but it still dosen’t work
Error
Invalid config for [switch]: required key not provided @ data['platform']. Got None. (See /config/configuration.yaml, line 44). Please check the docs at https://home-assistant.io/components/switch/
I’m trying to use Wake On Lan from this link, but when I check from setting i get this error.
WOL conf.yaml
Line 44 switch: **- platfotm: wake_on_lan ****mac_addres: "MAC" ****name: Computer ****host: "192.168.1.x" ****turn_off: *****service: shell_command.turn_off_pc ****shell_command: *****turn_off_pc: 'net rpc shutdown -I 192.168.1.37 -U mypc%passw'
the * is for the indentation just here
the link I’ve used: https://www.home-assistant.io/components/switch.wake_on_lan/
What I’m doing wrong? I’m running hass.io on ubuntu 18.04
I didn’t see platform.
I’ve changed the indentation and correct the spelling.
Now I have this error [switch.wake_on_lan]: required key not provided @ data['mac_address']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/switch.wake_on_lan/
Sry that i dig up this thread but im gonna crazy
i get the error from the configuration that already include the switch.yaml with
switch: !include switch.yaml:
Invalid config for [switch]: required key not provided @ data[‘platform’]. Got None. (See /config/configuration.yaml, line 86). Please check the docs at Switch - Home Assistant
And my switch (wake on lan ) that is on switch.yaml is:
@anon43302295 Thank you, on the suggestion of removing the sensor tag in the file I’m attempting to remove. That resolved an issue I was having and couldn’t understand, but that actually clears up the command in my head for theinclude too.
I have just started experimenting with splitting up my configuration.yaml.
I used to copy the whole block of code into a separate file and though I could just include that file and it would work…it didn’t.
e.g. from my configuration.yaml
light:
- platform: group
name: Trees
entities:
- light.front_tree_1
- light.front_tree_2
- light.front_tree_3
- light.front_tree_4
To include this as a separate file, in the configuration.yaml
light: !include lights.yaml
And in the separate lights.yaml file
#light: (this line is not used, it's declared in the configuration.yaml)
- platform: group
name: Trees
entities:
- light.front_tree_1
- light.front_tree_2
- light.front_tree_3
- light.front_tree_4
Another example for a custom sensor I created froma Wemos D1
In my configuration.yaml file
binary_sensor: !include binary_sensor.yaml
And a separate file for the sensor
#Beam sensor
#binary_sensor: (this line is not used, it's declared in the configuration.yaml)
- platform: mqtt
name: "Beam sensor motion"
state_topic: "stat/beam_sensor/POWER"
payload_on: "ON"
payload_off: "OFF"
qos: 0
device_class: motion