Moving platform sensors from configuration.yaml to own sensor folder and iles

Hello,
i have started clean my configuration.yaml from sensors to own folders and dedicated files. I was already able to move some sensors (e.g binary) and adding this to my configuration.yaml

template: !include_dir_merge_list template_sensors/

Now I’m trying to move platform type of sensors e.g:

sensor:
  - platform: time_date
    display_options:
      - time
      - date
      - date_time

I first created sensors folder and there date_time.yaml file and then tried to add this is my configuration yaml: sensor: !include_dir_merge_list sensors/

but no matter what I tried date_time.yaml was always giving some kind of error. I tried different file formats like

- platform: time_date
  display_options:
    - time
    - date
    - date_time
display_options:
  - time
  - date
  - date_time
sensor:
  - platform: time_date
    display_options:
      - time
      - date
      - date_time

but always same issues. I think I have some format issue somewhere but can some help to point out my mistake?

If you want to split your sensors, you should do something like:

sensor: !include_dir_merge_list sensors/

then your first form will work in a sensors/date_time.yaml file

So currently my configuration.yaml has these both (this patter warning are somehow related to vs code config, found this by googling around.)

image

and for both, I have folders with my yaml files there

Everything is working just fine in the template_sensors folder

but platform sensors in the “sensors” folder are giving the red

Same things happens if try to move the file from “sensors” to “template_sensors”

Not sure if doing something totally wrong by splitting them like this or am I not just understanding something here because this is fairly new topic for me.

Ignore “errors” from vscode. The HA extension is on life-support, if even that.
Show us the errors from the HA log, if any.

Yeah, seems like so because I checked and restarted my HA and I can see those sensors just fine now… and nothing can be found from HA logs related to these after booting