trekawek / air-quality-info

An attractive way to display air quality in your neighbourhood.
Other
49 stars 16 forks source link

FR: import_madavi for a different sensor ID (merge historical measurements for replaced device) #87

Open ProBackup-nl opened 2 years ago

ProBackup-nl commented 2 years ago

Feature request: would be nice to have.

Imagine having desployed a few sensor boxes around at not so tech savvy friends and family. Something breaks in the sensor, for example a boot failure with beta firmware (don't install beta firmware on remote devices is what I have learned over the time).

How to solve this having the friend to climb up the ladder only once? Exchange the sensor box with a spare sensor box.

The downside turns to be that there is no historical data migration possible. The older measurements are still linked to the old sensor ID.

It would be nice if the Madavi data of the old sensor ID can be imported at the new sensor ID.

trekawek commented 2 years ago

If you configure the new sensor with the /api/update/... token from the aqi.eco, the sensor ID will be updated automatically in aqi.eco device settings, as soon as the new sensor sends its first update. You can run the madavi import then.

ProBackup-nl commented 2 years ago

SensorNew is already configured with /api/update/... SensorNew data is already imported using madavi import. SensorOld data needs to be imported using madavi (into SensorNew).

I would like to (temporarily) override (the readonly sensorID) to import https://api-rrd.madavi.de/csvfiles.php?sensor=esp8266-1234old and insert that into aqi.eco sensor=1234new

trekawek commented 2 years ago

OK, I get it now. Yep, this use case makes sense.