How/when do plugin's config dialogs get sync'd with Indigo?

Posted on
Tue Jun 05, 2018 2:08 pm
dduff617 offline
Posts: 403
Joined: Jul 05, 2006

How/when do plugin's config dialogs get sync'd with Indigo?

I noticed that a device I've created in the last couple of days does not show up in the menu of devices that I can exclude from InfluxDB. I've also noticed that some devices that I've renamed in Indigo over the last few days still appear in the GHD configuration dialogs under their old names.

This is understandable, but I was wondering if there is any way to bring things back into sync, i.e. to cause the GHD configuration dialogs to re-load or resync themselves from the Indigo database. I see several menu commands relating to "rebuild and restart" but they seem to be for Grafana and Influx, and therefore don't seem like they'd accomplish what I want. Should I just do to a "reload" on the plugin?

Posted on
Tue Jun 05, 2018 6:18 pm
vtmikel offline
Posts: 338
Joined: Aug 31, 2012
Location: Boston, MA

Re: How/when do plugin's config dialogs get sync'd with Indi

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.

Posted on
Tue Jun 05, 2018 11:22 pm
dduff617 offline
Posts: 403
Joined: Jul 05, 2006

Re: How/when do plugin's config dialogs get sync'd with Indi

Your explanation of how grafana and InfluxDb work w.r.t. changes in data being sent to them by the plugin (including changes to devices and/or their names) is useful and I'm sure many people will be helped by understanding this better.

I apologize for not being clearer, but in my question I was referring specifically to differences between the current state of devices in Indigo and the GHD configuration dialogs. So to explain more thoroughly, my Indigo server has been running for several months. A few weeks ago, I started using Grafana Home Dashboard plugin. A few days ago, I added a new device to my Indigo configuration. And yesterday, I decided I wanted to use the GHD configuration dialog to exclude the recently added device so that it's data is not sent to Influx. However, when I go to look for the device in the GHD configuration dialog, it is not there -- more specifically, the device does not appear in the big "Exclude specific devices:" list/menu of devices.

So my question is whether there is some way I can bring the GHD configuration dialogs back in sync with the state of my Indigo device database, perhaps by restarting the plugin or worst case, by restarting the Indigo server. Ideally, I was hoping that there was a command in the Plugins>Grafana Home Dashboard> menu that would do the job without requiring a restart.

Posted on
Wed Jun 06, 2018 12:49 pm
vtmikel offline
Posts: 338
Joined: Aug 31, 2012
Location: Boston, MA

Re: How/when do plugin's config dialogs get sync'd with Indi

Can you confirm that you do not see the device(s) in the list of available devices to exclude, AND you don't have them added to your list of included devices?

Posted on
Wed Jun 06, 2018 1:26 pm
dduff617 offline
Posts: 403
Joined: Jul 05, 2006

Re: How/when do plugin's config dialogs get sync'd with Indi

Yes, I confirm that the recently added device (a thermostat) does not appear in the include list and it does not appear in the list of devices available as candidates for exclusion.

Generally, I observe that the list of devices available in the "Exclude specific Devices:" list of candidates includes devices that I've renamed (showing up under their old names) and a handful of devices that I have deleted from my Indigo configuration in the last few days.

Posted on
Wed Jun 06, 2018 2:00 pm
vtmikel offline
Posts: 338
Joined: Aug 31, 2012
Location: Boston, MA

Re: How/when do plugin's config dialogs get sync'd with Indi

That would be odd behavior to have outdated device names in the configuration. What version are you running of the plugin, and you've reloaded the plugin to see if that resolves the refresh with the configuration dialog?

Posted on
Wed Jun 06, 2018 2:24 pm
dduff617 offline
Posts: 403
Joined: Jul 05, 2006

Re: How/when do plugin's config dialogs get sync'd with Indi

I noticed I was a minor version behind, so I just upgraded to version 1.0.1. The immediate problem I was seeing is fixed for now - the state of the lists/menus in the configuration dialog seems to be back in sync with my Indigo database.

I can't tell at this point whether this is because a) the new version fixed a bug I was seeing, b) the "fix" is simply a side-effect of reloading the plugin - i.e. I could simply have reloaded the old 1.0 version, or c) my system/configuration was simply in some unique-to-me stuck state, causing it not to update properly.

I'll try to observe carefully if I do any further renaming, deleting, or adding of devices and report what I see going forward.

Posted on
Wed Jun 06, 2018 2:25 pm
vtmikel offline
Posts: 338
Joined: Aug 31, 2012
Location: Boston, MA

Re: How/when do plugin's config dialogs get sync'd with Indi

I'm guessing you've uncovered a bug. The code that updates the list of available devices for inclusion and exclusion has not been updated in a long time. The update you recently did to 1.0.1 triggered a refresh, but it should happen automatically every 15 minutes. I'll look into it a bit.

Posted on
Wed Jun 06, 2018 3:01 pm
vtmikel offline
Posts: 338
Joined: Aug 31, 2012
Location: Boston, MA

Re: How/when do plugin's config dialogs get sync'd with Indi

Yes, it was pretty easy to find. I had an error in the logic for calculating the amount of time since a config refresh. It will be fixed in 1.0.2. Work-around is to reload the plugin, which forces a refresh.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests