Entities now showing when in separate config file

When adding binary devices in a seperate config file they do not show up in the gui when trying to add them to a card. Also checked in dev tools → states.

But when i add them to the main configuration file they show without problem.
I have included “!include” in the main confi file.

Can you show us the section of the configuration.yaml that shows the include!
and maybe the section of the binary devices yaml to check the formatting is correct?

This is the seperate config. Only has 6 lines:

image

And this is the main configuration:

image

It does not give my any error when checking the config.

OK, well I am no expert and I am sure others will pipe in here but this is how mine shows.

I have seperate binary sensor yaml and it shows like this:

binary_sensor: !include sensor_binary.yaml

And then in sensor_binary.yaml I have the following:

- platform: ping
  host: 1.1.1.1
  name: "Internet Up"
  scan_interval: 120
  count: 2

Not sure if that is of any help here.

I have not been successfull in solving this.
Anyone has sugestions?

The post above yours shows the right way. If you put things in a separatie file like you do, the top level entry should no longer be in the separate file. That top level is what you put in configuration.yaml. The way you now specified it, your definition would amount to the following invalid format:

ping:
  binary_sensor:
    platform: "ping"
    ...

So, do it like @rossk explained above. Remove the binary_sensor: from the separate file, indent the contents of the file one level less, and in your configuration.yaml place:

binary_sensor: !include ping.yaml

Since you can only have one binary_sensor entry, I would advise to name the file binary_sensor.yaml and place all other binary_sensors there too. in that case the confuguration.yaml would be:

binary_sensor: !include binary_sensor.yaml

I did this change and it works. But does that mean i cannot have any name i like on the configuration files?

You can name the file anything you like but as @Edwin_D mentions above you can only have one binary_sensor top level entry in your config.

Therefore moving forward you would have to put all binary sensors in the ping.yaml and that kinda makes no sense and would in my opinion would only go to make for more confusion moving forward.