Beginner questions: I/OLinc, and states in general

Posted on
Sun May 27, 2018 2:35 pm
dduff617 offline
Posts: 660
Joined: Jul 05, 2006
Location: Massachusetts, USA

Beginner questions: I/OLinc, and states in general

I use a I/O Lincs on my garage doors. I have a door-closed magnetic sensor attached to the input. The output provides push-button control of the garage door opener. I'm a new user of the grafana plugin and am very impressed so far. Looks like there are a lot of huge improvements with this packaged plugin and I am very encouraged!!

I saw a reference to "Explore Device" command in Plugins>Grafana> menu... So when I try this on my garage door, I see:
Code: Select all
   Grafana Home Dashboard          JSON representation of device Double Garage Door:
   Grafana Home Dashboard             name: Double Garage Door (NOT INCLUDED)
   Grafana Home Dashboard             subModel:  (INCLUDED)
   Grafana Home Dashboard             deviceTypeId:  (INCLUDED)
   Grafana Home Dashboard             measurement: device_changes (NOT INCLUDED)
   Grafana Home Dashboard             model: I/O-Linc Controller (INCLUDED)
   Grafana Home Dashboard             id: 29878231.0 (NOT INCLUDED)


Is it the case that inclusion is based on an OR of these conditions - i.e., so since I see a mix of "NOT INCLUDED" and "INCLUDED", that the final decision is that this device is included, meaning that it's data is added to InfluxDB? Or is this listing the different properties of the selected device (name, subModel, deviceTypeId, ...) and saying individually whether each is included? If so, then where are the other states of this device such as "binary input"? I really don't understand what this is trying to tell me.

