Unifi plugin devices selectable in Metrics, but don't chart

Posted on
Mon May 14, 2018 12:09 pm
Different Computers offline
User avatar
Posts: 2541
Joined: Jan 02, 2016
Location: East Coast

Unifi plugin devices selectable in Metrics, but don't chart

Unifi plugin devices and folders don't seem to be charting. When I select them in Metrics either by folder name (using a UNIFI plugin only folder), by explicit actual name as shown in the Metrix drop down, or by a regex that should equal any phone, the chart for them in the dashboard remains stubbornly blank.

Is this an incompatibility between plugins, or perhaps some problem with the device states that I haven't mapped properly?

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Mon May 14, 2018 12:13 pm
vtmikel offline
Posts: 643
Joined: Aug 31, 2012
Location: Boston, MA

Re: Unifi plugin devices selectable in Metrics, but don't ch

Can you do a few things:

1. Use the Device Explorer (plugin menu) and explore the device(s) in question. Do you see the states and values marked as included?
2. Confirm that you don't have any data filters set up. Since they are a recent implementation in the plugin, I'd recommend removing them, or at least enable logging, to diagnose would be smart.
3. Check the plugin debug log and see if there are any problems there. If the plugin has a problem with a value or type, it will continue on silently, but will log to the debug log.

If all else fails, we can enable debugging, including the transport logging, for about 15 minutes, and send me the log.

Posted on
Mon May 14, 2018 12:22 pm
Different Computers offline
User avatar
Posts: 2541
Joined: Jan 02, 2016
Location: East Coast

Re: Unifi plugin devices selectable in Metrics, but don't ch

Here's a start
Code: Select all
 Grafana Home Dashboard          JSON representation of device Mike iPhone SE:
   Grafana Home Dashboard             subModel:  (INCLUDED)
   Grafana Home Dashboard             protocol: 999.0 (NOT INCLUDED)
   Grafana Home Dashboard             state.MAC: a4:f1:e8:12:f1:1a (NOT INCLUDED)
   Grafana Home Dashboard             configured: True (NOT INCLUDED)
   Grafana Home Dashboard             address: a4:f1:e8:12:f1:1a (NOT INCLUDED)
   Grafana Home Dashboard             state.lastStatusChange: 2018-05-13 20:40:02 (NOT INCLUDED)
   Grafana Home Dashboard             displayStateValUi: up         05-13 20:40:02 (NOT INCLUDED)
   Grafana Home Dashboard             pluginId: com.karlwachs.uniFiAP (NOT INCLUDED)
   Grafana Home Dashboard             buttonGroupCount.num: 0.0 (NOT INCLUDED)
   Grafana Home Dashboard             measurement: device_changes (NOT INCLUDED)
   Grafana Home Dashboard             lastSuccessfulComm: 1526321672.0 (NOT INCLUDED)
   Grafana Home Dashboard             state.lastStatusChangeReason: MSG WiFi up (NOT INCLUDED)
   Grafana Home Dashboard             buttonGroupCount: 0.0 (NOT INCLUDED)
   Grafana Home Dashboard             state.powerMgmtWiFi: True (NOT INCLUDED)
   Grafana Home Dashboard             state.groupMember: Group0 (NOT INCLUDED)
   Grafana Home Dashboard             supportsAllOff: False (NOT INCLUDED)
   Grafana Home Dashboard             errorState:  (NOT INCLUDED)
   Grafana Home Dashboard             state.upDownSetting: WiFi/Optimized-idle:180-exp:420 (NOT INCLUDED)
   Grafana Home Dashboard             configured.num: 1.0 (NOT INCLUDED)
   Grafana Home Dashboard             deviceTypeId: UniFi (INCLUDED)
   Grafana Home Dashboard             enabled.num: 1.0 (NOT INCLUDED)
   Grafana Home Dashboard             id: 453179804.0 (NOT INCLUDED)
   Grafana Home Dashboard             folderId: 960204446.0 (NOT INCLUDED)
   Grafana Home Dashboard             state.vendor: APPLE, INC. (NOT INCLUDED)
   Grafana Home Dashboard             displayStateId: displayStatus (NOT INCLUDED)
   Grafana Home Dashboard             state.noiseWiFi.num: -114.0 (NOT INCLUDED)
   Grafana Home Dashboard             displayStateImageSel: 601.0 (NOT INCLUDED)
   Grafana Home Dashboard             state.name: iPhone-SE (NOT INCLUDED)
   Grafana Home Dashboard             supportsStatusRequest: False (NOT INCLUDED)
   Grafana Home Dashboard             folderId.num: 960204446.0 (NOT INCLUDED)
   Grafana Home Dashboard             state.signalWiFi: -105 (NOT INCLUDED)
   Grafana Home Dashboard             state.signalWiFi.num: -105.0 (NOT INCLUDED)
   Grafana Home Dashboard             remoteDisplay.num: 0.0 (NOT INCLUDED)
   Grafana Home Dashboard             description: 192.168.0.017-Mikes-iPhone-SE=WiFi (NOT INCLUDED)
   Grafana Home Dashboard             id.num: 453179804.0 (NOT INCLUDED)
   Grafana Home Dashboard             supportsAllLightsOnOff.num: 0.0 (NOT INCLUDED)
   Grafana Home Dashboard             state.AP: 192.168.0.123-#0 (NOT INCLUDED)
   Grafana Home Dashboard             state.GHz.num: 2.0 (NOT INCLUDED)
   Grafana Home Dashboard             state.stateWiFi.num: 11111.0 (NOT INCLUDED)
   Grafana Home Dashboard             state.rx_tx_RateWiFi: 12000/65000 [Kb] (NOT INCLUDED)
   Grafana Home Dashboard             state.stateWiFi: 00011111 (NOT INCLUDED)
   Grafana Home Dashboard             state.noiseWiFi: -114 (NOT INCLUDED)
   Grafana Home Dashboard             state.status: up (NOT INCLUDED)
   Grafana Home Dashboard             name: Mike iPhone SE (NOT INCLUDED)
   Grafana Home Dashboard             supportsStatusRequest.num: 0.0 (NOT INCLUDED)
   Grafana Home Dashboard             lastChanged: 1526321672.0 (NOT INCLUDED)
   Grafana Home Dashboard             state.SW_Port:  (NOT INCLUDED)
   Grafana Home Dashboard             state.GHz: 2 (NOT INCLUDED)
   Grafana Home Dashboard             enabled: True (NOT INCLUDED)
   Grafana Home Dashboard             state.ipNumber: 192.168.0.17 (NOT INCLUDED)
   Grafana Home Dashboard             supportsAllOff.num: 0.0 (NOT INCLUDED)
   Grafana Home Dashboard             remoteDisplay: False (NOT INCLUDED)
   Grafana Home Dashboard             supportsAllLightsOnOff: False (NOT INCLUDED)
   Grafana Home Dashboard             state.displayStatus: up         05-13 20:40:02 (NOT INCLUDED)
   Grafana Home Dashboard             displayStateValRaw: up         05-13 20:40:02 (NOT INCLUDED)
   Grafana Home Dashboard             state.created: 2016-10-07 14:31:19 (NOT INCLUDED)
   Grafana Home Dashboard             model: UniFi (INCLUDED)


