I have a template.yaml that has a list of sensors. I have - sensor: before every single sensor. Shouldn’t I be able to have sensors: at the top so I don’t have to repeat each sensor? I get an error when I use Check Configuration that tells me to check the log but I don’t see anything in the log. What am I doing wrong? How can I make the yaml file more concise?
And then, for each sensor you start with name of the sensors, and sensor definition:
media_player_title:
value_template: '{{ state_attr("media_player.lg_tv", "media_title") }}'
friendly_name: Media Player Title
media_content_type:
value_template: '{{ state_attr("media_player.lg_tv", "media_content_type") }}'
friendly_name: Media Content Type
media_source:
value_template: '{{ state_attr("media_player.lg_tv", "source") }}'
friendly_name: Media Source
Yeah you can have one - sensor: and one - binary_sensor: under template: with the individual sensors listed under each. You have to have a separate - trigger: under template: for each triggered sensor or binary sensor though.