I only copied mine code and it doesn't work anymore

Hi, I’m Tom and new here.

I make 2 sensors in the configuration.yaml file Sunday and now one of them doesn’t work anymore.
To have a better overview I make a sensor.yaml file and copy paste it over there.
And now it’s totally doesn’t work anymore.

I think for you guys it’s a simply code.
Can anyone tell me what I’m doing wrong.

### sensor.yaml
Sensor:

# Example configuration.yaml entry. Sensor t.b.v. het random besturen van het uit commando lamp eettafel
sensor:
 - platform: random
   name: random
   minimum: 0
   maximum: 100


#Sensor die in de gaten houd of de netflix app gestart is
 - platform: template
   sensors:
       living_room_tv_source:
       value_template: '{{  states.media_player.woonkamer_tv.attributes.app_name == "Netflix"  }}'
       friendly_name: 'Woonkamer TV Source'

Indentation. Remove 2 spaces before living_room_tv_source.

I’ve been tinkering with HA for over a year now and never cease to be humoured by the strict whitespace rules of yaml. Reminds me of my high school days programming in COBOL and it’s similarly hard forced indentation rules (originating from punched card). Oh how we have come so far over so long of humanities greatest achievements.
We need a prettyprint/formatter.

„humored“ by a pain in the ass? It didn‘t work in Lisp, it did not work with COBOL and it does not work with Yaml.

At least you can embed JSON inside Yaml.

:rofl: :rofl: :ok_hand:

1 Like

you have two “sensor:” keys and one is capitalized.

get rid of the first capitalized one.

Finity is right. That is one problem. m0wlheld is correct too. Indentation. Remove 2 spaces before living_room_tv_source .

1 Like

Thank you all.
with the TV it works, the random sensor doesn’t I replaced this one back in the configuration.yaml and now both works :slight_smile: