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?
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:
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.