Open NoRi2909 opened 3 days ago
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (binary_sensor
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
binary_sensor documentation binary_sensor source (message by IssueLinks)
That makes sense - I suggest that you open a PR...
The problem
All binary sensors for hazards inherit the On and Off state from the Gas binary sensor type as this matches well for Smoke, CO, Heat etc., too.
But currently this is also the case for Occupancy sensors which are not reporting a hazard at all but rather a simple state of a room. But having them inherit the same strings like smoke detectors causes quite some issues in translations where this results in the translation of the "clear" state (or "cleared" logbook entry) being changed back and forth many times as it does not fit across the board.
The inheritance is specified here:
https://github.com/home-assistant/core/blob/2bd5039f28e639439dfd6da216f51921072395f3/homeassistant/components/binary_sensor/strings.json#L222-L226
This results in
In English this is still quite obvious, but note that the trigger and condition types have already diverted from "Has started detecting occupation" or "Is detecting occupation" etc. to the special "became occupied" or "is not occupied" instead:
https://github.com/home-assistant/core/blob/2bd5039f28e639439dfd6da216f51921072395f3/homeassistant/components/binary_sensor/strings.json#L29-L30
https://github.com/home-assistant/core/blob/2bd5039f28e639439dfd6da216f51921072395f3/homeassistant/components/binary_sensor/strings.json#L29-L30
Therefore the states above should also be decoupled from the binary Gas sensor type by either using
making them consistent with the existing trigger and condition types.
Or by changing all occurrences of "not occupied" in above triggers and conditions to "clear", keeping that for the "off" state. Then we'd have:
Background: I'm reporting this because in German we had run into a major chaos because the first translation of that "Clear" state was set to "Leeren" ("to empty") which made absolutely no sense when it appeared in context. Then it was changed to "Normal" later on, but that does not fit for occupancy or motion sensors at all.
I've now changed this to "Frei" which works for everything except for motion where I set the off state to "Keine" (none).
So for occupancy here we now toggle between
This also exactly matches the German translations of the triggers and conditions now (as suggested for English above) so everything is 100% consistent now.
I assume there will be similar issues in other languages, so some guidance from the English originals might help a lot here. For openings there is already separate strings which might the example to point at, too.
What version of Home Assistant Core has the issue?
2024.11.0b0
Integration causing the issue
Binary sensor
Link to integration documentation on our website
https://www.home-assistant.io/integrations/binary_sensor/