Please consider adding the following device class:
yes
for on
no
for off
Please consider adding the following device class:
yes
for on
no
for off
if you want this to be considered youāre going to have to add a bit more information like why you need it and canāt use the existing binary sensor.
because isnāt available?
This is not really unpopular, and it kind of make sense it itself.
I would like not to have tens and tens of additional custom binary sensors with a template.
example āFirmware available?ā yes or no
Duplicate of Binary sensor "yes" and "no" device_class for date ranges which has a few more possible use cases listed
tbh I donāt like at all that binary sensor has so many variations. It should be boolean true/false and nothing more. Open/Close, On/Off, yes/no, Safe/Unsafe, detected/clear and more should be choice of GUI layer
You can create a value template and make a binary sensor display anything you like. I know it can be a bit arcane and frustrating at first, but once you figure out the recipe for certain things, theyāre easy to reapply. Thereās even a utility for checking out your templates built into the GUI. Itās under Developer Tools >> TEMPLATE.
https://www.home-assistant.io/docs/configuration/templating/
https://www.home-assistant.io/integrations/template#renaming-sensor-output
Hereās an example from my configuration.yaml:
alarm_panel_siren_active:
value_template: >-
{% if is_state_attr('alarm_control_panel.visonic_alarm', 'Panel Siren Active', false) %} Off
{% elif is_state_attr('alarm_control_panel.visonic_alarm', 'Panel Siren Active', true) %} On
{% endif %}
In this case, the integrationās <entity>.<attribute>
outputs true/false
and the template replaces them with a new entity that outputs On/Off
.
Yeah and to have as twice entities as needed I wouldnāt say itās efficient solution. At best is a workaround. I would like to see consistent and efficient design. not system which requires hacks wherever you look at. this is what FRs are for.
not efficient, and this needs to be replicated for many instances. It seems very versatile to have a yes
or no
status, I am very surprised to see many other got implemented first before this basic oneā¦
Integration developers create whatever variable outputs they want. If I were in hell, Iād love to have some ice water.
Perhaps thereās a better way than what you propose. If there was a standard way of remapping states from native to custom in GUI form (whether binary or multiple states), it could work similarly to declaring a Friendly Name. I envision it would be opt-in for the developer. Edit: Essentially, a generalized version of what @maxym described.
Of course, once this is done, there would be requests for numeric options. This would result in someone saying āthereās this thing called a āvalue templateā.ā
Yes, itās an old request, but with the new helpers and stuff itās relevant again.
I have for example a Template binary sensor that shows me whether the sun is within the specified corridor or not. True/False is enough for the logic, so it works, but since there is this thing called āDevice classā, there should be a āYes/Noā class if you ask me.
Now it shows on/off and there is no class that essentially returns/shows Yes/No or even True/False in the GUI/dashboard.
Yes/No or True/False, both are fine for my use case, but there currently is no option for as far as I know.
Make your case here:
I suggest BinarySensorDeviceClass.AFFIRMATION
.
This topic is in the Feature Requests section. I donāt know what youāre try to say with making my case āhereā.
Youāre right. Somehow, I thought you were suggesting a similar, but different device class.
Apologies.
Thereās already a duplicate request with over twice the votes as this one linked above. I suggest you make your case there & vote on that one