skodaconnect / homeassistant-myskoda

Homeassistant integration for MySkoda.
85 stars 14 forks source link

Oil Service interval and Inspection Service interval are in days but displayed as time notation #291

Open MarcoGos opened 1 week ago

MarcoGos commented 1 week ago

Version 1.9.0

The Oil Service and Inspection Service are both intervals in days (default). The state of these values show 484 days but when using the tile card to display the value is shows "11616:00:00".

I think that's because both sensors have device class DURATION. If you remove the device class all together the tile card show the amount of days instead of the "11616:00:00".

WebSpider commented 1 week ago

This is in fact a bug in homeassistant-frontend:

https://github.com/home-assistant/frontend/issues/21967#issuecomment-2348814738

As soon as it's fixed in frontend, it will work for us as well... So i guess this is a known-issue at the moment.

dvx76 commented 1 week ago

@WebSpider you want to keep this open so users can find it as an known thing?

WebSpider commented 1 week ago

Indeed!

MarcoGos commented 6 days ago

For the time being you can customize these sensors a bit to show the number of days by adding the next lines to your configuration.yaml file under the tag "homeassistant:". Look at your own setup which sensor name you should use.

customize: sensor.skoda_kamiq_oil_service: device_class: None sensor.skoda_kamiq_volgend_onderhoud: device_class: None

rgjertsen commented 5 days ago

I also noticed this in my integration. What is the difference in the sensors for the old and new API? I am asking since the old integration shows days correctly while the new one shows hours.

rgjertsen commented 5 days ago

For the time being you can customize these sensors a bit to show the number of days by adding the next lines to your configuration.yaml file under the tag "homeassistant:". Look at your own setup which sensor name you should use.

customize: sensor.skoda_kamiq_oil_service: device_class: None sensor.skoda_kamiq_volgend_onderhoud: device_class: None

I tried this, but I get an error saying "none" is not an accepted value for device_class. I only get tens of examples of what are accepted.

dvx76 commented 5 days ago

I also noticed this in my integration. What is the difference in the sensors for the old and new API? I am asking since the old integration shows days correctly while the new one shows hours.

The old integration doesn't set a device_class, state_class and/or unit correctly so HA doesn't actually understand what the sensor represents and can only render it as the actual value + the unit.

Now HA understands this is a duration and the native value is stored in days.

MarcoGos commented 5 days ago

For the time being you can customize these sensors a bit to show the number of days by adding the next lines to your configuration.yaml file under the tag "homeassistant:". Look at your own setup which sensor name you should use. customize: sensor.skoda_kamiq_oil_service: device_class: None sensor.skoda_kamiq_volgend_onderhoud: device_class: None

I tried this, but I get an error saying "none" is not an accepted value for device_class. I only get tens of examples of what are accepted.

Yes, in VSC you see the error, but you can ignore it. Just restart HA and enjoy.

WebSpider commented 5 days ago

For the time being you can customize these sensors a bit to show the number of days by adding the next lines to your configuration.yaml file under the tag "homeassistant:". Look at your own setup which sensor name you should use.

customize: sensor.skoda_kamiq_oil_service: device_class: None sensor.skoda_kamiq_volgend_onderhoud: device_class: None

None is not valid in yaml, try null

rgjertsen commented 5 days ago

For the time being you can customize these sensors a bit to show the number of days by adding the next lines to your configuration.yaml file under the tag "homeassistant:". Look at your own setup which sensor name you should use. customize: sensor.skoda_kamiq_oil_service: device_class: None sensor.skoda_kamiq_volgend_onderhoud: device_class: None

None is not valid in yaml, try null

I see that both alternatives gives an error in VSC, but when rebooted, both work fine. null gives an error that it is an incorrect type. "string" is expected for device_class.

rgjertsen commented 3 days ago

I don't mean to drag this issue out, but I noticed that the interval for the services is increasing instead of decreasing. Is this a bug or am I misunderstanding something? In two days the oil change interval for my Skoda has gone from 603 days to 612 days with stops on 608 and 610 in between then and now.

WebSpider commented 3 days ago

oil change i think is actually related to car usage.

chodorenko commented 3 days ago

@rgjertsen

I don't mean to drag this issue out, but I noticed that the interval for the services is increasing instead of decreasing. Is this a bug or am I misunderstanding something? In two days the oil change interval for my Skoda has gone from 603 days to 612 days with stops on 608 and 610 in between then and now.

[offtop] This is completely normal. All modern vehicles are equipped with an oil quality sensor. The car monitors your driving style and, based on the oil quality sensor, estimates how many kilometers can be driven on the current oil.

If you drive like a Formula 1 racer, you will notice that the vehicle will require an oil change much sooner than indicated in the documentation. [/offtop]

Of course, we all expect the timing sensors to start displaying data correctly.

@WebSpider Perhaps, if you raise the issue on behalf of the project, the HA developers might respond with greater understanding, given your role as the developer of a fairly popular project, and they could address the display functionality accordingly?

Please create request on HA and post link there , all people from its project like or comment you issue on HomeAssistant