Sorry for the long post, but I’m pulling out what little hair I have left and have read so many posts that provide examples that aren’t working but are also several years old, so I’m not sure if I’m doing things wrong or if those are just out of date…
Anyway, I have several binary sensors that are ST multipurpose sensors and are attached to doors and windows (as open/close sensors). They are using the Zigbee integration and showing as binary_sensors (with entity id’s ending in ‘_ias_zone’).
I would like to change their device_class to be doors and windows so they show up correctly without having to manually change them in the UI. Actually, what I really want is to be able to create dynamic groups for doors and windows by using the device_class similar to what I do for lights.
What I’ve tried:
-
Based on the binary_sensor integrations page, I’m assuming I can set a device_class to window or door.
-
So the first thing I tried was setting up a ‘window’ section similar to my ‘light’ section:
Light Section:
light:
- platform: switch
name: Master Bedroom Closet Light
entity_id: switch.mbc_switch_closet
- platform: switch
name: Pantry Light
entity_id: switch.kit_switch_pantry
Similar solution for Window (but just gives an Integration error: Integration ‘window’ not found. error when I do a ‘Check Configuration’).
window:
- platform: binary_sensor
name: Game Room Window
entity_id: binary_sensor.game_sensor_window_ias_zone
- platform: binary_sensor
name: Loft Window
entity_id: binary_sensor.loft_sensor_window_ias_zone
-
The next thing was trying to decipher the customizing devices page, which gives two options: UI or YAML:
-
UI: The page only describes changing the entity id name (without modifying the domain portion), but not what, if any, change I’m supposed to make to reflect a new device_class. So does changing the entity name (e.g., from ‘binary_sensor.game_sensor_window_ias_zone’) somehow change the device_class? If so, what is the appropriate new name?
-
YAML: The page also describes a YAML change which includes an option for ‘device_class’, but doesn’t provide good info on the customization syntax. Further down the page, it provides some examples.
-
I tried the following, but it gives a configuration error: Integration error: customize - Integration ‘customize’ not found.
customize:
binary_sensor.game_sensor_window_ias_zone:
device_class: window
binary_sensor.loft_sensor_window_ias_zone:
device_class: window
The same page (and various forum posts) mention that the ‘customize’ needs to be in the ‘homeassistant:’ section as:
homeassistant:
name: Home
unit_system: metric
# etc
customize:
But I don’t have a ‘homeassistant:’ section in my configuration.yaml and didn’t want to add it without a better understanding (especially since there is also a reference to an include for customize.yaml, which I also don’t have (the include or the corresponding .yaml file)).
So I’m a bit at a loss as to how to get door and window device_classes set up correctly.
Any help would be appreciated! Thanks in advance!