andig / gravo

Grafana for Volkszaehler
https://volkszaehler.org
MIT License
15 stars 10 forks source link

json decode failed: json: cannot unmarshal string into Go struct field Target.targets.data of type grafana.TargetData #16

Closed vbartels closed 2 years ago

vbartels commented 3 years ago

Hi, I can see gravo getting the metrics. All channels I have in VZ appear. But if I choose one I get "2021/05/05 18:23:17 json decode failed: json: cannot unmarshal string into Go struct field Target.targets.data of type grafana.TargetData"

I also tried demo.volkszaehler.org, See all the channels from there, too but no data.

vbartels commented 3 years ago

Additional Info: it works with Simple JSON but not with JSON Datasource.

lindstroem165 commented 3 years ago

grafik Same here - Similar Output for you?

Pele1978 commented 2 years ago

Hello,

I'm using this great tool since a long time as well, but by updating grafana to latest version I'm getting the same error message. Is there a solution available meanwhile?

Thanks

Pele1978

neuhausf commented 2 years ago

I fixed this in my fork: https://github.com/andig/gravo/compare/master...neuhausf:gravo:master @andig Feel free to enhance and merge ;)

lindstroem165 commented 2 years ago

server.go:288:3: pr declared but not used (typecheck) pr, err := server.api.QueryPrognosis(target.Target, target.Payload.Period) ^ make: *** [Makefile:15: lint] Error 1 @neuhausf: I have "go version go1.19.3 linux/arm". You have an idea?

neuhausf commented 2 years ago

@lindstroem165 I didn‘t compile it myself - I used the github action to generate a docker image (which is public).

lindstroem165 commented 2 years ago

Unfortunalety, I haven't used that before and for me it results in errors :( The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested exec /usr/bin/gravo: exec format error I think i will debug and try to compile it locally - I have at least slightly more experience there than with github actions :D

andig commented 2 years ago

Should be fixed by https://github.com/andig/gravo/pull/17