Comments (5)
made a second one:
and that does show alright. checking the entity_registry on those reveals something interesting:
{"aliases":[],"area_id":null,"categories":{},"capabilities":null,"config_entry_id":"c81b18ff91b463722f311755b7c13f6d","device_class":null,"device_id":null,"disabled_by":null,"entity_category":null,"entity_id":"binary_sensor.donker_thema_2","hidden_by":null,"icon":null,"id":"8fed530249c0e3efe9f8afa346ff2a9f","has_entity_name":false,"labels":[],"name":null,"options":{"cloud.google_assistant":{"should_expose":false},"conversation":{"should_expose":false}},"original_device_class":null,"original_icon":null,"original_name":"Donker thema","platform":"template","supported_features":0,"translation_key":null,"unique_id":"c81b18ff91b463722f311755b7c13f6d","previous_unique_id":null,"unit_of_measurement":null}
has device_class set to null, while the first try has:
{"aliases":[],"area_id":null,"categories":{},"capabilities":null,"config_entry_id":"6b66880d8b2992b11a731f176d96997a","device_class":"","device_id":null,"disabled_by":null,"entity_category":null,"entity_id":"binary_sensor.donker_thema","hidden_by":null,"icon":null,"id":"9ba19e6d01b96ae70c7fb6d89adc9b89","has_entity_name":false,"labels":[],"name":null,"options":{"cloud.google_assistant":{"should_expose":false},"conversation":{"should_expose":false}},"original_device_class":"running","original_icon":null,"original_name":"Donker thema","platform":"template","supported_features":0,"translation_key":null,"unique_id":"6b66880d8b2992b11a731f176d96997a","previous_unique_id":null,"unit_of_measurement":null}
device_class set to "".
Still can Not select None, or No class in the drop down
from frontend.
I don't think there's anything that can be done from the frontend.
No matter what is sent in the config/entity_registry/update
API for device_class, core will always revert back to the entity's original_device_class if we request a nullish value for device_class. That logic in the entity registry would need to be changed.
from frontend.
but... are you saying now that if we dont set a device_class (I did not do that), it would set it to active? Because that is what happened and really shouldnt.
And, as Ive found, the X does not do anything in this case, while it should really unset any choice previously set?
If this needs to be taken to the Core, can you move that? I wont be able to describe what you just said above...
from frontend.
No I'm not saying that.
Entity registry has two fields: original_device_class
and device_class
.
original_device_class
is set by the integration. In the case of the template binary sensor, it is set by the choice made in the config flow when the entity was first created. This can't be changed after creation.
device_class
can be set by user picking a value in the show_as field. This can be changed at any time.
Even after changing device_class
, the original_device_class
always remains its original value. The device class attribute for an entity is defined as: if device_class
has a value, use that, else use original_device_class
.
This means when you clear the device_class/show_as field in the registry settings, the device class attribute reverts back to original_device_class
.
If clearing device_class field sets your entity to Active
device_class, than I believe that would have been the value selected at entity creation, and that must be the value of original_device_class
. You can check this in your entity registry entries that you posted. If you claim you didn't set that, I would ask you to try one more time to make sure, since if I do:
- create a template binary_sensor
- leave the device_class blank,
- and then assign a show_as class,
- and then clear the show_as class...
it reverts back to no device class as expected.
from frontend.
This is also happening to ping
binary sensors. I'd very much would like to be able to override the device class also to none
, instead of the default 'connectivity'.
Fun fact: an older ping sensor I have shows perfectly fine as "none" (reverting to default device classnone
), while a newer one cannot be set to none
.
none
is supposed to be a supported device class though:
https://www.home-assistant.io/integrations/binary_sensor/#device-class
The one ping sensor that has none
as device class:
Shows as
And the one I cannot clear out (as empty is not accepted, and none
is not in the list):
Shows as
from frontend.
Related Issues (20)
- Targets missing in automation 'Then Do' when selecting a switch, etc. HOT 1
- Statistics helper: Unable to edit or even view the source entity and the state characteristic for the statistics sensor in the settings HOT 1
- Scripts disappearing from UI after a while HOT 5
- Color control doesn't work on some new badges HOT 1
- Not possible to change the USB-Port in EDL21-Integration HOT 4
- Self-consumption is incorrectly displayed when used with the battery
- Entities card no longer show values HOT 1
- Automations UI error when adding notification channel and priority HOT 1
- Miss-Scaling input_datetime.xxxx within horizontal stack
- Tiles from Sections are resized after core update to 2024.8 HOT 5
- Binary Sensor's with device_class: power do not translate properly. HOT 1
- Lovelace has font 'Roboto' hard-coded in certain cards.
- Key 'service' is not expected for blueprint automations
- telechargement Energy.csv download energy.csv
- UI keep reloading
- Hard-coded rounded corner values
- Gas consumption not calculated from meter readings in energy dashboard HOT 1
- Text editors no longer have select all option on mobile in chrome and app
- Uncaught (in promise): home-assistant.ts:229 HOT 3
- Onboarding - icon not showing properly in dark mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frontend.