This gist is intended to help you deal with the following error conditions:
-
Error: appkey is incorrect 'er_invalid_appkey -
Error: unknown error 'Request is not encrypted' -
nil pointer exceptions while fetching battery information
-
missing device_type arguments
-
Home Assistant log errors with wording like:
The configuration uses the deprecated option object_id to set the default entity id. Replace with default_entity_id
This gist has a number of parts which, because of the way in which this gist has grown over time, are not necessarily in a logical order.
The instructions you should follow depend on what you want to do:
| Part | Explains how to |
|---|---|
| Partย 1 | recompile GoSungrow from its source code. This includes the patches that solve all the error conditions listed above. |
| Partย 2 | removed - this approach will stop working in Home Assistant Core 2026.4. |
| Partย 3 | use a pre-compiled patched binary outside of Home Assistant. This lets you run GoSungrow from your Terminal command line. |
| Partย 4 | use a pre-built Docker image outside of Home Assistant. |
| Partย 5 | patch the broken Docker add-on for use in Home Assistant. |
Parts 2, 3 and 4 are independent do not require you to follow the steps in Partย 1 and recompile GoSungrow yourself. The instructions in these parts assume you are using one of the triamazikamno images as your starting point. However, the final result only deals with the "appkey is incorrect" and "request is not encrypted" errors.
Partย 5 depends on you first recompiling GoSungrow yourself by following the steps in Partย 1. Partย 5 then explains how to construct a new add-on image for Home Assistant which includes the recompiled binary. The result deals with all four error conditions listed above.
The reason this gist has a multi-part structure is historical.
The first version of this gist answered the question, "how do I recompile GoSungrow from its source code?" That material became Partย 1.
Partย 2 went through several revisions including using a Dockerfile plus the results of recompiling as per Partย 1 to produce a new local image for Home Assistant. When triamazikamno provided patched Docker images, Partย 2 was replaced with simpler (!) instructions.
Partย 3 was added following a suggestion by xpufx which further leverages the work done by triamazikamno and avoids the need for recompiling GoSungrow from its source code.
Partย 4 was added following a comment by Lmecano which identified a use-case for deploying the Docker images outside of the confines of Home Assistant.
Partย 1 was amended to explain how to include pull requests 108, 137 and 138, alongside the fixes from the triamazikamno encryption branch.
Partย 5 was added so that the "fully patched" binary could be used in Home Assistant, effectively replacing Partย 2.
So long as you do not encounter either the nil pointer exceptions while fetching battery information or missing device_type arguments problems, Partsย 2, 3 and 4 remain valid.
These instructions have been tested on macOS (Darwin) and Raspberry Pi OS (Debian). The Go compiler can be installed on Windows but I don't have any way of testing that.
gitis installed.wgetis installed.
If you are recompiling GoSungrow so that you can then proceed to Partย 5 and rebuild the Home Assistant GoSungrow add-on, you can follow these Partย 1 instructions on either a support host (Linux, macOS, Windows), or your Home Assistant instance using the Advanced SSH & Web Terminal.
The advantages of compiling on your HA instance are:
- the Go compiler will compile for the correct hardware architecture automatically. You will not have to worry about cross-compiling to account for any differences between your support host and the hardware on which your Home Assistant instance is running; and
- the compiled binary will already be on your HA instance so there will be no need to try to figure out how to copy the binary from your support host onto your HA instance.
The disadvantages are:
- the specs for support hosts tend to be "big and beefy" whereas Home Assistant is typically deployed on Watts-conserving hardware. This means that compilation will be fairly slow (minutes); and
- the "scaffolding" you put in place (the Go compiler and the GoSungrow source tree) will disappear the next time the Advanced SSH & Web Terminal add-on is re-created.
Given that you are unlikely to be doing this every day, the advantages may well outweigh the disadvantages. It's up to you to decide.
-
Create the "go" sub-directory in your home directory:
$ mkdir -p ~/go -
Add the following lines to your
~/.bashrcor~/.profileas is your preference:#======================================================================= # Senses if the go compiler is installed #======================================================================= GO_BIN=/usr/local/go/bin if [ -x "$GO_BIN/go" ] ; then export GOPATH="$HOME/go" export PATH="$PATH:$GO_BIN:$GOPATH/bin" fi unset GO_BIN
Tips:
- If you copy/paste into a Windows text editor, make sure your editor saves with Unix (
โ: 0x0A) line endings, rather than Windows (โโ0x0D 0x0A). Alternatively, use a tool likedos2unixto post-process the file. - If you are doing all this on your Home Assistant instance, you must use
~/.profile.
- If you copy/paste into a Windows text editor, make sure your editor saves with Unix (
-
Open your browser at the Go downloads page.
-
Choose an appropriate image. Example:
$ URL=https://go.dev/dl/go1.26.1.linux-amd64.tar.gz $ TARGZ=$(basename $URL)
-
Also make a note of the SHA256 checksum and assign it to a variable. Example:
$ HASH=031f088e5d955bab8657ede27ad4e3bc5b7c1ba281f05f245bcc304f327c987a -
Download the image:
$ wget $URL -
Verify the checksum:
$ sha256sum -c <<< "$HASH *$TARGZ" go1.26.1.linux-amd64.tar.gz: OK
-
Install the compiler (replacing any older version):
$ sudo rm -rf /usr/local/go $ sudo tar -C /usr/local -xzf $TARGZ
- Open your browser at the Go download and install page.
- Click the "Download" button, then pick the correct installer (
ARM64for Apple Silicon,x86-64for Intel silicon). - Run the installer package from your Downloads folder. This installs/updates as appropriate.
Tip:
-
If you have an older version of Go installed via HomeBrew, you can remove it with:
$ brew uninstall goHomeBrew does not install the Go compiler in
/usr/local/go/bin. You will need to adapt the login script commands if you want to use HomeBrew to install/update Go.
See download and install page.
-
Logout and login again so the new login script commands run.
-
Confirm that GOPATH returns a sensible result:
$ echo $GOPATH /home/pi/go
-
Confirm that the compiler is present:
-
Linux:
$ go version go version go1.26.1 linux/amd64
-
macOS:
$ go version go version go1.26.1 darwin/amd64
-
-
Check that Git knows who you are:
$ git config user.name $ git config user.email
If you get null or silly answers (eg the second command returns
user.name) then please run the following commands, substituting appropriate values for your name and email address:$ git config --global user.name "ยซyourNameHereยป" $ git config --global user.email "ยซyourEmailAddressHereยป"
The values you supply here do not have to be valid. They do not get sent anywhere. What these commands do is initialise
~/.gitconfig. If you have been using Git for any length of time, that file will almost certainly exist already. -
Construct the following directory structure:
$ mkdir -p ~/go-projects/MickMake -
Clone the GoUnify repository:
$ cd ~/go-projects $ git clone https://github.com/MickMake/GoUnify.git
-
Clone the GoSungrow repository:
$ cd MickMake $ git clone https://github.com/MickMake/GoSungrow.git
-
Move into the GoSungrow directory:
$ cd GoSungrow -
-
Point to the
triamazikamnofork of the GoSungrow repository and fetch theencryptionbranch from that fork:$ git remote add -t encryption triamazikamno https://github.com/triamazikamno/GoSungrow.git $ git fetch triamazikamno encryption
-
Fetch various Pull Request branches which have been submitted to the GoSungrow repository:
$ git fetch origin pull/108/head:PR108 $ git fetch origin pull/137/head:PR137 $ git fetch origin pull/138/head:PR138 $ git fetch origin pull/144/head:PR144
-
Create a local branch to hold the results of merging the various patches
$ git checkout -b patch-set -
Merge the patches in date order:
$ git merge -m "apply PR108" PR108 $ git merge -m "apply triamazikamno/encryption" triamazikamno/encryption $ git merge -m "apply PR137" PR137 $ git merge -X theirs -m "apply PR138" PR138 $ git merge -m "apply PR144" PR144
PR138 causes a conflict (with some comment lines) so the
-X theirsoption tells Git to prefer the incoming pull request.
-
-
Compile GoSungrow for your native architecture:
$ go mod tidy $ go build
Both commands can take time to complete. Compiling GoSungrow depends on the clock speed of your hardware and the number of CPU cores available. Please be patient!
If the hardware architecture of your support host differs from that of the host where you want to deploy GoSungrow then you will need to cross-compile for your final target platform. One example might be where your support host uses an Intel chip while your Home Assistant instance is running on an ARM chip (eg Raspberry Pi). Cross-compiling is explained later.
The next three steps tell you to run GoSungrow like this:
./GoSungrowThe ./ prefix means "run the just-recompiled binary from the working directory". Please do not make the mistake of omitting the ./ prefix because that risks executing an older version of GoSungrow that does not have any of the patches.
$ ./GoSungrow version
GoSungrow v3.0.7
Self-manage this executable.
Usage:
GoSungrow version
GoSungrow version [command]
Examples:
GoSungrow version
Available Commands:
check Version - Check and show any version updates.
list Version - List available versions.
info Version - Info on current version.
latest Version - Info on latest version.
update Version - Update version of this executable.
Flags: Use "GoSungrow help flags" for more info.
Additional help topics:
Use "GoSungrow version help [command]" for more information about a command.If you followed the optional step to apply the patches, you will also need to update the APPKey on any system where you intend to run GoSungrow. See APPKey configuration.
Follow the instructions to set your iSolarCloud gateway configuration.
You can confirm everything is working by running:
$ ./GoSungrow api login
Email: you@yourdomain.com
Create Date: Thu Feb 09 13:14:55 CST 2023
Login Last Date: 2023-12-07 12:42:57
Login Last IP:
Login State: 1
User Account: something
User Id: 999999
User Name: someone
Is Online: false
Token: 999999_99999999999999999999999999999999
Token File: /home/pi/.GoSungrow/AppService_login.jsonThis section is optional. If you don't need to cross-compile, skip down to using the recompiled binary.
I want to run GoSungrow on a Raspberry Pi. Although I can install the Go compiler (as above) and compile GoSungrow on the Pi, it is much faster to do the work on macOS. All these commands are run on macOS:
-
Cross-compile for 64-bit Raspberry Pi OS:
$ GOOS=linux GOARCH=arm64 go build -o GoSungrow-linux-arm64I am told that the Windows
powershellequivalent of the above is:$env:GOOS="linux"; $env:GOARCH="arm64"; go build -o GoSungrow-linux-arm64 -
Copy compiled binary to target Raspberry Pi system ("iot-hub"):
$ scp GoSungrow-linux-arm64 iot-hub:./GoSungrow GoSungrow-linux-arm64 100% 90MB 90.0MB/s 00:01
-
Check result:
$ ssh iot-hub file GoSungrow GoSungrow: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=T7VxiW_Bb7zpmTzK5Gjk/ek581bp4wUYxRJpI4LW7/67TEDExnbLJooHJ3cURP/8Pi_onP5w88QBDpLdkcP, with debug_info, not stripped
-
Comparison with "native" compile on macOS:
$ file GoSungrow GoSungrow: Mach-O 64-bit executable x86_64
Copy the script below and paste into a file named build-all.sh:
#!/usr/bin/env bash
compile_for() {
echo "Compiling for $1/$2"
GOOS=$1 GOARCH=$2 go build -o GoSungrow-${1}-${2}
}
go clean
compile_for darwin amd64
compile_for darwin arm64
compile_for linux amd64
compile_for linux arm64
if [ -n "$(which lipo)" ] ; then
echo "Constructing universal binary for macOS"
lipo -create -output GoSungrow-mac GoSungrow-darwin-amd64 GoSungrow-darwin-arm64
fiThe build-all.sh script should be at the path:
~/go-projects/MickMake/GoSungrow/build-all.sh
Give the file execute permission and run it:
$ cd ~/go-projects/MickMake/GoSungrow
$ chmod +x build-all.sh
$ ./build-all.shThe result of running the script is four binaries:
GoSungrow-darwin-amd64for macOS on Intel chipsGoSungrow-darwin-arm64for macOS on Apple siliconGoSungrow-linux-amd64for Linux on Intel chipsGoSungrow-linux-arm64for Raspberry Pi
If the lipo tool is available, the script also assembles the first two binaries into:
GoSungrow-macmacOS "universal" binary
There are many ways to use the recompiled binary. About the simplest is to include it in a directory that is in your Unix PATH. The most common pattern for home directories is:
$ mkdir -p ~/.local/bin
$ cp ./GoSungrow ~/.local/bin/.If the
~/.local/bindirectory did not already exist, you may need to logout and login to give your.profileor.bashrca chance to discover it and add it to your PATH.
Once the binary is in a directory that is in your PATH, you can execute it just by typing the command name (ie without the ./ prefix). For example:
$ GoSungrow api loginIf you try to use the patched images provided by triamazikamno, your Home Assistant log will report:
The configuration for entity ยซthingยป uses the deprecated option 'object_id' to set the default entity id. Replace the "object_id": "ยซvalueยป"' option with "default_entity_id": "ยซvalueยป" in your published discovery configuration to fix this issue, or contact the maintainer of the integration that published this config to fix this. This will stop working in Home Assistant Core 2026.4
Assuming this means what it says, the triamazikamno variants of GoSungrow will stop working. You now really have no choice but to follow the instructions in Part 1 and recompile the program from its (patched) source code.
You can not use this approach if you intend to direct the MQTT feed from GoSungrow to your Home Assistant instance. See the explanation above at Part 2.
However, if you want to use a triamazikamno version of GoSungrow outside of Home Assistant but you do not want to recompile GoSungrow yourself, you can proceed as follows:
-
Use your browser to open the following URL:
-
Scroll down to "Assets" and expand the disclosure triangle if necessary.
-
Identify the asset which is appropriate to your platform. Examples:
- macOS on Intel =
GoSungrow-darwin_amd64.tar.gz - macOS on Apple silicon =
GoSungrow-darwin_arm64.tar.gz - Linux on Intel =
GoSungrow-linux_amd64.tar.gz - Linux on 64-bit Raspberry Pi =
GoSungrow-linux_arm64.tar.gz
- macOS on Intel =
-
Download the asset to your system. You can either do that from within your browser or you can copy the asset URL to your clipboard, then paste it into a
wgetcommand. Something like this would get the job done:$ mkdir ~/GoSungrow-patched $ cd ~/GoSungrow-patched $ wget https://github.com/triamazikamno/GoSungrow/releases/download/v3.0.7/GoSungrow-linux_arm64.tar.gz
Just make sure you use the correct asset URL in the
wgetcommand. -
Unpack the
.tar.gz(a tape archive โ sometimes called a "tarball" โ with gzip compression):-
On macOS (assuming you asked your browser to do the download), the asset will be in your Downloads folder. Double-clicking the downloaded asset creates a folder of the same base name as the asset and extracts the asset's contents into that folder.
-
On Linux (assuming you have just done the
wgetas above and your working directory is still~/GoSungrow-patched), you can extract the asset's contents into the working directory like this:$ tar -xzf *.tar.gz
Either way, you wind up with a folder containing the
GoSungrowbinary plus some other odds and ends which you can ignore. -
-
Complete the following steps from Partย 1:
You can not use this approach if you intend to direct the MQTT feed from GoSungrow to your Home Assistant instance. See the explanation above at Part 2.
triamazikamno has provided patched images for GoSungrow on DockerHub. Although the images were intended for use with Home Assistant, they are just Docker images and can also be used outside of Home Assistant.
-
Create a directory to hold the GoSungrow configuration and its runtime artifacts. These instructions assume the following but the actual directory can have any name and can be located anywhere:
$ mkdir -p $HOME/GoSungrow -
Use the following JSON as a template:
{ "sungrow_host": "ยซHost URLยป", "sungrow_user": "ยซUSERNAMEยป", "sungrow_password": "ยซPASSWORDยป", "sungrow_appkey": "ยซAPPKEYยป", "mqtt_host": "localhost", "mqtt_port": "1883", "mqtt_user": "", "mqtt_password": "", "debug": false, "sungrow_timeout": 60 } -
Edit the JSON:
"sungrow_host": see iSolarCloud gateway configuration and replaceยซHost URLยปwith the appropriate Host URL."sungrow_user"and"sungrow_password": replace bothยซUSERNAMEยปandยซPASSWORDยปwith your iSolarCloud credentials."sungrow_appkey": see APPKey configuration and replaceยซAPPKEYยปwith the appropriate key."mqtt_host": the default value of"localhost"assumes the broker is running on the same host as the GoSungrow container but this field can contain a hostname, domain name or IP address."mqtt_port": the default port for MQTT is 1883 so only change this if you know your broker is running on a non-standard port."mqtt_user"and"mqtt_password": default to null strings, which assumes your broker does not check credentials. Set appropriate values if your broker authenticates messages."debug"and"sungrow_timeout": should be left as is.
-
Save the edited JSON to the path:
$HOME/GoSungrow/options.json
-
From the following list, choose the image which is appropriate for your host's architecture:
Image Typical Platform triamazikamno/armhf-addon-gosungrow:3.0.7Raspberry Pi 3 triamazikamno/armv7-addon-gosungrow:3.0.7Raspberry Pi 4 in 32-bit user mode (kernel mode is irrelevant) triamazikamno/aarch64-addon-gosungrow:3.0.7Raspberry Pi 4/5 in full 64-bit mode triamazikamno/amd64-addon-gosungrow:3.0.7Debian guest on Proxmox-VE running on Intel -
In the following command, replace
ยซIMAGEยปwith the image you chose in the previous step:$ docker run -d --name gosungrow --net=host \ -v "/etc/ssl/certs:/etc/ssl/certs:ro" \ -v "$HOME/GoSungrow:/data" \ ยซIMAGEยป
-
Execute the command. For example, on a Raspberry Pi 4 running full 64-bit Bullseye or Bookworm, the command would be:
$ docker run -d --name gosungrow --net=host \ -v "/etc/ssl/certs:/etc/ssl/certs:ro" \ -v "$HOME/GoSungrow:/data" \ triamazikamno/aarch64-addon-gosungrow:3.0.7
Notes:
-
--net=hostis only needed to facilitate the use of"mqtt_host": "localhost"in theoptions.jsonfile. If you run the GoSungrow container as part of a stack in which Mosquitto is also running, you can employ non-host mode and change"localhost"to"mosquitto". -
The first
-vmaps the host's SSL certificates into the container. The container will inherit any changes made by routine updates to your operating system. -
When you execute the
docker runcommand on a non-Intel platform, you may see the following message:WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requestedYou can ignore that message. See GoSungrow Issue 32 for more information.
This part explains how to use the result of Partย 1 to patch the existing (broken) GoSungrow add-on:
-
Assumptions:
-
The (broken) GoSungrow 3.0.7 add-on has already been installed on your Home Assistant instance;
-
You have configured the add-on. Typically, that means you have to configure:
sungrow_host(defaults tohttps://augateway.isolarcloud.combut will need to be changed for other regions);sungrow_userrequiredsungrow_passwordrequiredsungrow_appkeyyou must change this - see APPKey configurationmqtt_host(defaults tocore-mosquitto- correct unless you use a different broker)mqtt_port(defaults to1883- correct unless you use a different port)mqtt_userrequired (set up in core-mosquitto)mqtt_passwordrequired (set up in core-mosquitto)
-
When you try to start the GoSungrow 3.0.7 add-on, it aborts;
-
You have used Home Assistant's UI controls to stop the add-on. In other words, the:
Settings ยป Apps ยป GoSungrow ยป Info tabshows "Start". Please do not proceed if the add-on is constantly restarting.
-
You have not previously followed the steps in this part (Part 5).
If you have done Part 5 before, please see Undoing Part 5.
-
You do not have any other add-ons installed which have
gosungrowin the name. In particular, the presence of GoSungrow2MQTT will cause a mess so please don't proceed if you have that installed.
-
-
Refer to Advanced SSH and Web Terminal for instructions on:
- installing the required add-on;
- configuring the add-on;
- starting the add-on; and
- the conventions this gist adopts with respect to the add-on (in particular, that
#indicates a command).
-
Define the following alias (please don't skip this step):
# alias DI='docker images --filter "label=io.hass.name=GoSungrow" --format "table {{.Repository}}:{{.Tag}}\t{{.ID}}"' -
You should be able to see the existing (broken) image:
# DI REPOSITORY:TAG IMAGE ID ba22da74/amd64-addon-gosungrow:3.0.7 6763a1a629ba
Your output may be slightly different but you should at least be able to identify a line with "gosungrow" and version 3.0.7.
-
Construct the required variables:
# ba22da74=$(DI | grep "ba22da74/.*-gosungrow:3.0.7 " | awk '{print $1}') # baseline=$(echo $ba22da74 | awk -F/ '{print"baseline/"$2}') # patched=$(echo $ba22da74 | awk -F/ '{print"patched/"$2}')
-
Verify the required variables
# echo -e "ba22da74=$ba22da74\nbaseline=$baseline\npatched=$patched" ba22da74/amd64-addon-gosungrow:3.0.7 baseline/amd64-addon-gosungrow:3.0.7 patched/amd64-addon-gosungrow:3.0.7
Please make sure those
echocommands produce sensible results. -
Retag the brpken image. This prevents it from being removed:
# docker tag $ba22da74 $baselineConfirm that the tagging has worked by re-running the
imagescommand:# DI REPOSITORY:TAG IMAGE ID ba22da74/amd64-addon-gosungrow:3.0.7 6763a1a629ba baseline/amd64-addon-gosungrow:3.0.7 6763a1a629ba
You can see both repository+tag combinations point to the same ImageID. An ImageID is a hash of the image file so two repository+tag combinations pointing to the same ImageID means they are both pointing to the same image file on disk.
-
Create a context directory and make it your working directory:
# mkdir context # cd context
-
Here is where things get slightly complicated. Your goal is to copy the compiled binary that you produced in Partย 1 so that it winds up in this
contextdirectory. The result also needs to be calledGoSungrow:-
If you compiled GoSungrow on your HA instance, you only need to move the compiled binary into the context directory. This command should get the job done:
# mv ~/go-projects/MickMake/GoSungrow/GoSungrow . -
If you compiled GoSungrow on your support host, you may be able to use SCP to copy the binary. Here is an example:
# scp ยซuserยป@ยซhostOrIPยป:go-projects/MickMake/GoSungrow/GoSungrow-linux-amd64 GoSungrow Password: GoSungrow-linux-amd64 100% 100MB 73.8MB/s 00:01
Notes:
-
My Home Assistant instance is running as a Proxmox-VE guest on an old Intel MacBook Pro with so the
linux-amd64variant is what I need. You need to pick the GoSungrow variant that matches your Home Assistant's hardware platform. -
The Advanced SSH and Web Terminal doesn't support running the SCP in the other direction (pushing from your support host to your Home Assistant instance).
-
-
-
Make sure the Unix permissions are set correctly:
# chmod 755 GoSungrowCheck the result:
# ls -l total 102572 -rwxr-xr-x 1 root root 105029473 Dec 8 12:11 GoSungrowThe permission flags on the left hand side need to be
-rwxr-xr-x. This step is particularly important if you recompiled GoSungrow on a Windows platform. -
Create a Dockerfile:
# echo -e "FROM ${baseline}\nCOPY GoSungrow /usr/local/bin/GoSungrow\n" >DockerfileConfirm the result:
# cat Dockerfile FROM baseline/amd64-addon-gosungrow:3.0.7 COPY GoSungrow /usr/local/bin/GoSungrow
-
Build a new image (which replaces the broken
GoSungrowbinary with the patched version):# docker build -t ${patched} .Ignore the deprecation warning.
-
Inspect the result:
# DI REPOSITORY:TAG IMAGE ID patched/amd64-addon-gosungrow:3.0.7 6dd1108599fe baseline/amd64-addon-gosungrow:3.0.7 6763a1a629ba ba22da74/amd64-addon-gosungrow:3.0.7 6763a1a629ba
Three repository+tag combinations but now we have two distinct images (ie different ImageIDs). In the above:
6dd1108599feis the newly-built (patched) image, while6763a1a629bais two tags pointing to the same (broken) image.
-
Change the
ba22da74tag to point to the newly-built image:# docker tag $patched $ba22da74Confirm the result:
# DI REPOSITORY:TAG IMAGE ID ba22da74/amd64-addon-gosungrow:3.0.7 6dd1108599fe patched/amd64-addon-gosungrow:3.0.7 6dd1108599fe baseline/amd64-addon-gosungrow:3.0.7 6763a1a629ba
This step of using the original repository+tag combination to point to the patched image is what causes Home Assistant to load the patched image rather than the broken image.
-
Go back to the Home Assistant GUI:
- Double-check that you set the configuration options for the GoSungrow add-on correctly (in particular, that you are using the correct gateway and APPKey).
- Switch to the "Info" tab and click "START".
-
If HA seems to freeze, try quitting your browser and reconnecting to the GUI. Worst case you may need to restart HA, and then start the GoSungrow add-on again.
To run commands on your Home Assistant instance, you must use the "Advanced SSH & Web Terminal" add-on:
To prepare the add-on for use, go to Settings ยป Apps ยป Advanced SSH & Web Terminal. In the:
-
"Configuration" tab:
- you need to set a username and password. This example uses "hassio" as the username. It turns up in the
sshcommand below.
- you need to set a username and password. This example uses "hassio" as the username. It turns up in the
-
"Info" tab:
- "Show in sidebar" should be turned ON.
- "Protection mode" needs to be turned OFF.
- if you changed any settings in either tab, click "RESTART". If you don't see "RESTART" then click "START".
To use the add-on, do one of the following:
-
Either โย from your support host (Linux, macOS, Windows), replace
hassiowith the username you set in the "Configuration" tab above and connect to your HA instance:$ ssh hassio@homeassistant.localThe prompt you get is:
~ #The
#indicates you are running as root and the~indicates that your working directory is root's home directory. -
Or โ from the HomeAssistant web GUI, click "Terminal". A terminal window opens and the prompt you get is:
~ $Although the Unix convention is that a
$prompt means "running unprivileged" while#means "running as root", the HA Terminal window is in fact running as root and the working directory is root's home directory.
Whenever this gist gives you commands that should be executed in the Advanced SSH and Web Terminal add-on, the convention is:
- a line starting with "#" means "copy/paste everything except the
#and press return". - a line that does not start with "#" indicates the expected response from the preceding command.
Any directories or local files that you create via the Advanced SSH and Web Terminal will disappear when the Advanced SSH and Web Terminal add-on restarts. This includes any automatic restart when you reboot your Home Assistant instance. This is the expected behaviour (think of it like a student lab at a university).
Conversely, any Docker images that you install or patch while using the Advanced SSH and Web Terminal add-on will persist.
Sungrow appears to operate the iSolarCloud servers shown in the table below. There may be more. If you discover another server then please add a comment to this gist and I will update the list.
Clicking a link in the "Web URL" column will take you to a web portal where you can login. The "Host URL" column is the URL you need to use for GoSungrow.
URLs marked with "โ " are guesses based on the .eu pattern. Each domain name resolves in the Domain Name System but I have no way of testing whether any gateway other than the Australian host works in practice. If you use one of these servers and are able to confirm the Host URL is correct, please let me know in the comments below.
| "Server" | Web URL | Host URL |
|---|---|---|
| Chinese | www.isolarcloud.com.cn | https://gateway.isolarcloud.com.cnย โ |
| European | www.isolarcloud.eu | https://gateway.isolarcloud.eu |
| International | www.isolarcloud.com.hk | https://gateway.isolarcloud.com.hkย โ |
| Australian | au.isolarcloud.com | https://augateway.isolarcloud.com |
To apply a "Host URL":
-
If you are using the GoSungrow add-on in Home Assistant:
- Open the Home Assistant GUI.
- Click "Settings".
- Click "Apps".
- Click "GoSungrow".
- Click the "Configuration" tab.
- Enter the Host URL from the table into the
sungrow_hostfield. - Click "Save" then follow your nose.
-
If you are using the GoSungrow binary, run:
$ ./GoSungrow config write --host "ยซHost URLยป"Example:
$ ./GoSungrow config write --host "https://augateway.isolarcloud.com" -
If you are editing a JSON configuration file, replace the
ยซHost URLยปfield with the value from the table:{ "sungrow_host": "ยซHost URLยป", }Example:
{ "sungrow_host": "https://augateway.isolarcloud.com", }
The situation with APPKeys is confusing. Some people report success with one key, other people another key. Below is a list of known keys. Try them in order until you find one that works:
B0455FBE7AA0328DB57B59AA729F05D8ANDROIDE13EC118BD7892FE7AB5A3F20
If you discover new APPKeys, please let me know and I'll add them to this list.
To apply an "APPKey":
-
If you are using the GoSungrow add-on in Home Assistant:
- Open the Home Assistant GUI.
- Click "Settings".
- Click "Apps".
- Click "GoSungrow".
- Click the "Configuration" tab.
- Enter the APPKey from the table into the
sungrow_appkeyfield. - Click "Save" then follow your nose.
-
If you are using the GoSungrow binary, run:
$ ./GoSungrow config write --appkey ยซAPPKeyยปExample:
$ ./GoSungrow config write --appkey B0455FBE7AA0328DB57B59AA729F05D8 -
If you are editing a JSON configuration file, replace the
ยซAPPKEYยปfield with the value from the table:{ "sungrow_appkey": "ยซAPPKEYยป", }Example:
{ "sungrow_appkey": "B0455FBE7AA0328DB57B59AA729F05D8", }
Suppose you have previously:
- Followed part1 to recompile GoSungrow; and then
- Followed part5 to patch the Docker image used by Home Assistent.
Now suppose you need to repeat those steps. Such a need might arise if a new pull request or other patch is added to part1.
Before you can repeat part5 successfully, you will need to undo the effect of your previous run.
Proceed like this:
-
If GoSungrow is running, stop it.
-
Go into the Advanced SSH & Web Terminal.
-
Define the following alias:
# alias DI='docker images --filter "label=io.hass.name=GoSungrow" --format "table {{.Repository}}:{{.Tag}}\t{{.ID}}"' -
Inspect your system:
# DI REPOSITORY:TAG IMAGE ID ba22da74/amd64-addon-gosungrow:3.0.7 047c79b40187 patched/amd64-addon-gosungrow:3.0.7 047c79b40187 baseline/amd64-addon-gosungrow:3.0.7 6763a1a629ba
Focusing on the prefixes in the above:
baseline/is the original broken version of GoSungrow;patched/is the result of your previous run of part5; andba22da74/is the "magic incantation" that makes everything work.
Both
ba22da74/andpatched/point to the same image on disk (Image ID047c79b40187).If you don't see this pattern then please stop here because the remaining instructions are likely to do more harm than good. Instead, please try the last resort.
-
Construct the required variables:
# ba22da74=$(DI | grep "ba22da74/.*-gosungrow:3.0.7 " | awk '{print $1}') # baseline=$(DI | grep "baseline/.*-gosungrow:3.0.7 " | awk '{print $1}') # patched=$(DI | grep "patched/.*-gosungrow:3.0.7 " | awk '{print $1}')
-
Verify the required variables:
# echo -e "ba22da74=$ba22da74\nbaseline=$baseline\npatched=$patched" ba22da74=ba22da74/amd64-addon-gosungrow:3.0.7 baseline=baseline/amd64-addon-gosungrow:3.0.7 patched=patched/amd64-addon-gosungrow:3.0.7
Please make sure that
echocommand produces sensible results. -
Move the "magic incantation" (
ba22da74/) so that it points to the same image asbaseline:# docker tag $baseline $ba22da74Check your work:
# DI REPOSITORY:TAG IMAGE ID patched/amd64-addon-gosungrow:3.0.7 047c79b40187 ba22da74/amd64-addon-gosungrow:3.0.7 6763a1a629ba baseline/amd64-addon-gosungrow:3.0.7 6763a1a629ba
Now,
baseline/andba22da74/both point to image ID6763a1a629ba. -
Remove the extraneous image and tag:
# docker rmi $patched $baseline # docker system prune -f
Check your work:
# DI REPOSITORY:TAG IMAGE ID ba22da74/amd64-addon-gosungrow:3.0.7 6763a1a629ba
You have a single image remaining. This is also the situation you would be in if you told Home Assistant to uninstall GoSungrow, and then re-install it from the App Store.
-
Checking to see whether you have any older
triamazikamnoimages lying around on your system. Those images were built without an embeddedio.hass.name=GoSungrowlabel so theDIalias will not match those images:# docker images 2>/dev/null | grep -e "^IMAGE" -e "triamazikamno" IMAGE ID DISK USAGE CONTENT SIZE EXTRA triamazikamno/amd64-addon-gosungrow:3.0.7 f2cbc9418287 161MB 0B
If you find one or more such images, remove it/them. For example:
# docker rmi triamazikamno/amd64-addon-gosungrow:3.0.7Tip:
- it is usually sufficient to type
docker rmi, then the first few letters of the image you want to remove (egtri), and then press tab. Thebashauto-completion system will supply the remainder. The alternative is to use copy/paste.
- it is usually sufficient to type
-
Tell Docker to clean up any dangling artefacts:
# docker system prune -f -
Now you are ready to re-do Part 5.
If you get hopelessly muddled with "images everywhere" and you have no idea how to sort it all out, the simplest approach is to nuke everything and start over:
In the Home Assistant GUI:
-
Go to Settings ยป Apps ยป GoSungrow.
-
Switch to the Configuration tab and make a note of all your settings.
-
Switch to the Info tab:
- If the GoSungrow add=on is running, stop it.
- Click "Uninstall".
In the Advanced SSH & Web Terminal:
-
Run the command:
# docker images 2>/dev/null | grep -e "^IMAGE" -e "gosungrow" -
Remove every GoSungrow-related image you see. For example, if the command above returned three images:
IMAGE ID DISK USAGE CONTENT SIZE EXTRA baseline/amd64-addon-gosungrow:3.0.7 6763a1a629ba 118MB 0B patched/amd64-addon-gosungrow:3.0.7 c9d883bb2bd0 224MB 0B triamazikamno/amd64-addon-gosungrow:3.0.7 f2cbc9418287 161MB 0BYou would execute these commands:
# docker rmi baseline/amd64-addon-gosungrow:3.0.7 # docker rmi patched/amd64-addon-gosungrow:3.0.7 # docker rmi triamazikamno/amd64-addon-gosungrow:3.0.7
-
Tell Docker to clean up any dangling artefacts:
# docker system prune -f
In the Home Assistant GUI:
-
Re-install GoSungrow.
-
Re-apply your settings in the Configuration tab.
-
Do not start the add-on.
Now you are ready to do Part 5.
-
2026-03-18
- Added instructions on undoing prior run of Part 5.
-
2026-03-17
-
Adds PR144 to Part 1
-
Removes Part 2 (will stop working in Home Assistant Core 2026.4)
-
Rewrites Part 5
-
Re-tested in both:
- cross-compiling situation (Intel macOS compiling for AMD64)
- native compiling situation (AMD64)
-
-
2025-12-08
- Incorporate comments from @51iMM - thanks!
- Adds confirmation that recompilation can be done on the HA instance.
-
2025-12-08
-
2024-05-02
- Evidence now suggests there is no correlation between iSolarCloud servers and AppKeys. Text adjusted.
-
2024-05-01
- Consolidate all information about iSolarCloud gateways and APPKeys into a new section and cross-reference existing sections to the consolidated material.
-
2024-03-15
- Adds Partย 4 to leverage existing updated DockerHub images for anyone who wants to run GoSungrow in a Docker container outside of Home Assistant.
-
2024-03-13
- Adds Partย 3 to leverage existing recompiled binaries (which are inputs to the updated DockerHub images) for anyone who simply wants to obtain a patched version of GoSungrow without having to recompile it themselves.
-
2024-02-28
- Includes reminder to click SAVE when changing settings.
-
2024-01-30
- Adds reminder to set cloud gateway for non-AU systems.
-
2024-01-22
- Move
go mod tidybeforego build.
- Move
-
2024-01-14
- Emphasise need to use
./prefix when testing the recompiled binary. - Add short section on using GoSungrow from
~/.local/bin.
- Emphasise need to use
-
2023-12-24 - restructure to make clear the distinction between recompiling and using replacement images in Home Assistant.
-
2023-12-06 - revise "hack" to clarify that the hack can be applied without opening a connection via SSH.
-
2023-12-09 - revise "hack" to use images provided by triamazikamno on DockerHub.
-
2023-12-07 - add steps to recompile from triamazikamno fork to resolve
er_invalid_appkeyproblem:- Additional step during compilation
- Update the APPKey
-
2023-11-29 - re-tested using
go 1.21.4on:- M2 MacBook Pro running macOS Ventura 13.6.2
- Intel Mac Mini running Debian Bookworm guest on Proxmox VE
- Raspberry Pi 4B running Raspberry Pi OS Bullseye
- Raspberry Pi 4B running Raspberry Pi OS Bookworm
-
2023-09-18 - satisfy GoUnify dependency.


Hello @Paraphraser! Thank you for taking the time to write this excellent gist. I followed all the steps and was able to connect my account. However, it is not finding any devices... but I do have a device linked to this account. Do you know the reason for this?