wubbl0rz / FiatChamp

FIAT (uconnect) Home Assistant Addon 🚗
https://github.com/wubbl0rz/FiatChamp
MIT License
98 stars 23 forks source link

Timestamps Fiat 500e which format ? #42

Closed heidasch closed 1 year ago

heidasch commented 1 year ago

Hi,

I get timestamps from my Fiat 500e such as car_evInfo_timestamp = 1678431056968. Could anyone advise me what format that is and how I could show it in HA in a way, a human could understand ?

Thanks

Wolfgang

wubbl0rz commented 1 year ago

looks like unix time in milliseconds. so its milliseconds elapsed since 1.1.1970 UTC. in home assistant it should be convertible with a template sensor or template card in the frontend. i don't know off the top of my head how exactly.

but does this timestamp mean anything important ? looks like a generic timestamp thats internally used by the fiat app to show last refresh time or something like that.

heidasch commented 1 year ago

Thanks for the info wubbl0rz. I'll try and let you know. As far as I wasn't able to decode the values in the past I have no clue what they could mean. In fact there are three (different) timestamps: car_evInfo_timestamp=1678431056968 car_timestamp=1678431056968 car_vehicleInfo_timestamp=1678430828730

Regards

Wolfgang

heidasch commented 1 year ago

You're right wubbl0rz. It's UTC+1 plus the value, which is in milliseconds. The two different timestamps have a delta of around 3 minutes, no clue why and what that represents. Both values are around the time when the car was last connected via mobile.

heidasch commented 1 year ago

Here's my HA-Code that works for me:

Car timestamp

Offers me the timestamp on the surface like this: 13.03.23 09:15

Regards and thanks

Wolfgang

wubbl0rz commented 1 year ago

nice good to know :smile: what is your use case with the timestamp or why do you want to see it ? does it give any meaningful information ?

heidasch commented 1 year ago

Well, this timestamp seem to be the timestamp when all the data has been updated the last time. That's important for me, as my car is normally placed in my basement garage. The car uses mobile radio to communicate its data to the server. The car has a wifi module built in, though it doesn't use it to send its data. So, in my garage I have simply no connection. With the timestamp I see when the data has been fetched and so I have an idea, how good that (old) data is. I have extended my wifi to the garage but I have no mobile coverage. So, my pretty modern, new car is simply disconnected when I am at home and e.g. want to know how much energy is left before I start the charging process (because I like to charge not more than 80 %).

wubbl0rz commented 1 year ago

ah nice good to know :smile: