Open wz2b opened 4 years ago
The problem is right here:
if(sensors[sensor].name == valueMaps[valueMap].name) {
The result that comes back from that query has a 'name' field that's the concatenation of a bunch of the tags. This plugin thinks the names don't match, so it never updates the value. I proved this by just eliminating that test
if(true || sensors[sensor].name == valueMaps[valueMap].name) {
and it works. Obviously, though, that's not really a solution. The right thing to do is somehow figure out how to manipulate the data source so that things come back with a name the plugin understands. I don't know how to do that.
Maybe this helps as well. This is what comes in as datList into onDataReceived. Note that the 'target' and 'alias' are both crazy ... it made those strings out of all the tags on that measurement.
[
{
"alias": "modbus pv1 address=28 gateway=10.7.4.131 register=1252",
"target": "modbus pv1 address=28 gateway=10.7.4.131 register=1252",
"datapoints": [
[
0.74,
1580327424260
]
]
}
]
Is there any reason this plugin wouldn't work with influxdb 2.0 ? I attempted this:
That gets the last value of field 'pv1' and returns it with the name 'value' which is what I think PictureIt wants to see. The metric name is A while the configuration calls it "A-Series" but I think that's the same thing.
The result of this query is
Should this work? I have a feeling the result of the query is something that the plugin just doesn't understand.