Wrong sensors syntx please help

Added these lines to my sensors.yaml
but I cant see them
what is my mistake:


  - platform: time_date
    display_options:
    - 'time'
    - 'date'
    - 'date_time'
    - 'date_time_utc'
    - 'date_time_iso'
    - 'time_date'
    - 'time_utc'
    - 'beat'
  - platform: time_date
    display_options:
      - 'time'
      - 'date'
      - 'date_time'
      - 'date_time_utc'
      - 'date_time_iso'
      - 'time_date'
      - 'time_utc'
      - 'beat

indents are the problem

thanks
how can I test it if it works right?

1 Like

Can you run the configuration validation in configuration → Settings?

yes
but the validation was ok before the change to

Assume you have the sensor: !include sensors.yaml in configuration.yaml. I copied the lines directly out of my sensors.yaml and pasted below.

#Add the time_date platform
- platform: time_date
  display_options:
    - 'time'
    - 'date'
    - 'date_time'
    - 'date_time_utc'
    - 'date_time_iso'
    - 'time_date'
    - 'time_utc'
    - 'beat'

can you go to developer tools → templates and see if this gives you the time

{{ states('sensor.time') }}

yes I do have !include sensors.yaml
I get this:
result type: string

unknown

This template listens for the following state changed events:

  • Entity: sensor.time

And you have restarted HA core?

I get this out of templates

yes I restarted :disappointed:

Can you put it directly into your configuration.yaml file and see if that works?

Yes it does! thx
I think I understand the problem I left one sensor at the main configuration.yaml
so probably as long as one stays it dosn’t get the information from sensors.yaml

Glad you figured it out. :grinning:

Yes I figured out that all my yaml’s, are a mess :weary:

One of the things I just found to help keep yamls straight and error free is a HACS automation called Watchman. It found alot of entities that I had changed and missed in yamls. Something to look at if you can stand more complication in adding features.

I just spent the time to move all of my automations from automations.yaml and move into an automations directory. I also converted alot of my old sensors to the new templates. I have some I haven’t figured out yet - so I feel your pain.

The pesky learning curve always seems to get in the way.

1 Like

Watchman, are you sure? can’t find it in Hacs

yes

Do you have appdaemon active?

Here is the github

I will install appdaemon
Thx!