Sonos app api timing issues

I’m using Spotify on my Sonos linked via Sonos app on my Homey.

Using the Homey cloud api v3 I would like to sync the playing time of the current song with the songtext, but the timers in the Homey Sonos app are not reliable. After pausing a song or playing next song in the middle of a song result in incorrect playing time values.

Is there a formula I can use for a reliable current playing time of a song in these cases?