-
Notifications
You must be signed in to change notification settings - Fork 667
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
Cannot select unit conversion in HomeAssistant #3333
Comments
@Lackmake I updated the Can you please test and see if it is ok now? |
Ok, so i played around a bit more and changed the mqtt-discovery values with a mqtt client and noticed that AIOTE does report a "unit_of_meas" and not "unit_of_measurement". See here: AI-on-the-edge-device/code/components/jomjol_mqtt/server_mqtt.cpp Lines 122 to 124 in 67c3020
When i set the device_class to "power" and fix the "unit_of_measurement" then it works as i hoped and i can select the unit in home assistant. Both fixes are needed, either one alone is not enough |
The wrong device_class probably comes from here: AI-on-the-edge-device/code/components/jomjol_mqtt/server_mqtt.cpp Lines 193 to 197 in f6fd351
I think in the if condition you wanted to set "rate_device_class" not value_state_class. Maybe a copypaste error from a few lines above :D |
This is also correct according to the specification, see Supported abbreviations in https://www.home-assistant.io/integrations/mqtt/#discovery-messages |
You are right. |
Fixed in #3332 |
Discussed in #3218
Originally posted by Lackmake September 1, 2024
I have a few smartplugs where i can manually select how HA should display the power values, like this:
For the AI-on-the-edge entities however i cannot. The option is completely missing:
What i found is that the rate-sensor is missing the "device_class" attribute. That would have to be added here for both "rates", i think "power" would be correct as thats what my smartplugs report:
AI-on-the-edge-device/code/components/jomjol_mqtt/server_mqtt.cpp
Lines 187 to 198 in 67c3020
But i am not 100% sure if that is the only reason why home assistant doesnt let me choose the unit....i also found this old thread about the "native_unit_of_measurement": https://community.home-assistant.io/t/unit-of-measurement-2022-4/409860/16
The text was updated successfully, but these errors were encountered: