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
is using native unit of measurement 'None' which is not a valid unit for the device class ('battery') #3202
Comments
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) mobile_app documentation |
Hi there @nicolaasuni 👋 Which mobile app are you using for the reported entities? As in, this is an issue with the mobile app itself, reporting incorrect values. ../Frenck |
I’m currently seeing this error from both my iPhone and my wife’s android tablet, both using the latest versions of the companion app. However, it’s not showing up for my iPad or my wife’s android phone. I’ve noticed similar messages before on the Developer Tools > Statistics page for one or more of those four devices, but it’s not consistent. They would randomly appear and disappear from the list across server restarts. My guess is the only thing different in this release is the error is being reported in the logs rather than the statistics page. |
I am using The Home Assistant app Version 2022.12.0-full. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@bobofruit1970 That is a different error, please don't stack multiple issues in a single issue. Thanks 👍
Alright, moving this issue to the Android app issue tracker, as this is not provided or taken care of in Core. This is a bug in the Android app. |
The battery state sensor shouldn't include a device class of It was removed in late 2020 (#1101), was the app added before then? Can you get the attributes from developer tools > states, which will show the all the battery state sensor details? |
@thedanbob please open a separate issue in the iOS repo so the team can look into the issue from their end. @jpelgrom while the device class is no longer being sent, its probably never removed during re-registration. Not sure if thats the something the app can do or not? @bobofruit1970 @nicolaasuni and @thedanbob for the android app to resolve this issue for now, you will need to start fresh with the app so the correct data can be loaded. https://companion.home-assistant.io/docs/troubleshooting/faqs/#starting-fresh-with-the-android-app |
@dshokouhi Thank You. After fresh installation off app "device_class: battery" disappeared. |
I'm not sure we can, I've tried sending {"type":"register_sensor","data":{"unique_id":"battery_state","state":"discharging","type":"sensor","icon":"mdi:battery-minus","attributes":{},"name":"Battery State","device_class":null,"entity_category":"diagnostic","disabled":false}} but core ignores it as it will only accept non-null values, triggering an error:
I'd argue that the validation core is performing is correct, but that does mean it is not possible to fix this without removing the device + entities on the server. |
Similar error here.
|
@CSRLabs I dont know how you ended up in the android repo, but you should file a core bug as the error suggests. These errors can only be solved by their own integration. Although the error is similar, the fix will definitely not be :) |
The problem
After upgrading to Home Assistant core 2023.1 I am seeing new WARNING logs like:
2023-01-05 11:27:47.301 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.firetablet_battery_state (<class 'homeassistant.components.mobile_app.sensor.MobileAppSensor'>) is using native unit of measurement 'None' which is not a valid unit for the device class ('battery') it is using; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mobile_app%22
This is an automatic integration and there are not manual settings I can see.
What version of Home Assistant Core has the issue?
2023.1
What was the last working version of Home Assistant Core?
2022.12.8
What type of installation are you running?
Home Assistant Core
Integration causing the issue
mobile_app
Link to integration documentation on our website
https://www.home-assistant.io/integrations/mobile_app/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: