Can someone explain this 'invalid config for [sensor]' error?


Yesterday my UI was working fine, today I see everything flash (with errors for Dark Sky that worked fine today) for a second before disappearing and leaving me with a blank ui. After digging around I realised my sensor include line was gone along with my Dark Sky sensors within sensors.yaml. So I entered sensor: !include sensors.yaml and my Dark Sky sensors as below:

  - platform: darksky
    api_key: xxxxx
      - 0
      - 0
      - 1
      - summary
      - icon
      - temperature

Iā€™m getting this config error?

Invalid config for [sensor]: required key not provided @ data['platform']. Got None. (See /config/configuration.yaml, line 58).

Any advice is greatly appreciated, and some idea of what this config error is referring to would be appreciated!


Remove the sensor: in your sensor.yaml

1 Like

You need to remove the sensor: at the top.

When you do sensor: !include sensors.yaml, home assistant already knows, that in the file sensor.yaml are things that belong to sensor:, therefore you need to remove it from sensors.yaml.