trying to create a group consisting of a bunch of ZHA / xiaomi window sensors in combination with some velux window covers.
problem is the window covers use the “open/close” state values while the window sensors use the “on/off” state values.
device_class of the window covers is: window
device_class of the window sensors is: open
I did try and add “device_class: window” to the window binary sensors in customize.yaml.
This change is correctly picked up by hass as the icon is changed to the mdi:window icon
but the state is still on/off.
What do I have to do in order to get the binary sensors to report their state values as open/closed as this would make my custom group work.
That’s not possible. Binary sensors are always on/off, it’s only showing different things in the frontend depending on the device type, but the state will always be on/off.
You can create a template sensor for each binary sensor that shows open if the binary sensor is on and closed if it is off or vice versa, whatever you need.
But what are you trying to do with your custom group? Why or what is not working with on/off binary sensors?
Thanks for pointing this out.
I essentially have an AppDaemon based app that takes a group as a parameter.
The app makes sure to turn my ventilation system on/off based on this group state.
If any door or window has been registered as being open for more than X minutes, then turn of ventilation, vice versa for turning the ventilation on again.
I know I can code my way around this creating 2 attributes in apps.yaml
one group for binary sensors, and one group for covers
I guess this would be prettier than having to create shadow helper entities.
Why not adjust the AppDaemon app accordingly to either check the state of the windows based on the device type of the sensor or check if the sensor is either on or open instead of just checking if it is open? Can you share your AppDaemon app? I can take a look at it if you want me to.