GridProtectionAlliance / osisoftpi-grafana

Grafana Data Source Plugin for the OSIsoft PI System
https://grafana.com/plugins/gridprotectionalliance-osisoftpi-datasource
Apache License 2.0
58 stars 30 forks source link

"Use Last Value" not work #143

Closed peterprvy closed 8 months ago

peterprvy commented 8 months ago

When checkbox "Use Last Value" is checked, plugin still returned "No Data"

Recorded Data when not use last value:

image

image

When checked "Use last value" (for first two PI Points),

image

The plugin apparently expects piwebapi to return a value at the exact time, but the last value exists before that time.

The expected behavior is that the plugin will return the last values in the given interval, that means it will use the parameter 'retrievalMode=AtOrBefore'

coderReview commented 8 months ago

The last value is not using recorded endpoint. It uses GET streamsets/{webId}/value, which doesn't have the above option.

peterprvy commented 8 months ago

@coderReview

And it cannot be programmed, e.g. when 'Recorded Values' is checked? It is almost unlikely that if endTime === now that there will be a value for a tag at this time, the system would have to store tags every second and even then it will happen that your access for 'Last value' will return 'No Data '

Sorry, my english is bad, i am use translator

fsbrito-dev commented 6 months ago

@coderReview, The lastvalue actually flashes when used in the PIAF formula. I suggest creating an interpolation option, this way we would avoid losing values ​​involved in the formula.