I’m trying to set up an entity that summarizes the state of all my door and window entities. I put them all in a group entity.
This basically works fine, but there is one issue: The critical information is whether all doors and windows are closed. Now if a device is unknown or unavailable, the group entity still reports “closed” if all others are closed. So this might not be true. But this is the intended behavior according to the documentation for groups of binary sensors.
What is the most elegant way to ensure that really all group elements reported “closed” and otherwise the error state becomes obvious?
Thanks a lot.
As I’m still not so familiar with yaml: How would these look like as part of configuration.yaml? It would start with template: and then…?
but this first lead to an exclamation mark at the helper entry. I opened again, saved again, but now it always reports “closed” even if a group member is open.
Is ERROR maybe just a placeholder I should fill? I would simply expect that the helper goes to “unknown” state or “unavailable” in case one member is not working properly.
Sorry in case I’m not understanding the fundamentals, but templating is beyond my experiences…
No. Though you can change it to whatever makes sense to you, it is meant to be a state specific to issues with upstream sensors. That is what you asked for in your original post. This requires you to switch to a Template sensor helper, not a binary sensor, because you have more than 2 possible output values.
If you want a binary sensor and to use unavailable for the purpose of showing upstream errors; you can do that by moving to a YAML-configured Template binary sensor. Template Helpers do not allow defining an availability, but YAML configuration does.
In general, it is not advisable to use “unknown” and “unavailable” as user-configured states. Those value already have specific meanings within HA. If you use them for other purposes, it can complicate debugging if a problem arises.