joro75 / Domoticz-Toyota-Plugin

A Domoticz plugin that provides devices for a Toyota car with connected services
MIT License
6 stars 1 forks source link

Daily milleage not updated #25

Closed torpedo1975 closed 2 years ago

torpedo1975 commented 2 years ago

Hi,

Works very well and I'm happy with it, but, just a remark, if the trip is divide during the day, the Mileage is not added in the daily / monthly / yearly graph.

EX: both ways of 32Kms, it displays only 32Kms at the end of the day and not 64Km Screenshot 2021-12-01 at 09-06-38 Domoticz s Rgds,

Marc

joro75 commented 2 years ago

Hi Marc,

That is strange! In my situation it is working correctly, and the sum of all the trips that I made during a day will be shown as the daily total in the day and month graphs. I do did notice that you are using Domoticz 2021.1 build 13854. I'm still running on the original stable release 2021.1 version of Domoticz. Maybe that is causing the difference. (There are also a few other differences in the drawing of the graphs themselves, as you can see in the screenshot below). I thus do need to further investigate this problem. I will try to update to the Domoticz beta version, to see if that causes the problem.

With best regards, John

image

torpedo1975 commented 2 years ago

Hi John,

Thanks for your feedback. Just FYI, I have modified the plugin.py in order to change www.toyota-europe.com website to the Toyota.fr one as MYt is register on this one. I don't know if the problem comes from there. An other thing I have noticed is that the daily one works well as long as ther's not too much time difference between the different usage (less than 4 hours).

Rgds, Marc

joro75 commented 2 years ago

Hi Marc,

In the mean time I have updated to Domoticz Build 13872. I indeed can confirm that I now also have the different/updated graphs. The content that is shown in the graph is still correct, however I didn't drive yet since I updated the Domoticz installation. I will watch and check the graphs in the coming days.

You also mentioned that you changed the URL to the french website at Toyota.fr. That change does not have any effect on the problem you reported. I will create a separate issue to provide more links to the different language websites.

With best regards, John

joro75 commented 2 years ago

Hi Marc,

The last few days, I have been driving some unusual trips with my car. During this period, I verified the driven distances, and those distances are correctly shown in the graphs in Domoticz. Also the daily totals are correct, also on the day that I did 4 different trips .

So as far as I can see the daily mileage is updated correctly.

Are you still observing that daily mileage is not updated correctly in your situation?

torpedo1975 commented 2 years ago

Hi,

Yes, I'm still facing it, like you can see on bellow's screen shot. image

For yesterday, it should be 11Kms and not 5. Just to give you my set up, Domoticz is running on a Synology VM, with Python 3.9. An other issue I have is the update of car open/Locked, it's not updating it. Time to time I have some heart bit error, but this might be due to too many request to Toyota Server.

I'd like to thank you anyway for the time passing on this issue. For locale, I have put fr-fr, but I don't think this have an effect.

If you want me to try things or to send you logs, feel free to ask. Rgds, Marc

joro75 commented 2 years ago

Hi Marc,

Good to let me know it still is not working as expected for you. Some random remarks on your suggestions:

I have another idea, that I would like to check, so I will continue to investigate the problem.

With best regards, John

torpedo1975 commented 2 years ago

Hi John,

Thanks for the feedback. We keep in touch if you need me to test or giving you more informations.

Regarding the car open/locked state, it looks like an update error, as I can see the dummy getting data as same time as the log.

Rgds, Marc

joro75 commented 2 years ago

Hi Marc,

Sadly, I have to confirm that the problem you mentioned is indeed present. Please see the screenshot below. It also shows on my system that the total record of mileage on last Monday is not correctly accumulated.

I however do believe that this is a possible problem in the Domoticz code itself. I will continue to investigate and resolve it.

image

joro75 commented 2 years ago

I checked the changes in Domoticz itself, and there seems to be a few fixes for the graphing module, also related to the Incremental Counter that is being used for the Mileage device. See: https://github.com/domoticz/domoticz/pull/5047

These changes are included after the latest update that I did a few weeks ago, so it probably is best to update to the currently lastest Domoticz again.

Edit: I now updated to Domoticz version 2021.1 (build 13949). (Small side note: That version still has the problem that the unit is not correctly displayed for the 'Usage last week' graph)

torpedo1975 commented 2 years ago

Hi John, Thanks for the feedback. I also run the Version: 2021.1 (build 13949) and still face the issue. Marc

torpedo1975 commented 2 years ago

Hi John, Just an update for you, it looks like the after removing the 0.8 and installing the 0.81 everything is back to OK on same Domoticz version. I'll continue the test and keep you inform. Marc

joro75 commented 2 years ago

Hi Marc, Thanks for the update, and the testing of the lastest (the upcoming 0.8.1) version. It is indeed correct that I included a small change in this version to resolve the issue you reported. I included a check that prevents that an update of the Domoticz sensor is done, if a lower total mileage value is received than was received in the past. As this is theoretically not possible for an odo-meter, I can imagine that it could happen due to communication errors or caching issues.

I'm also using this new version, and it seems to work correctly, I also didn't see the problem anymore, however I have to admit that I didn't drive a lot in the last few days.

Can you confirm again that you haven't seen the problem anymore since you are using the 0.8.1 version?

Thanks in advance, and with best regards, John

torpedo1975 commented 2 years ago

Hi John,

Till now, I confirm it works well. No problem at all. The only thing left ( even if not critical at all ), is the lock status, the dummy was still created and no updated at all ( even if I receive the notification from My T app). Thanks for your work !! . Take care. Marc

joro75 commented 2 years ago

Hi Marc,

Thanks for the confirmation again. I also haven't seen the problem recently (but I didn't drive that often), I suggest that we close this issue for now. If it happens again, we can reopen it again.

BTW: I have created a new issue (#37 ) for the lock status. I'm investigating that right now.