- Posted on
Tue Jun 05, 2018 6:18 pm
-
vtmikel
offline
-
- Posts: 643
- Joined: Aug 31, 2012
- Location: Boston, MA
-
The plugin does not "sync" Indigo with Influx. Influx is a time series database, so the plugin sends updates to Influx when a device changes as they happen, and the plugin, nor influx, has any ability to rename or alter historical data. Also Influx is not relational, so it's not linked to a common device name throughout that is referenced. The device name is sent with every update / piece of data. That's actually against the whole premise of a time series database. Once an update is sent to Influx, the plugin is hands off and does not touch the data in Influx. Grafana visualizes what is available in Influx.
Here's an example of what gets sent to Influx:
{
"name": "My device",
"sensorValue:": 10,
"measurement": "device_changes"
more included states...
}
Influx adds the timestamp to the data.
So, I think with your question, two things are happening:
1. The plugin subscribes to all device changes for all your indigo devices. When a new device is added, like any device, it processes the updates accordingly. Meaning, any states that are in the "include" list are sent to Influx. That means, data from that brand new device, probably before you rename it, is sent to Influx. Once this happens, the data is there and there's no changing that without manually deleting the data.
With that said, I dont find this personally to be a problem. That minor blip of data is easy to ignore in your Grafana dashboard, especially if you typically look at a 24 hour or 1-week window for your graphs. Once you are outside of the window for the change you made, the device will disappear from your visualizations. For example, what if you originally named your device "Foyer motion sensor" and renamed it to "Front hallway motion sensor". If you have a grafana query that looks for /motion sensor/ then this device will show up twice. If you are graphing only the last 24 hours, the original device will disappear from your graph once it's been more than 24 hours and you haven't seen any updates from the originally named "Front hallway motion sensor".
2. When you create new metrics in Grafana, Grafana tries to help you by poping up suggestions for things like varname = <popup window with variable names> or name = <popup window with device names>. This will have the names of every device you have in indigo, as well as devices you used to have and are now gone. Again, since Influx is a time series database, and it keeps a record of the names of devices as it happens, it's showing you a larger list than you need. For the most part, just ignore the old device names.
3. In terms of the Configuration dialog, the device list is rebuilt every 15 minutes. A reload forces this immediately if you are impatient to wait. Also, beware that if you add a device to the include device list, it's removed from the available devices on the exclude device list, and vice versa.