GoSungrow icon indicating copy to clipboard operation
GoSungrow copied to clipboard

JSON error on HA

Open brockgoodall opened this issue 1 year ago • 17 comments

I get the following error when starting the service gosungrow add on in HA: INFO: Login to iSolarCloud using gateway https://augateway.isolarcloud.com ... Error: json: cannot unmarshal number into Go struct field ResultData.result_data.org_id of type string

up until this morning service has been running fine

brockgoodall avatar Sep 01 '23 22:09 brockgoodall

Got same error here. What am I doing wrong?

[06:30:16] INFO: Login to iSolarCloud using gateway https://gateway.isolarcloud.eu ... Error: json: cannot unmarshal number into Go struct field ResultData.result_data.org_id of type string Usage: GoSungrow api login [flags] Examples: GoSungrow api login
Flags: Use "GoSungrow help flags" for more info. Additional help topics: ERROR: json: cannot unmarshal number into Go struct field ResultData.result_data.org_id of type string s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped

Krikilion avatar Sep 02 '23 06:09 Krikilion

Same error here [07:31:30] INFO: Login to iSolarCloud using gateway https://augateway.isolarcloud.com ... Error: json: cannot unmarshal number into Go struct field ResultData.result_data.org_id of type string

Everything worked pefectly until this morning. Looks like Sungrow updated the app with some breaking changes.

jamiellie avatar Sep 02 '23 07:09 jamiellie

OK everyone. I believe I have found a workaround.

Please see this gist.

I'd appreciate feedback.

Paraphraser avatar Sep 02 '23 13:09 Paraphraser

Same for me.

ericedberg avatar Sep 03 '23 07:09 ericedberg

same here

mroxso avatar Sep 03 '23 09:09 mroxso

Same here. I think @MickMake needs to release a new version that fixes this problem. Until then, we're doomed (or we try and use the above mentioned workaround hack).

metawops avatar Sep 03 '23 16:09 metawops

Same here. Can't wait for the new version.

lupus78 avatar Sep 03 '23 21:09 lupus78

Just installed the MickMade update. Everything seems to be fine. Thanks for all your time and effort. I really apreciate the help.

jamiellie avatar Sep 04 '23 08:09 jamiellie

Yes, everything works fine again! 👍👍 ❤️ 🙏

metawops avatar Sep 04 '23 08:09 metawops

New version works for me as well ⚡🎉

mroxso avatar Sep 04 '23 11:09 mroxso

How would I install the fix?

monojk avatar Sep 05 '23 07:09 monojk

How would I install the fix?

just install the latest version. https://github.com/MickMake/GoSungrow/releases

lupus78 avatar Sep 05 '23 07:09 lupus78

How would I install the fix?

just install the latest version. https://github.com/MickMake/GoSungrow/releases How is this done?

monojk avatar Sep 05 '23 11:09 monojk

I tried different approaches and all fails, like:

go install github.com/MickMake/[email protected]
go: github.com/MickMake/[email protected]: github.com/MickMake/[email protected]: invalid version: module contains a go.mod file, so module path must match major version ("github.com/MickMake/GoSungrow/v3")

monojk avatar Sep 06 '23 09:09 monojk

I tried different approaches and all fails, like:

go install github.com/MickMake/[email protected]
go: github.com/MickMake/[email protected]: github.com/MickMake/[email protected]: invalid version: module contains a go.mod file, so module path must match major version ("github.com/MickMake/GoSungrow/v3")

I just clicked on the "Install Update" button in Home Assistant (in Settings > Add-ons) ... 🤷‍♂️ No need to fiddle with the commandline.

metawops avatar Sep 06 '23 11:09 metawops

I use it with commandline, I don't use Home Assistant

go install github.com/MickMake/GoSungrow@latest
go: github.com/MickMake/GoSungrow@latest (in github.com/MickMake/[email protected]):
        The go.mod file for the module providing named packages contains one or
        more replace directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.

go install github.com/MickMake/[email protected]
go: github.com/MickMake/[email protected]: github.com/MickMake/[email protected]: invalid version: module contains a go.mod file, so module path must match major version ("github.com/MickMake/GoSungrow/v3")

monojk avatar Sep 06 '23 16:09 monojk

Ok, so installation does not work with go install, but from https://github.com/MickMake/GoSungrow/releases the executable GoSungrow can be downloaded.

monojk avatar Sep 08 '23 11:09 monojk