Can binary sensors be created within sensors.yaml?

I have a sensors.yaml which has a good number of sensors. I have a few binary sensors. Can they be placed within the sensors.yaml or do I have to create a separate binary_sensors.yaml?

The two types can’t be in the same file because of the way the !include works.

unless you use them in packages then you can have anything you want in there.

1 Like

Separate… I use the following in my config file to help me keep things straight:

input_number: !include_dir_merge_named config-include-files/input-numbers/
input_boolean: !include_dir_merge_named config-include-files/input-booleans/
sensor: !include_dir_merge_list config-include-files/sensors/
automation: !include_dir_merge_list config-include-files/automations/
binary_sensor: !include_dir_merge_list config-include-files/binary-sensors/

Then, within the subdirectories, I separate my individual files depending on what they do (HVAC, lights, rooms):
Similar folders for sensors, input booleans, etc.