Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: allow user to set up device_class and unit_of_measurement values for the entities that are created for WMI-based sensors #66

Closed
spikeygg opened this issue Apr 5, 2024 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@spikeygg
Copy link

spikeygg commented Apr 5, 2024

Is your feature request related to a problem? Please describe.
I was playing around with sending WMI values and I noticed that the entities created are all raw, string-based, entities. If the entities are not customized on the Home Assistant side, the result is poor history and no units for the entity. Here's an example of one I created to measure CPU temperature:
image
The value 38 has no units and is in fact a string which cannot yield a nice numerical graph.

Describe the solution you'd like
On the configuration of the WMI details, include a way to describe the device_class and unit_of_measurement values which will be sent to Home Assistant when the entity is created. This would streamline the creation of all entities and make them more definable directly from the client.

Describe alternatives you've considered
The current method for setting this up is to use a workaround by configuring the customization.yaml and adding more detail about each sensor from the Home Assistant side which works but with this solution, everything is configured from the client-side and no server-side configuration is needed (encapsulation).

Additional context
None

@spikeygg spikeygg added the enhancement New feature or request label Apr 5, 2024
@amadeo-alex
Copy link
Collaborator

Doable I think :)

@acshef
Copy link

acshef commented Apr 6, 2024

I think state_class should be included in this too!

@amadeo-alex
Copy link
Collaborator

amadeo-alex commented Apr 30, 2024

Done in https://github.com/amadeo-alex/HASS.Agent/tree/feature-wmi-advancedsettings - needs some more work to make sure it works for all sensors but should be merged into organisation's 2.1.0-beta2 branch in a day or so.

@amadeo-alex amadeo-alex added this to the 2.1.0-beta2 milestone May 1, 2024
amadeo-alex added a commit that referenced this issue May 2, 2024
… state_class) (#79)

This PR adds feature requested via #66 - ability to override device_class, unit_of_measurement and state_class for the sensors.
Important Note

Due to "tech debt" restrictions, despite advanced options being enabled for multiple value sensors (like audio sensor), the advanced settings will work only for single value sensors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants