Security issue ???
I think not…
Who could possibly ‘care’ if a sensor has been on multiple stations in its lifetime ?
re: auto-pruning the WF historical data, I’d suggest caution there…I see lots of people on the weewx google group who put stations in very remote and inaccessible places that they can’t get to in the winter that might not report for many months. A blanket ‘prune stations that have not reported in NNN weeks’ would be quite excessive.
Regardless, assuming sensor-NNN is always on one and only one station throughout its lifetime, or any arbitrary data pruning timeframe, is just not reasonable. It’s simply going to happen.
Just looking at the REST API, there are a couple interesting caveats in there…
- “Smart Weather Devices all belong to a Station. This response contains Station metadata and metadata for the Devices in it. Each user can create multiple Stations. A Device can only be in one Station at a time. Only devices with a serial_number value can send new observations. A Device without a serial_number indicates that Device is no longer active.”
Just looking at your example:
- AR-00001383 is device 18133 on station 5844 AND device 10599 on station 4111.
- SK-00012108 is device 18135 on station 5844 AND device 10723 on station 4111.
If I’m reading their API docs correctly, one station should show two ‘active’ devices with a SN, and one station should two inactive devices (no SN).
What’s interesting in this case is that if you query the two station IDs, the lat/lon are the same, but the hub s/n and station description strings are different, but both stations seem to show the devices as active.
Seems like a bug on the WF side to me. They should be marking devices as inactive in the old station whenever a device is associated with a new/different station. Now how they might do that is an exercise for WF to make happen. I can think of all kinds of reasons why messing with previously-recorded station mappings would cause more pain than it prevents.
Re: how it happened, I can guess that perhaps the owner had multiple stations in one site and they moved sensors around re: which hub they were attached to…or alternately their hub was replaced and the air/sky were reassociated with a new hub and they went through the new-station process.
Re: the ‘havoc in your app’ thing - I can only guess that perhaps you have a db table trying to return a mapping of ‘which station is device-NNN on’ and it can’t deal with multiple stations having ever been associated with a particular device. Bad assumption if that’s the case.