Observing my Double Garage Door (I/OLinc) device in Indigo, I can see that the door closed state is the "binary input" state and it seems to take on values "open" and "closed" (at least that's how they're rendered in the Indigo UI, however I can't be sure what the underlying data values are).

So I try Plugins>Grafana>Explore state, and it gives me a long list of states in a selector menu. At this point, I am somewhat daunted and confused by the contents of this menu. Offhand, it looks to have several hundreds of items. I have a few questions specifically about states, state names, etc. I see some patterns, but can't tell what they mean or why the exist. There are many entries that look like they are simply the names of states (as I would expect). There are a huge number that look like "state.<stateName>". What are these and what does the "state." prefix mean?

BTW, I have several large blocks of states of the form "state.T[n]Forecast_*". There are roughly 40 states for each of n=0-12 (so > 500 total). Looks like these probably come from my sprinkler system plugin (Rachio). If nothing else, these are really blowing up the size of this menu! Anything I can do about this?

I observe that there are a bunch of states that end with ".num" suffix, and often (always?) the corresponding state name without the suffix. What's the difference, and when should I use one vs. the other? Are these "virtual" states created by the plugin? Are the .num states introduced by the Grafana plugin to make plotting data easier?

Now back to my original issue (I/OLinc)... From inspecting the device, it seems like I should be looking for something called "binary input". I see that there are states "binaryInputCount" and state.binaryInput1, which looks like the correct one. So I try Explore State on this and I see:
Code: Select all
   Grafana Home Dashboard          Devices containing the property state.binaryInput1:
   Grafana Home Dashboard             1. Double Garage Door ;  state.binaryInput1: True (NOT INCLUDED)
   Grafana Home Dashboard             2. L1 Radiant Control Relay ;  state.binaryInput1: False (NOT INCLUDED)
   Grafana Home Dashboard             3. L2 Radiant Control Relay ;  state.binaryInput1: False (NOT INCLUDED)
   Grafana Home Dashboard             4. L3O Shades ;  state.binaryInput1: False (NOT INCLUDED)
   Grafana Home Dashboard             5. NBR Shades ;  state.binaryInput1: True (NOT INCLUDED)
   Grafana Home Dashboard             6. Single Garage Door ;  state.binaryInput1: True (NOT INCLUDED)


So here, I'm seeing "NOT INCLUDED" next to the two devices I know I want included ("Single Garage Door" and "Double Garage Door" ). I wonder why. I try using the "Inclusion/Exclusion Criteria" tab of the Plugins>Grafana>Configure... dialog. I select "state.binaryInput1" and hit the "add" button. Seemed to work, so perhaps this will add the state I'm looking for. I'll report back if that solves the problem.

Posted on
Sun May 27, 2018 3:54 pm
vtmikel offline
Posts: 643
Joined: Aug 31, 2012
Location: Boston, MA

Re: Beginner questions: I/OLinc, and states in general

Hi-

Glad you like the plugin.

Is it the case that inclusion is based on an OR of these conditions - i.e., so since I see a mix of "NOT INCLUDED" and "INCLUDED", that the final decision is that this device is included, meaning that it's data is added to InfluxDB? Or is this listing the different properties of the selected device (name, subModel, deviceTypeId, ...) and saying individually whether each is included? If so, then where are the other states of this device such as "binary input"? I really don't understand what this is trying to tell me.


When you see a mix of "INCLUDED" and "NOT INCLUDED" for a given device, that means that the plugin is not configured to include or exclude this device specifically, so it's looking only at the specific properties and states of that device and comparing that to the list of included states that the plugin is configured for. I've included the plugin with a default set of states that are typical in Indigo. Specific devices may require adding other states. This is the typical use case for most users. I dont recommend sending all properties for any device unless carefully considering why you need all changes for that device sent to Influx.

In the output you pasted, I do not see the property "state.binaryInput1" for the Double Garage Door. But, in the explore states, it shows that "Double Garage Door" has the "state.binaryInput1". So, I would add this state to the included states list in the plugin config. Then you should see it marked as "INCLUDED" in the explore device and explore state.

So I try Plugins>Grafana>Explore state, and it gives me a long list of states in a selector menu. At this point, I am somewhat daunted and confused by the contents of this menu. Offhand, it looks to have several hundreds of items. I have a few questions specifically about states, state names, etc. I see some patterns, but can't tell what they mean or why the exist. There are many entries that look like they are simply the names of states (as I would expect). There are a huge number that look like "state.<stateName>". What are these and what does the "state." prefix mean?


Yes, the state list is daunting. However, without the explore state and explore device dialog, this is even harder to digest. Basically, the state.XXX are the custom states that the device has. I think the original Influx plugin added the "state." prefix because theoretically, a state could overlap with a device property. I haven't chosen to change that. These dialogs help you see how the plugin is turning the Indigo devices into JSON, which is what is sent to Influx. This way, you have a bit more of a clue which properties/states to add to your configuration, and how to construct your Grafana metrics.

BTW, I have several large blocks of states of the form "state.T[n]Forecast_*". There are roughly 40 states for each of n=0-12 (so > 500 total). Looks like these probably come from my sprinkler system plugin (Rachio). If nothing else, these are really blowing up the size of this menu! Anything I can do about this?


Nothing you can do, but this is how it is designed. Don't worry that the state menu is large. If you want to report a lot of states from a device that has a ton of custom states, like the Rachio plugin, or the weather plugins (both of which I use), this is why I added the option to "include devices". This is a shortcut to include ALL states for a given device, so that you dont have to add each state indivudually. It works well for these devices with a lot of custom states. However, beware. Don't use the include device without considering that every change to every state of that device is sent to Influx. While I've never seen any performance issues with my plugin, I keep it in the back of my mind that I want to limit the data going to Influx to the data that I'm actually going to look at in Grafana.

I observe that there are a bunch of states that end with ".num" suffix, and often (always?) the corresponding state name without the suffix. What's the difference, and when should I use one vs. the other? Are these "virtual" states created by the plugin? Are the .num states introduced by the Grafana plugin to make plotting data easier?


It's your choice whether you want to send the .num state or the one without this postfix. The num states usually indicate that a numeric value will always be in that field. Sometimes it makes it easier for the legend or assigning colors in Influx. I would say there is little difference.

So here, I'm seeing "NOT INCLUDED" next to the two devices I know I want included ("Single Garage Door" and "Double Garage Door" ). I wonder why. I try using the "Inclusion/Exclusion Criteria" tab of the Plugins>Grafana>Configure... dialog. I select "state.binaryInput1" and hit the "add" button. Seemed to work, so perhaps this will add the state I'm looking for. I'll report back if that solves the problem.


Once you added that, go back to the explore device, and you should see it INCLUDED.

Let me know if you have more questions, hopefully this helps.

Posted on
Sun May 27, 2018 10:33 pm
dduff617 offline
Posts: 660
Joined: Jul 05, 2006
Location: Massachusetts, USA

Re: Beginner questions: I/OLinc, and states in general

Adding the state.binaryInput1 to the included states did work and I can now track the state of the I/OLinc which shows the state of my garage door.

Posted on
Tue Jun 05, 2018 2:25 pm
dduff617 offline
Posts: 660
Joined: Jul 05, 2006
Location: Massachusetts, USA

Re: Beginner questions: I/OLinc, and states in general

I'd like to re-ask a questions that was sort of buried in my long post above:

What (if any) is the significance of the "state." part of state names? Is this merely a naming convention employed by some plugin developers?


Observations: In some cases (for example for my Nest thermostats), if I examine the device in Indigo, the state might have name "foo", but then when I look for the corresponding state in Influx/Grafana, the same state appears as "state.foo". For some other device types, however, the states I see in Indigo seem to match what I see in Grafana/Influx.

Is the Grafana plugin making the decision to prepend state names in some cases? Or is it other plugin developers (such as Nest plugin in the example I cited)?

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

Re: Beginner questions: I/OLinc, and states in general

It was in my original response, here:

Yes, the state list is daunting. However, without the explore state and explore device dialog, this is even harder to digest. Basically, the state.XXX are the custom states that the device has. I think the original Influx plugin added the "state." prefix because theoretically, a state could overlap with a device property. I haven't chosen to change that. These dialogs help you see how the plugin is turning the Indigo devices into JSON, which is what is sent to Influx. This way, you have a bit more of a clue which properties/states to add to your configuration, and how to construct your Grafana metrics.


Essentially, state.XXX are states (custom states developed by the plugin author), and the ones without that prefix are properties (part of the Indigo object model).

Posted on
Wed Jun 06, 2018 1:46 pm
dduff617 offline
Posts: 660
Joined: Jul 05, 2006
Location: Massachusetts, USA

Re: Beginner questions: I/OLinc, and states in general

Oops. My bad. I somehow missed that in your earlier response. That clears it up, thanks!

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests