# Merge lightning history with the live feed

> Load recent flashes from the REST route, then carry on from MQTT without drawing any flash twice.

Developers · How-to guide · https://wxalerts.org/docs/developers/mqtt/merging-lightning/

The time to the millisecond and the position to four decimals are the identity
the MQTT feed uses, so a flash heard live and the same flash read from
[`GET /lightning/flashes`](/docs/api/lightning/) match exactly.

1. Load the history from the REST route.
2. Key a set on `t_ms,lat,lon` and put every historical flash in it.
3. Subscribe to the [MQTT lightning feed](/docs/developers/mqtt/lightning/) and
   drop live messages already in the set.
4. Fade flashes on `t_ms`, not on when you received them.
