drakhart / ha-super-soco-custom

Custom component for integrating your Super Soco or Vmoto Soco motorcycle into Home Assistant. It provides meaningful data like power status, battery percentage, location and a lot more.
MIT License
17 stars 3 forks source link

Timestamps on things like last warning are several hours in the future #9

Closed apbarratt closed 1 year ago

apbarratt commented 1 year ago

Various timestamps such as the one shown for Last Warning are several hours into the future, presumably in China time without a timezone appended to them for home assistant to adjust for. The result is I'm getting entities showing things like my last warning being "in 7 hours".

I see there is a very recent commit to fix this though, so I'm not sure why it's not working for me. My installed version seems to match with the latest commit c23e642 so would include the timezone issues fixed in https://github.com/drakhart/ha-super-soco-custom/commit/d7838136e6257d6bfed7f320f341a099222bd3d4

Do let me know if there's any data I can provide to help and if there's any particular stuff I need to do to get a useful log to show you :)

I'm afraid that whilst I have had my bike for a while, the old Super Soco ECU was broken and only just replaced with a new Vmoto one a couple of days ago so I can't say if this is a new issue or not.

drakhart commented 1 year ago

Hi Andy! Thanks for taking the time to try this integration.

I thought I had solved that issue with the commit you mentioned, but you're absolutely right and the last warning also needs a timestamp correction. I'll push a fix for it soon, along with other small things I fixed in the past days.

By the way did you notice the issue in any other entity besides that one?

drakhart commented 1 year ago

Ok, I noticed that all the timestamps needed a fix except for the GPS which was already fixed. I guess they noticed they were providing wrong timestamps on their side and fixed them to be proper epoch instead of local Shanghai time.

This should be fixed in beta 11. Please let me know if it worked for you.

apbarratt commented 1 year ago

Thank you muchly, that seems to be matching up with me on British Summer Time now :) Now if only I could figure out how to convince it that the slightest tectonic tremor is not cause for alarm! I'm up to eight alerts today :( image

apbarratt commented 1 year ago

My assumption was that the time from the GPS was based on the actual time stamp received from the satellites (presumably sent in UTC and adjusted by HomeAssistant accordingly) where as all the other time stamps are based on some Chinese server time. It'd be nice if we could tweak these things to point at some self hosted server one day, but I suspect flashing these would not be quite so simple as that 😅

drakhart commented 1 year ago

If it's of any help to you I've set up an automation to relay alerts to my phone, but I've added a condition with the following template: {{ not is_state_attr("sensor.super_soco_tcmax_last_warning", "title", "Vibrating alert") }}. This way I filter out all the annoying and useless vibration alerts and just receive the important ones.

I feel like hacking the firmware will be really hard to accomplish, but if you're interested in DIY hardware there's this custom board project to send all bike data to an Android app via Bluetooth: https://github.com/Xmanu12/SuSoDevs

I'll close this issue as solved since you're now getting the correct timestamps. Thank you!