Unable to use UnwrapAngle() and Evaluate() in the same query in Grafana


I’m trying to create “advanced” dashboards; which means using the “advanced” functions of the OpenHistorian connector plugin.
I manage to use the Evaluate() function to build a graph that shows the apparent power :
Evaluate(0, {sqrt((active power PMU1)²+(reactive power PMU1)²)}, queries …).
Now I want to build a graph that displays the angle deviations over time between multiple PMUs.
To start, I started by using the UnwrapAngle() function which works fine :

The next step consists in carrying out a subtraction between these two series obtained; with a ‘slice’ parameter at 0 so that it is performed on each value obtained over time. To do that, I’ve tried the following query :
Evaluate(0, {P-R}, P=UnwrapAngle([units = Degrees], PMU1_NAME:V+_V1.ANG); R=UnwrapAngle([units = Degrees], PMU2_NAME:V+_V1.ANG));

This query returns a code “500 internal server error” :

Surprisingly, when I remove the ‘UnwrapAngle()’ function from the Evaluate query, it seems to work :

Evaluate(0, {P-R}, P=PMU1_NAME:V+_V1.ANG; R=PMU2_NAME:V+_V1.ANG);

The UnwrapAngle function description tells that it can be used to to make the values mathematically comparable ; but I don’t understand why I can’t use it with the Evaluate() function.
Bug or limitation (or syntax error …) ?

The end goal is to construct a ‘reference angle’ value which would be the average of all the PMU unwrapped V+ angles I have; then display a line graph for each PMU of [Reference unwrap V+ angle value] - [unwrap V+ angle value of PMU xx] over time. But if I can’t do this calculation between 2 PMU unwrap V+ angle; I’m not sure that it’s possible to make.

Thank you very much for the help ;



Try this:

UnwrapAngle(Degrees, Evaluate(0, {P-R},