You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it perhaps be possible to add a sensor that holds information about the last trip?
The necessary functions are already present in the mytoyota python library, but this data is not retrieved by ha_toyota.
I think it would be nice to have a sensor, with:
timestamp of the last trip as the state
summary and statistics as extra attributes
I personally believe only the last trip should be added as a sensor, as adding older trips would become too messy.
Kind regards,
Bert
The text was updated successfully, but these errors were encountered:
Hello @BertVereecke, in principle that would be interesting.
The problem here, however, is that Toyota does not have an independent API for querying the last trip. You can only make requests to the Toyota Trips API that contain a from_date and to_date and then get back all trips that are within this period.
Now, of course, we don't know when your last trip took place, for example. You could have been travelling 3 days ago, but also 1 month or 1 year ago.
Toyota itself stores the trip data for 1 year. We would therefore have to retrieve all trip information for 1 year each time and filter for the last trip in it. In my initial opinion, this would probably cause too much load.
It's possible. I already implemented that & currently testing with few other options, like sending remote commands. API takes offset & limit, so knowing the limitations, we can ask for 1 entry in the last 90 days (I thinks this period should have some entries). API seems to be sorting trips descending, so asking for only one will return the 'last trip' we need.
Would it perhaps be possible to add a sensor that holds information about the last trip?
The necessary functions are already present in the mytoyota python library, but this data is not retrieved by ha_toyota.
I think it would be nice to have a sensor, with:
I personally believe only the last trip should be added as a sensor, as adding older trips would become too messy.
Kind regards,
Bert
The text was updated successfully, but these errors were encountered: