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

Setting device_class attribute for some sensors #9

Closed
kaizersoje opened this issue Feb 20, 2022 · 3 comments
Closed

Setting device_class attribute for some sensors #9

kaizersoje opened this issue Feb 20, 2022 · 3 comments

Comments

@kaizersoje
Copy link
Contributor

Is it possible to set the device_class for some sensors? I know this can be done in the customize section but I think it is better if they are set during creation.

entity device_class
sensor.astroweather_2m_relative_humidity humidity
sensor.astroweather_2m_temperature temperature
sensor.astroweather_moon_next_rising timestamp
sensor.astroweather_moon_next_setting timestamp
sensor.astroweather_sun_next_rising timestamp
sensor.astroweather_sun_next_setting timestamp
sensor.astroweather_sun_next_rising_astronomical timestamp
sensor.astroweather_sun_next_setting_astronomical timestamp
sensor.astroweather_timestamp timestamp

I guess the one issue I can see is that the timestamp entities may not be in the correct ISO8601 format.

@mawinkler
Copy link
Owner

Hi, you're absolutely correct. I guess I missed that for the reason, that most sensors do not have a fitting device_class. For the ones with a match, I will include them in the next version.

@tomlut
Copy link

tomlut commented Feb 23, 2022

There's an issue with the lifted index device class.

Logger: homeassistant.components.sensor.recorder
Source: components/sensor/recorder.py:259
Integration: Sensor (documentation, issues)
First occurred: 12:30:10 (1 occurrences)
Last logged: 12:30:10

sensor.astroweather_lifted_index has unit ° which is unsupported for device_class temperature

@mawinkler
Copy link
Owner

Both fixed in release v0.20.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants