-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add some device classes #71
Conversation
I noticed that "Charging time left" is now only shown as full hours in Home Assistant. The minutes are gone. I'm going to invest if this is related to my changes. |
Never paid attention to this but I also only see hours (without added device_classes). Next time I'm charging at home I'll take a look at the API responses. |
API:
In HA the state value of the sensor correctly shows the minutes too. However when looking at the history graph, or using any graph card with that entity, it only shows the whole hour (e.g. I wonder if the problem is the |
Yeah, I think the problem is that the value is not numeric. I encountered the problem, when I tried to do some calculations with the remaining charging time. I couldn't format it into anything usable, especially not into a My first attempt was to add the device class, but that didn't solve the issue. I think the correct solution is to convert it into a float value. If I find the time, I will have a look into it, but if someone else wants to fix it, I'm also fine with it 😃 |
I got this working with I have two concerns with this though:
I'm not convinced the |
Yes the logical next step is to set the state to a full 'hh:mm:ss' for easier parsing. The time/date handling in Home Assistant hasn't been consistent. |
I added
device_class
to the sensor where I could test them.If it is fine for you, I can also add more device classes to other sensors, but I will not able to test them because my car doesn't have this sensors.