question

craig-westlake avatar image
craig-westlake asked

Grafana - PV Current - how to query?

I am trying to get the Solar Panel Current to a dashboard in Grafana.


I see from the Dbus documentation that the current measurement was depreciated

deprecated per v2.80:  
/Pv/I  <- PV current (= /Yield/Power divided by /Pv/V) 
/Pv/x/I

So I take from this that the current will need to be calculated. I am not sure how to do this in Grafana and InfluxDb Query Language. I am just starting on this learning curve so I suspect I have missed one of the fundamentals.

Do I need to query each measurement independently store them in variables and then do the calculations on those? My gut tells me there is a simpler way.

Also, can I assume that both the /Yield/Power value and the /Pv/V value will have the same timestamps? i.e. if I use the last(power) /l ast(voltage) will I get necessarily get the last(current)

This is probably going to be simple for one (or most) of you but I am scratching my head.


grafanadashboard
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

2 Answers
Fideri avatar image
Fideri answered ·

@Craig Westlake

Did you find a solution? I have a second similar problem. If I type "solarcharger/PV/Yield" (obviously without the quotes" I get a "no data" response. But the default "solarcharger/DC/0/Current" works though I'm not looking for that value.

F.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

johnny-brusevold avatar image
johnny-brusevold answered ·

This query shows the yield for one of my mppt solar controllers in grafana. You may be able to modify this as needed.

SELECT mean("value") FROM "solarcharger/Yield/Power" WHERE ("instanceNumber"::tag = '289') AND $timeFilter GROUP BY time($__interval) fill(null)
SELECT mean("value") FROM "solarcharger/Dc/0/Current" WHERE ("instanceNumber"::tag = '289') AND $timeFilter GROUP BY time($__interval) fill(null)
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Fideri avatar image Fideri commented ·

@Johnny Brusevold

That too could work. Before I saw it , I experimented with varying the query parts. Surprisingly, that worked! So the order matters.

F.

0 Likes 0 ·