Invalid config for [switch]: required key not provided @ data['platform']

I keep getting this error when setting up a simple switch.

switch:
   - platform: template
   switches:
     tv:
        value_template: "{% if is_state('remote.living_room', 'on') %}on{% else %}off{% endif %}"
        turn_on:
           service: remote.turn_on
           entity_id: remote.living_room
        turn_off:
          service: remote.turn_off
          entity_id: remote.living_room

Any ideas?

Thanks!

Indentation is wrong. According to the documentation, switches and its sub entries require 2 more spaces in front.

1 Like

@exxamalte That did it. Thank you!

1 Like

Im having similar issue… i cant figure out why

#
media_player:
  - platform: soundtouch
    host: 192.168.1.191
    port: 8090
    name: Soundtouch Kitchen

keeps resulting in

2017-09-06 18:23:27 ERROR (MainThread) [homeassistant.config] Invalid config for [media_player]: required key not provided @ data[‘platform’]. Got None. (See /cofiguration.yaml, line 63). Please check the docs at https://home-assistant.io/components/media_player/

figured it out… nevermind!

i didnt need the media_player header in an includes file.