Lots of "Not included" there. All I'm trying to do is show it as present/absent up/down whatever.

By data filters, do you mean excluded devices? I don't know what that is otherwise, so I'm pretty darn sure I haven't implemented them.

Doesn't seem to be much in the plugin log:
Code: Select all
2018-05-14 14:20:12.304   DEBUG   Plugin.checkServerStatus:   completed checkServerStatus(), GrafanaServerStatus: started, InfluxServerStatus: started
2018-05-14 14:20:12.304   DEBUG   Plugin.CheckInfluxAuthConfig:   running CheckInfluxAuthConfig()
2018-05-14 14:20:12.305   DEBUG   Plugin.CheckInfluxAuthConfig:   now reviewing Influx config section: [meta]
2018-05-14 14:20:12.305   DEBUG   Plugin.CheckInfluxAuthConfig:   now reviewing Influx config section: [data]
2018-05-14 14:20:12.305   DEBUG   Plugin.CheckInfluxAuthConfig:   now reviewing Influx config section: [coordinator]
2018-05-14 14:20:12.306   DEBUG   Plugin.CheckInfluxAuthConfig:   now reviewing Influx config section: [retention]
2018-05-14 14:20:12.306   DEBUG   Plugin.CheckInfluxAuthConfig:   now reviewing Influx config section: [shard-precreation]
2018-05-14 14:20:12.306   DEBUG   Plugin.CheckInfluxAuthConfig:   now reviewing Influx config section: [monitor]
2018-05-14 14:20:12.306   DEBUG   Plugin.CheckInfluxAuthConfig:   now reviewing Influx config section: [subscriber]
2018-05-14 14:20:12.306   DEBUG   Plugin.CheckInfluxAuthConfig:   now reviewing Influx config section: [http]
2018-05-14 14:20:12.306   DEBUG   Plugin.CheckInfluxAuthConfig:      found that InfluxDB auth is enabled
2018-05-14 14:20:12.307   DEBUG   Plugin.UpdateAll:   running UpdateAll()
2018-05-14 14:20:13.400   DEBUG   Plugin.UpdateAll:   completed UpdateAll()
and more like that

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Mon May 14, 2018 12:28 pm
vtmikel offline
Posts: 643
Joined: Aug 31, 2012
Location: Boston, MA

Re: Unifi plugin devices selectable in Metrics, but don't ch

So, is this the state you are looking for?

Grafana Home Dashboard state.status: up (NOT INCLUDED)

It looks like this plugin doesn't make use of the onOffState, generic state, that many Indigo device templates use, and is included in the default states that are sent to Influx when you install the plugin. The "up/down" state is in the "state.status". Therefore, all you need to do is add the "state.status" to the include states of the plugin configuration (in the plugin config). Then, this is what you use use in your Grafana metric. Alternatively, you could include your Unifi devices, which will send all states for those devices. But, since they are network devices and have a lot of properties, the best option is to include the "state.status" so any Unifi device will send that information without having to be directly added.

This is the reason why I built the Explore Device and Explore State functions. Otherwise, it's very hard to figure out your Grafana metric query.

Posted on
Mon May 14, 2018 1:22 pm
Different Computers offline
User avatar
Posts: 2541
Joined: Jan 02, 2016
Location: East Coast

Re: Unifi plugin devices selectable in Metrics, but don't ch

Brilliant!

At least in theory, that's easy. Since the state wasn't included until I just added it, does the db have to log some data now, before it starts showing up?

EDIT: Answering my own question. YES. And it's working perfectly now. This is an amazing piece of work, sir!

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests