MickMake / GoSungrow

GoLang implementation to access the iSolarCloud API updated by SunGrow inverters.
https://mickmake.com/
GNU General Public License v2.0
148 stars 42 forks source link

JSON error on HA #78

Open brockgoodall opened 10 months ago

brockgoodall commented 10 months ago

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

Krikilion commented 10 months ago

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

jamiellie commented 10 months ago

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.

Paraphraser commented 10 months ago

OK everyone. I believe I have found a workaround.

Please see this gist.

I'd appreciate feedback.

ericedberg commented 10 months ago

Same for me.

mroxso commented 10 months ago

same here

metawops commented 10 months ago

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).

lupus78 commented 10 months ago

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

jamiellie commented 10 months ago

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

metawops commented 10 months ago

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

mroxso commented 10 months ago

New version works for me as well ⚡🎉

monojk commented 10 months ago

How would I install the fix?

lupus78 commented 10 months ago

How would I install the fix?

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

monojk commented 10 months ago

How would I install the fix?

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

monojk commented 10 months ago

I tried different approaches and all fails, like:

go install github.com/MickMake/GoSungrow@v3.0.7
go: github.com/MickMake/GoSungrow@v3.0.7: github.com/MickMake/GoSungrow@v3.0.7: invalid version: module contains a go.mod file, so module path must match major version ("github.com/MickMake/GoSungrow/v3")
metawops commented 10 months ago

I tried different approaches and all fails, like:

go install github.com/MickMake/GoSungrow@v3.0.7
go: github.com/MickMake/GoSungrow@v3.0.7: github.com/MickMake/GoSungrow@v3.0.7: 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.

monojk commented 10 months ago

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/GoSungrow@v0.0.0-20230904044545-391253aaadd2):
        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/GoSungrow@v3.0.7
go: github.com/MickMake/GoSungrow@v3.0.7: github.com/MickMake/GoSungrow@v3.0.7: invalid version: module contains a go.mod file, so module path must match major version ("github.com/MickMake/GoSungrow/v3")
monojk commented 9 months ago

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