Your MQTT lightning feed keeps nothing and
replays nothing, so a client that has just connected has no strikes from before
it did. GET /lightning/flashes reads the last hours
back. The time to the millisecond and the position to four decimals identify a
flash in both, so one heard live and the same one read from the route match
exactly.
- Start your MQTT client and subscribe first, so nothing falls in the gap.
- Load the history from the REST route for the box you care about.
- Key a set on
t_ms,lat,lon(for a live strike,tas epoch milliseconds with itslatandlon) and put every historical flash in it. - For each live strike, skip it if its key is already in the set, and add it if not.
- Fade flashes on
t_ms, not on when you received them.