Hi, I'm working on a mapping project showing sensor data on a map. The data is received via MQTT and works very nicely on dynamic input.
Now I'm looking to make the last values persistent on the map. I estimate I will have no more than 200 sensors; each may have up to 10 values e.g. temperature, long, lat., and so on.
Further, I may have 50 geo-fences. I would like to store them and when the map is reloaded display them.
Q: What would be the best way of storing this data? Context store, CSV file, or Influx DB?
I use InfluxDB2 to store the sensor data already but would need some help with how to store the geofences and points that are inserted manually.
Many thanks in advance for your help.
Big shout to the developer of this plugin, you have done an outstanding job!
Doesn't sound like too much data to keep in memory. So a persisted context store would probably work. That way, the data is always to hand but will be regularly dumped to a JSON file for you. You can adjust the frequency of the dump in settings.js if you need to (I think that the default is 30sec).
You might want to look at GeoJSON which I believe is a standard. Not sure what the worldmap node needs but hopefully it supports it.
if you just store the points in a context variable as suggested, using the msg.payload.name as the key then you can easily replay them back into the map on a restart. (no need for geojson, just store them as you currently send them - though the map can handle geojson if you really want to convert )