Giter Club home page Giter Club logo

gosungrow's People

Contributors

mickmake avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gosungrow's Issues

Timeout after a few hours of usage

I'm running the app with this command on a raspberry pi 4:

./GoSungrow mqtt sync > output.log 2>&1 &

It works fine, but after a few hours the requests start to timeout an stay like that.
Here is a snippet of the output.log:

2023/02/07 16:45:40 INFO: Syncing 211 entries with HASSIO from queryDeviceList.
-UU-UU-U-UU-UUU
2023/02/07 16:45:40 INFO: Syncing 148 entries with HASSIO from getPsList.
UUUUUUUUUUUUUUUUUUUUUU?UUUU??UUUUUU?UUUUUUUUUUUUUUUCUUUUUUUUUUUUUUUU?UUUUUUCUUUCUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU?UU?UUUUUUUUUUUUUUUCUUCUUUUUUUUUU
2023/02/07 16:45:40 INFO: Syncing 205 entries with HASSIO from getPsDetail.
UUUUU?UUUUUUUUUUUUU???UUCUU??UUU???U?U???UUUU???UUUUU?U?UUU???UUU?UUU?UUUU?UUUU??UUUU?UU??UU?U???U?U?U?UUU??UUCUU??UUUU?U?UUUU?U?UUU?U?U??U?U?UU?UUUUU?U??UUU??UCU?U?UU?UUU?UU????UUCUU?U?UUUUU?UU?UUCUUUUUUCUUU??U
2023/02/07 16:50:50 ERROR: Post "https://gateway.isolarcloud.eu/v1/powerStationService/getPsList": dial tcp: lookup gateway.isolarcloud.eu on 192.168.1.1:53: read udp 192.168.1.100:57977->192.168.1.1:53: i/o timeout
2023/02/07 16:55:40 ERROR: Post "https://gateway.isolarcloud.eu/v1/powerStationService/getPsList": dial tcp: lookup gateway.isolarcloud.eu on 192.168.1.1:53: read udp 192.168.1.100:57977->192.168.1.1:53: i/o timeout
2023/02/07 17:00:40 ERROR: Post "https://gateway.isolarcloud.eu/v1/powerStationService/getPsList": dial tcp: lookup gateway.isolarcloud.eu on 192.168.1.1:53: read udp 192.168.1.100:57977->192.168.1.1:53: i/o timeout

After the first timeout it never resumes. But! If I stop the process and start it again, the connection is working again.

Am I doing something wrong, or Sungrow is trying to make our lives harder? :)

This comment mentions the same issue: #30 (comment)

Only 2 entities for SG2.0RS-S inverter

In my solar panel setup, I'm using 2 inverters; a small 2kW inverter (SG2.0RS-S) for 4 solar panels on the east side of my roof and a bigger 4kw hybrid inverter for the 14 panels on the west side of my roof (which is a SH4.0RS).

The small inverter SG2.0RS-S is only showing 2 entities (total daily yield and current active power) while the bigger hybrid inverter SH4.0RS is showing literally hundreds of entities. Is this normal or is the SG2.0RS-S just not fully supported to show more than that?

Failure to start in HA.

Hello! I have today updated youre application in Home Assistant, but when i try to start the addon it gives me this.

Can you please help me understand what is going on here.

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[09:45:24] INFO: Setting up GoSungrow config ...
parse error: Expected string key before ':' at line 1, column 4
[09:45:24] ERROR: Unknown HTTP error occured
[09:45:25] INFO: Writing GoSungrow config ...
ERROR: $HOME is not defined
[09:45:25] INFO: Login to iSolarCloud using gateway null ...
ERROR: $HOME is not defined
[09:45:25] INFO: Syncing data from gateway null ...
ERROR: $HOME is not defined
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

Best regards, Jocke

Method Not Allowed

Hi!

I am trying to use postman to make an interface, but I get this response:

{
    "error": "Method Not Allowed",
    "message": "Request method 'GET' not supported",
    "path": "/getCloudList",
    "req_serial_num": "2022091605354858891fde42b2eb84cb",
    "status": 405,
    "timestamp": "2022-09-16 00:46:10"
}

The route I am trying to get a response from is: https://gateway.isolarcloud.eu/v1/commonService/getCloudList

I have ofc the ps_id, appkey = 93D72E60331ABDCDC7B39ADC2D1F32B3, sys_code = 900, and a token

Thanks in advance!
Best regards Max

"ha lovelace" without battery

Need to support production of Lovelace dashboard even if there's no battery.

This will require changing the layout of the images as well, (because it looks different).

$ GoSungrow ha lovelace
Can't find DeviceType 14 attached to ps_id 1181861.
Can't find DeviceType 14 attached to ps_id 1181868.

$ GoSungrow show ps list
┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Ps Key           ┃ Ps Id   ┃ Device Type ┃ Device Code ┃ Channel Id ┃ Serial #    ┃ Factory Name ┃ Device Model   ┃
┣━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┫
┃ 1181868_1_1_2    │ 1181868 │ 1           │ 1           │ 2          │ [REDACTED] │ SUNGROW      │ SG5K-D         ┃
┃ 1181868_1_1_1    │ 1181868 │ 1           │ 1           │ 1          │ [REDACTED] │ SUNGROW      │ SG5K-D         ┃
┃ 1181868_22_247_2 │ 1181868 │ 22          │ 247         │ 2          │ [REDACTED] │ SUNGROW      │ WiFi V31       ┃
┃ 1181868_22_247_1 │ 1181868 │ 22          │ 247         │ 1          │ [REDACTED] │ SUNGROW      │ WiFi V31       ┃
┃ 1181868_7_1_1    │ 1181868 │ 7           │ 1           │ 1          │ [REDACTED] │ SUNGROW      │ SG Smart Meter ┃
┗━━━━━━━━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┛

So it looks like it's made it past here, but didn't return any YAML. Nothing in the logs besides the HASSIO sync entries. Will the debug flag enable more output to see where it's falling over?

Originally posted by @jimmybish in #22 (comment)

Templates don't work for newly-installed SG5.0RS

Last Thursday (2023-02-16) I had an SG5.0RS installed, replacing an older inverter from a different vendor.

This is my first Sungrow. I've been trying to follow your README but I'm stuck.

I'm fine with these steps:

$ GoSungrow config write --user=USERNAME --password=PASSWORD
$ GoSungrow api login
$ GoSungrow show ps list
$ GoSungrow show ps tree
$ GoSungrow show ps points 
$ GoSungrow show ps data 1203625 22 20230217000000 20230217235959 60
$ GoSungrow show ps graph 1203625 22 20230217000000 20230217235959 60

But when I try:

$ GoSungrow show template list
No data table results for 'getTemplateList.ResultData.PageList'

#  - has no data.

On a hunch, I tried:

$ GoSungrow api get getTemplateList
{
	"pageList": [],
	"rowCount": 0
}

If I just assume the template Ids would be the same for everyone and try the example:

$ GoSungrow show template points 8040
$

Silence. Ditto any other Template Ids I try.

I can pick up the README again at:

$ GoSungrow show device list
$ GoSungrow show point data 20230217000000 20230217235959 120 1203625_1_1_1.p1

It's really the "no templates" that's the problem. I don't know whether to conclude:

  • There are no templates for the SG5.0RS; or
  • There's some setup step I've missed somewhere which would initialise the templates; or
  • This bit of GoSungrow is broken at the moment so I may as well just use show point data to pick out what I need; or
  • I've somehow uncovered a bug somewhere.

No other issue seems to mention templates so my guess is it's something peculiar to my site (maybe the installing electrician forgot a step). I don't have another Sungrow inverter so I've nothing to compare with.

On the off-chance it would make a difference, I compiled on both macOS and Raspberry Pi OS. Same behaviour.

Any guidance would be much appreciated.

When building the application on Windows Im getting error related to Undefined

When build the code Im getting the bellow errors. Seems that the Syscall functions have changed. I know not enough to understand how to fix this.
I'm running on Windows!

GoSungrow/lsgo

lsgo\ls-windows.go:59:18: undefined: syscall.Stat_t
lsgo\ls-windows.go:60:17: undefined: syscall.Stat
lsgo\ls-windows.go:62:43: undefined: windows.Major
lsgo\ls-windows.go:63:43: undefined: windows.Minor

GoSungrow/mmGit

mmGit\gitFilesystem.go:248:22: undefined: syscall.ForkExec
mmGit\gitFilesystem.go:257:19: undefined: syscall.Wait4

Small programmatic example

From an existing Go program, I'd like to get my current Sungrow inverter's current kw/hr output. I could use the binary and run a shell script, though it'd be awesome if I could call a function in my Go program. Is there a small example of this?

This is what I've tried, but it crashes

package main

import (
	"GoSungrow/iSolarCloud"
	"GoSungrow/iSolarCloud/AppService/login"
	"log"
)

func main() {
	sg := iSolarCloud.NewSunGro("https://augateway.isolarcloud.com", "/tmp/")
	if err := sg.Login(login.SunGrowAuth{
		UserAccount:  "MY_EMAIL",
		UserPassword: "MY_PASSWORD",
	}); err != nil {
		log.Fatal(err)
	}
	ep := sg.GetEndpoint("queryDeviceList")
	rargs := ep.GetRequestArgNames()
	log.Printf("args:%s\n", rargs)
	// var request iSolarCloud.SunGrowDataRequest
}

MQTT error: invalid character '"' after object key:value pair

Hi! 👋
As a round of perfect timing, I found and decided to give GoSungrow a try approximately 20 mins after you updated to v3.0 😁
Unfortunately, I've hit an error when attempting to sync MQTT to HA. (Note, I'm running HA Docker with Mosquitto Docker on the same host, but I don't think that should matter here).

The connection works and I can get devices:

./GoSungrow show ps list
┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Ps Key           ┃ Ps Id   ┃ Device Type ┃ Device Code ┃ Channel Id ┃ Serial #    ┃ Factory Name ┃ Device Model   ┃
┣━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┫
┃ [FILTERED]    │ 1181868 │ 1           │ 1           │ 2          │ [FILTERED] │ SUNGROW      │ SG5K-D         ┃
┃ [FILTERED]    │ 1181868 │ 1           │ 1           │ 1          │ [FILTERED] │ SUNGROW      │ SG5K-D         ┃
┃ [FILTERED] │ 1181868 │ 22          │ 247         │ 2          │ [FILTERED] │ SUNGROW      │ WiFi V31       ┃
┃ [FILTERED] │ 1181868 │ 22          │ 247         │ 1          │ [FILTERED] │ SUNGROW      │ WiFi V31       ┃
┃ [FILTERED]    │ 1181868 │ 7           │ 1           │ 1          │ [FILTERED] │ SUNGROW      │ SG Smart Meter ┃
┗━━━━━━━━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┛

But when I go to perform an MQTT sync, I receive the following:

./GoSungrow mqtt sync
Email:	[FILTERED]@gmail.com
Create Date:	Thu Nov 17 11:47:54 CST 2022
Login Last Date:	2022-12-15 10:45:52
Login Last IP:
Login State:	1
User Account:	[FILTERED]
User Id:	[FILTERED]
User Name:	[FILTERED]
Is Online:	false
Token:	[FILTERED]
Token File:	/home/ubuntu/.GoSungrow/AppService_login.json
2022/12/15 02:52:39 Connecting to MQTT HASSIO Service...
2022/12/15 02:52:39 Connecting to SunGrow...
2022/12/15 02:52:39 Found SunGrow 5 devices
2022/12/15 02:52:39 Caching Sungrow metadata...
Error: invalid character '"' after object key:value pair

My config, if that helps:

{
  "appkey": "[FILTERED]",
  "config": "/home/ubuntu/.GoSungrow/config.json",
  "debug": true,
  "host": "https://augateway.isolarcloud.com",
  "mqtt-host": "homeassistant.home.local",
  "mqtt-password": "",
  "mqtt-port": "1883",
  "mqtt-user": "",
  "out": "",
  "password": "[FILTERED]",
  "quiet": false,
  "save": false,
  "timeout": "30s",
  "token-expiry": "2022-12-15T10:45:52",
  "user": "[FILTERED]@gmail.com"
}

It looks like it's at least got as far as creating mqtt_endpoints.json from cmd_mqtt.go#L522, but I'm not quite there enough with Go to figure out where it might have gone wrong after that.

Multiple inverters crash GoSunGrow

I have two Sungrow inverters connected to iSolarcloud through the Sungrow Datalogger 10000. But during parsing GoSunGrow crashes. I suspect it is due to the multiple inverters:

Token:	115573_6fbf31c8ddcc4edc920e374162efd8bb
Token File:	/data/.GoSungrow/AppService_login.json
2023/02/24 06:48:42 INFO: Found SunGrow 3 devices
2023/02/24 06:48:42 INFO: Caching Sungrow metadata...
2023/02/24 06:48:42 INFO: Cached 750 Sungrow data points...
PsId: required
JSON request:	{"ps_id":5103517}
2023/02/24 06:48:43 ERROR: strconv.Atoi: parsing "2146431_2146432": invalid syntax
Error: strconv.Atoi: parsing "2146431_2146432": invalid syntax
Usage:
  GoSungrow mqtt run [flags]
Aliases:
  run, 
Examples:
	GoSungrow mqtt run  
Flags: Use "GoSungrow help flags" for more info.
Additional help topics:
ERROR: strconv.Atoi: parsing "2146431_2146432": invalid syntax
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

If it would be of any help I can give you access to our installation.

Thanks in advance!

Using European Server?

Does GoSungrow support access via European Server as well? If so, how to specify EU-Server?

Using the default server (host) gives me a

ERROR: Account does not exist '账号不存在'

Error building new version

Thanks for the work you are doing!
I have tried to build the new version, but when building it seems there are missing one thing in the "GoUnify" package.
This is the "/GoUnify/cmdPath"
The error looks like bellow!
iSolarCloud\api\file.go:9:2: github.com/MickMake/GoUnify/[email protected]: replacement directory ../GoUnify/cmdPath does not exist

When checking GoUnify I cannot find cmdPath!

Power units don't change when dropping below 1kW

image
image

When generation or usage drops below 1kW, instead of the unit of measurement switching to W, it will stay in kW, shooting the usage up to the point where my legit usage is barely distinguishable in the graph. My house definitely didn't peak at over 950kW last night! 😆

I haven't been at my PC at a time when this problem is actively occurring, so I haven't yet determined whether this is an issue with GoSungrow or the iSolarCloud API, but I should hopefully be available and able to catch it in the act later tonight and update this issue when I know more.

Git clone/checkout on Windows fails

Hi,

The clone/checkout fails on Windows:

$ git clone https://github.com/MickMake/GoSungrow.git
Cloning into 'GoSungrow'...
remote: Enumerating objects: 60287, done.
remote: Counting objects: 100% (875/875), done.
remote: Compressing objects: 100% (484/484), done.
remote: Total 60287 (delta 588), reused 605 (delta 390), pack-reused 59412
Receiving objects: 100% (60287/60287), 32.76 MiB | 21.86 MiB/s, done.
Resolving deltas: 100% (35066/35066), done.
error: invalid path 'docs/data/js/nc.js?t=2015052012'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

$ git restore --source=HEAD :/
error: invalid path 'docs/data/js/nc.js?t=2015052012'
error: invalid path 'docs/data/js/zhuge.js?v=202218'

The files with the question marks in the filename are not referenced within the repo, so I guess they can be removed?

4.0 architecture idea

This suggestion is a fairly big change, but i think would drastically reduce: the number of files, lines of code, compile time, and the overall complexity of the code base.

In the code below, the goal is to minimise the amount of generated code while maintaining a nice API for the user:

// ===================================================
// HAND WRITTEN CODE

type Data = map[string]interface{}

type Config struct {
	Version string
	BaseURL string
}

type Client struct {
	Config
	Services services.Services
}

func NewClient(config Config) *Client {
	client := &Client{Config: config}
	client.Services.init(client)
	return client
}

func (c *Client) request(service, endpoint string, data Data) (Data, error) {
	url := c.Config.BaseURL + "/" + c.Config.Version + "/" + service + "/" + endpoint
	// make request
}

// ===================================================
// GENERATED CODE (all generated code in one place: gen/)

// generate [gen/services/services.go]
package services

type Services struct {
	AliSms
	App
	MttvScreen
}

// general init all, pass Client into all services
func (s *Services) init(client *Client) {
	s.AliSms = AliSms{Name: "AliSms", client: client}
	s.App = App{Name: "App", client: client}
	s.MttvScreen = MttvScreen{Name: "MttvScreen", client: client}
}

// generate service [gen/services/service_ali_sms.go]
package services
// AliSmsService	msgDownwardStatusReceipt	/v1/messageService/msgDownwardStatusReceipt
// becomes:
type AliSms struct {
	client *Client
	Name string
	State int
}

func (s *AliSms) MsgDownwardStatusReceipt(data Data) (Data, error) {
	return s.client.request(s.Name, "messageService/msgDownwardStatusReceipt", data)
}

// generate service [gen/services/service_app.go]
package services
// AppService	acceptPsSharing	/v1/powerStationService/acceptPsSharing
// AppService	activateEmail	/v1/userService/activateEmail
// becomes
type App struct {
	client *Client
	Name string
	State int
}

func (s *App) AcceptPsSharing(data Data) (Data, error) {
	return s.client.request(s.Name, "powerStationService/acceptPsSharing", data)
}

func (s *App) ActivateEmail(data Data) (Data, error) {
	return s.client.request(s.Name, "userService/activateEmail", data)
}

// ===================================================
// USER CODE

client, err := NewClient(Config{ ... })
if err != nil {
   // handle
}
out, err := client.Services.App.ActivateEmail(data{
   "param1": 42
})
if err != nil {
   // handle
}
// out holds response

MPPT1 and MPPT2 voltages and power?

Hello,

I would like to monitor the MPPT's voltage an power, but I could not find this info (but it is available in the ISolar Cloud). When you have time, can you check this please? I own a SG6.0RS.

Thank you again for you your hard work.

Merry Christmas!

HASSIO "Energy"

Application utility entities cannot be added to HASSIO's built-in "Energy" section.

Either there is no match between the entities that can be added, or it indicates an error:
"The date of the last reset is missing
The following entities have a "measurement" state class but are missing a "last_reset" date.

I've tried changing the entity's "state_class" to "total_increasing", but the app seems to reset it to its original state every time the data is updated, so that's not a solution.

It would be useful to add real-time power (current power) and daily yield return entities to the HASSIO "Energy" section for long-term statistics.

Login to iSolarCloud doesn't work from GoSungrow

  1. I get an error at startup and it is difficult to understand as this url is working from the web browser.
    (I have also tested the https://www.isolarcloud.com/ and at sungrow_user and password are my acount info entered)

  2. Since I am a newbee, I also want to know what to enter in mqtt_user and mqtt_password. When I enter something, I suspect I must also have the same user/password elsewhere, but where.

From the LOG:
[05:33:02] INFO: Login to iSolarCloud using gateway https://www.isolarcloud.eu/ ...
Error: API httpResponse is 404 Not Found
Usage:
GoSungrow api login [flags]
Examples:
GoSungrow api login
Flags: Use "GoSungrow help flags" for more info.
Additional help topics:
ERROR: API httpResponse is 404 Not Found
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

Can I use this in a HA installation without supervisor?

Hi, I'd like to use this component in my HA installation but I'm running HA as a docker installation on a raspberry Pi 4. There is no supervisor, so I cannot use add-ons. Is there a docker file for Linux (raspberry PI OS) on arm ? If not, can I create one and if so, how?
Thx

Build Instructions

Hey,

I have a sungrow, and just rebuild my HomeAssistant. I have HA in Docker, so no add-on store, so I am giving this project a go.

I was a bit confused initially, because GoSungrow (i.e. the binary) did not exist. I have it now, via installing go 1.18, go build, go install.

Might be helpful to include these steps in your README.

Cheers, Brock

isolarcloud app is not working when using gosungrow

Hello

everytime i use the gosungrow Addon all data is pulled and displayed correctly. But after ~6hours the isolarcloud says that my device is offline and so no actual data gets pulled.

If i disable the addon after ~10hours the device is back online in the app.

Maybe they are too many requests ? my refresh intervall is 2m

Can't install

Failed to install add-on
The command '/bin/ash -o pipefail -c chmod a+x /usr/local/bin/run.sh /usr/local/bin/getUrl.sh && /usr/local/bin/getUrl.sh' returned a non-zero code: 1

crash: start GoSungrow will stop seconds later

Hi,

EDIT:
Could be because i did not put any credentials in yet.

latest Home Assistent Version.

If I start GoSungrow it will close after 3 seconds again.
Tried uninstalling and installing again. Same thing.
Watchdog is not the fix, right?
This is not normal, right?
How to check and fix?

Thanks

image

ERROR: unknown error 'er_missing_parameter:appkey'

I have compiled the latest code on a Windows computer.
When trying to login Im getting the following error message "ERROR: unknown error 'er_missing_parameter:appkey'"
My configuration have an application key.
image

When running "gosungrow api login it looks like bellow.
C:\Users\helge\Go\GoSungrow>gosungrow api login
Error: unknown error 'er_missing_parameter:appkey'
←[96;1;4mUsage:←[0m
←[37;1mGoSungrow←[0m api login [flags]

←[96;1;4mExamples:←[0m
←[37;3m GoSungrow api login
←[0m

Flags: Use "GoSungrow help flags" for more info.

←[96;1;4mAdditional help topics:←[0m

ERROR: unknown error 'er_missing_parameter:appkey'

How to access predefined / user-defined reports

I use 3.0.4 and I'd like to automate sending a daily report via mail. In the web UI it's possible to use predifined reports as well as user-defined reports. How can I use these reports via GoSungrow?

I saw there's an api "getReportMsg" but I wasn't able to find out how to use it. I tried to call it like this

./GoSungrow api get AppService.queryReportMsg

but it returns an error message:

Error: unknown error 'er_missing_parameter:menu_code'

Is getting the reports supported by GoSungrow?

Timezones, show point data metadata, and column titles

I've been exploring GoSungrow. I've noticed a few "oddities" but I don't know whether they represent the expected behaviour or are worthy of a bug report.

Apologies in advance for the length of this.

tl;dr

I started out wondering what timezone was being displayed for GoSungrow show point data commands.

The answer seems to be local time, as known to the server (ie UTC+11 at the moment).

I wondered if I could influence that to return UTC+10 365 days a year? Changing the timezone for a command or the whole machine does have an effect but not the one I expected.

the detail

Here's my example command:

$ GoSungrow show point data 202302270000 202302280000 5 1203625_1_1_1.p5 1203625_1_1_1.p7

In words, "I want the MPPT voltages (.p5 & .p7) at five minute intervals, for the whole day of February 27 2023."

This is the pattern I see when I run that:

# DataTable AppService.queryMutiPointDataList.ResultData.Data - PsKeys:1203625_1_1_1,1203625_1_1_1 Points:p5,p7 PsId:1203625 StartTimeStamp:20230227000000 EndTimeStamp:20230228000000 MinuteInterval:5 
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┓
┃ Timestamp              ┃ Ps Key           ┃ 1203625_1_1_1.p5    ┃ 1203625_1_1_1.p7    ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━┫
┃ 2023-02-27 00:00:00    ┃ 1203625_1_1_1    ┃ 0                   ┃ 0                   ┃
┃ 2023-02-27 00:05:00    ┃ 1203625_1_1_1    ┃ 0                   ┃ 0                   ┃
…
┃ 2023-02-27 06:30:00    ┃ 1203625_1_1_1    ┃ 0                   ┃ 0                   ┃
┃ 2023-02-27 06:35:00    ┃ 1203625_1_1_1    ┃ 36.8                ┃ 36.9                ┃
…
┃ 2023-02-27 12:00:00    ┃ 1203625_1_1_1    ┃ 346.3               ┃ 352.3               ┃
┃ 2023-02-27 12:05:00    ┃ 1203625_1_1_1    ┃ 347.9               ┃ 353.9               ┃
…
┃ 2023-02-27 20:25:00    ┃ 1203625_1_1_1    ┃ 18.2                ┃ 19.6                ┃
┃ 2023-02-27 20:30:00    ┃ 1203625_1_1_1    ┃ 0                   ┃ 0                   ┃
…
┃ 2023-02-27 23:55:00    ┃ 1203625_1_1_1    ┃ 0                   ┃ 0                   ┃
┃ 2023-02-28 00:00:00    ┃ 1203625_1_1_1    ┃ 0                   ┃ 0                   ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━┛

On the face of it, the panels started generating at 06.35 and shut down at 20:25. Where I am (Cootamundra), sunrise on 27 Feb was 06:53 AEDT, sunset 19:48 AEDT, so "what the panels saw" includes 20-30 minutes of twilight-photons.

The alternative hypothesis is the report is in AEST (UTC+10). If so, sunrise would be 05:53 AEST, sunset 18:48 AEST. That doesn't make sense in terms of the observed PV output so I think it's reasonable to conclude that the time-range parameters and the report are both being interpreted in terms of one of:

  • The timezone set for the inverter in iSolarCloud (UTC+10); or
  • The timezone for the augateway.isolarcloud.com server; or
  • The local timezone on my requesting system (Australia/Sydney), currently UTC+11.

So far, so good. But I really want NEM time (UTC+10) throughout the year. On Unix, local system time can be overridden, per command, via the TZ environment variable:

TZ override example

As an aside to anyone unfamiliar with this syntax, yes, Australia/Sydney is either UCT+10 (standard time) or UTC+11 (summer time) so it does look like that "GMT-10" is wrong but this syntax where the sign of the offset is illogical comes from a time way way back in computer history and we're sort of stuck with it.

Using that strategy with GoSungrow:

TZ override in action

So, the body of the table is not affected at all but, for some reason, setting TZ changes the order in which that summary line is produced. I interpret that as saying:

  1. There's some response to a timezone change within the GoSungrow code, although why that should affect the metadata is not immediately obvious.
  2. The table body remaining unchanged invites the conclusion that I'm seeing the server's timezone in the data rows.

I can go one step further:

pretend to be in Perth

Even though I'm pretending to be in Perth, there's still no change to the body of the table. Timestamps are pinned to AEDT. As mentioned before I selected UTC+10 in iSolarCloud (and double-checking shows it has stuck) so these UTC+11 timestamps must be the server's.

Which likely implies they'll switch between AEST/AEDT twice a year. Which, to my mind, is suboptimal when it comes to storing time-series in databases, which is what I actually want to do. Still, I now know the answer to the question I started with and I can deal with that.

That leaves the metadata changing around. I find that behaviour puzzling. I've been in the coding game since 1975 and if there's one thing I've learned it's that s/he who ignores unexplained behaviour is likely to wind up with teeth-marks where the Dread Dog of Destiny has had an unexpected snack. That's really why I felt motivated to pen this issue.

So: feature or bug?

one more oddity

In the earlier examples I picked metrics .p5 and .p7 to keep the output manageable. I'm interested in a few more metrics than just those two but here's a slightly different selection:

$ GoSungrow show point data 202302270000 202302280000 5 1203625_1_1_1.p2 1203625_11_0_0.p83072 1203625_7_1_1.p8018

Although I'm new to this, my understanding is 1203625_1_1_1 is the inverter, 1203625_11_0_0 is the plant, and 1203625_7_1_1 is the meter. In other words, that command is asking for one metric from each.

These are just the first few lines:

one of each

All the column titles have come back with 1203625_11_0_0 (the plant). But if I stick those same keys back into the command:

$ GoSungrow show point data 202302270000 202302280000 5 1203625_11_0_0.p2 1203625_11_0_0.p83072 1203625_11_0_0.p8018

the answer is:

failed column titles

So, the "inverter" and "meter" metrics have been dropped.

Not being able to use the column titles from the preceding step as selectors in the subsequent step is another thing that has the feeling that it's less feature, more bug, but again, I'm very new to this so I really have no idea.

Error: appkey is incorrect 'er_invalid_appkey'

if I enter:
GoSungrow api login --debug

I get the response:
Error: appkey is incorrect 'er_invalid_appkey'

Maybe the default appkey "93D72E60331ABDCDC7B39ADC2D1F32B3" is not accepted anymore. Could it be that the api has been changed?

Still no PS are seen

Hi,
First I would like to thank you for all the work you are doing regarding this!

I have now updated to version 3.0. This is done on my windows 10 workstations as I plan to run and export daily graphs.
The bellow are what is happening when I run the list of PS. We have four inverters.
image

Update interval question

I made a sensor calculation to know what the actual power drawn is in my house like this:

Elektriciteitsload calculation- In kilowatt (Solarpower - gridInjection + griduse = Load)

  total_elektriciteitsload:
    friendly_name: "Total Elektriciteitsload"
    unit_of_measurement: "kW"
    icon_template: "mdi:lightning-bolt"
    value_template: >-
      {% set a = states('sensor.gosungrow_virtual_5180443_p83106') | float %}
      {% set b = states('sensor.electricity_meter_power_production') | float %}
      {% set c = states('sensor.electricity_meter_power_consumption') | float %}
      {{ (a - b + c) | round(3) }}

This results in having a sensor that outputs the total power I am drawing in the house (not the Net drawn power, the actual power usage).

However since the update interval of the Sungrow sensors are 5 minutes, these calculations are wrong. The other 2 sensors used in my calculations come straight from my "smart" power meter (P1 port connection). These update every second.

This means that the calculation is wrong if the power produced by the solar panels changes quickly (caused by clouds for example). At soms points I'm measuring a negative total elektricity load, which is not possible in this formula. So is there a way to increase this interval so my calculated sensor shows correct data?

MQTT client

Hi,

I just noticed that the web app is using MQTT to communicate with iSolarCloud. Is this something you've looked into? I'm really interested in near-real-time monitoring of my solar power so I can manage demand.

cheers

image

Can it be accessible in Nodered?

Hi and thanks for the great job!

I recommend to make your API accessible in Nodered for easy use.

How do you think about that?

Best, guenni

API problems?

Hi,

You did a terrific job, but still I can not get it working.
Maybe it is me who does something wrong.

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[10:59:07] INFO: Setting up GoSungrow config ...
parse error: Expected string key before ':' at line 1, column 4
[10:59:08] ERROR: Unknown HTTP error occured
[10:59:09] INFO: Writing GoSungrow config ...
Using config file '/data/.GoSungrow/config.json'
New config:
+-----------------+------------+-------------------------+--------------------------------+------------------------------------------------------------------+
| FLAG | SHORT FLAG | ENVIRONMENT | DESCRIPTION | VALUE (* = DEFAULT) |
+-----------------+------------+-------------------------+--------------------------------+------------------------------------------------------------------+
| --config | | GOSUNGROW_CONFIG | GoSungrow: config file. | /data/.GoSungrow/config.json |
| --debug | | GOSUNGROW_DEBUG | GoSungrow: Debug mode. | false * |
| --quiet | | GOSUNGROW_QUIET | GoSungrow: Silence all | false * |
| | | | messages. | |
| --timeout | | GOSUNGROW_TIMEOUT | Web timeout. | 1m0s |
| --user | -u | GOSUNGROW_USER | SunGrow: api username. | **** |
| --password | -p | GOSUNGROW_PASSWORD | SunGrow: api password. | **** |
| --appkey | | GOSUNGROW_APPKEY | SunGrow: api application key. | **** |
| | | | | * |
| --host | | GOSUNGROW_HOST | SunGrow: Provider API URL. | https://portaleu.isolarcloud.com |
| --token-expiry | | GOSUNGROW_TOKEN_EXPIRY | SunGrow: last login. | * |
| --save | -s | GOSUNGROW_SAVE | Save output as a file. | false * |
| --mqtt-user | | GOSUNGROW_MQTT_USER | HASSIO: mqtt username. | homeassistant |
| --mqtt-password | | GOSUNGROW_MQTT_PASSWORD | HASSIO: mqtt password. | **** |
| --mqtt-host | | GOSUNGROW_MQTT_HOST | HASSIO: mqtt host. | core-mosquitto |
| --mqtt-port | | GOSUNGROW_MQTT_PORT | HASSIO: mqtt port. | 1883 |
+-----------------+------------+-------------------------+--------------------------------+------------------------------------------------------------------+
[10:59:09] INFO: Login to iSolarCloud using gateway https://portaleu.isolarcloud.com ...
Error: API httpResponse is 405 Method Not Allowed
Usage:
GoSungrow api login [flags]
Examples:
GoSungrow api login
Flags: Use "GoSungrow help flags" for more info.
Additional help topics:
ERROR: API httpResponse is 405 Method Not Allowed
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

Watchdog - don't start the addon automaticlly

Hello,

I have installed the Current version: 3.0.3

Sometime the addon crash without a restart, but the watchdog is on.

Is there any futher information about an isssue at this case?

Wbr

Alex

Cache problems.

Seems there's an issue with cache retention when GoSungrow is running for a long period of time.

3.0.2 not starting any more in HA

here is the error:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[15:34:41] INFO: Setting up GoSungrow config ...
/usr/local/bin/run.sh: line 52: GOSUNGROW_MQTT_HOST: unbound variable
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;

Nothing changed in the config options from 3.0.1 to 3.0.2.

Thank you.

New endpoints

Hi,
could you please implement the following endpoints:

  • /v1/devService/getDeviceTypeAndModelInfoByPage
  • /v1/devService/getOnlineUpgradeFileList
    Thanks!

ERROR: No internal MQTT service found. Please install Mosquitto broker

Hi,

i was happy to see that a new version was provided, but unfortunately it doesn't work for me. I got an error Message "ERROR: No internal MQTT service found. Please install Mosquitto broker" although Mosquito Broker is running:
[08:23:53] INFO: Successfully send discovery information to Home Assistant.
[08:23:53] INFO: Successfully send service information to the Supervisor.

Any Ideas?

Log from Addon:
[07:35:12] INFO: Login to iSolarCloud using gateway https://gateway.isolarcloud.eu ...
Email: [email protected]
Create Date: Wed Apr 06 20:56:21 CST 2022
Login Last Date: 2022-12-15 15:35:13
Login Last IP:
Login State: 1
User Account: ebzys9ma1g
User Id: 47700
User Name: sg
Is Online: false
Token:
Token File: /data/.GoSungrow/AppService_login.json
[07:35:13] INFO: Syncing data from gateway https://gateway.isolarcloud.eu ...
No internal MQTT service found. Please install Mosquitto broker
[07:35:13] ERROR: No internal MQTT service found. Please install Mosquitto broker
parse error: Expected string key before ':' at line 1, column 4
[07:35:13] ERROR: Unknown HTTP error occured
host:
password:
port:
username:
[07:35:14] INFO: host:
[07:35:14] INFO: password:
[07:35:14] INFO: port:
[07:35:15] INFO: username:
__BASHIO_LIB_DIR=/usr/lib/bashio
PWD=/
GOSUNGROW_MQTT_HOST=core-mosquitto
GOSUNGROW_APPKEY=93D72E60331ABDCDC7B39ADC2D1F32B3
HOME=/data
__BASHIO_BIN=/usr/lib/bashio/bashio
GOSUNGROW_DEBUG=
CONFIG_PATH=/data/options.json
GOSUNGROW_PASSWORD=
GOSUNGROW_USER=
SHLVL=2
GOSUNGROW_HOST=https://gateway.isolarcloud.eu
PATH=/command:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
GOSUNGROW_TIMEOUT=60s
OLDPWD=/
_=/usr/bin/env
PING core-mosquitto (172.30.33.2): 56 data bytes
64 bytes from 172.30.33.2: seq=0 ttl=64 time=0.963 ms
64 bytes from 172.30.33.2: seq=1 ttl=64 time=0.195 ms

Cant log in from windows laptop

Hi
I have installed go sungrow APP and it is asking for psid. how do i obtain ps id from sungrow tool . I have windows laptop and it is asking to run sungrow app from cmd app. I cant login.Can you please explain how to log in. I think I am missing .when I copy following it idid not go through.

I modified user name and password but not succesfull
Following is the log from homeassistant

Thank you ..

s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[01:53:42] INFO: Setting up GoSungrow config ...
[01:53:44] INFO: Writing GoSungrow config ...
Using config file '/data/.GoSungrow/config.json'
New config:
+-----------------+------------+-------------------------+--------------------------------+-----------------------------------+
| FLAG | SHORT FLAG | ENVIRONMENT | DESCRIPTION | VALUE (* = DEFAULT) |
+-----------------+------------+-------------------------+--------------------------------+-----------------------------------+
| --config | | GOSUNGROW_CONFIG | GoSungrow: config file. | /data/.GoSungrow/config.json |
| --debug | | GOSUNGROW_DEBUG | GoSungrow: Debug mode. | true |
| --quiet | | GOSUNGROW_QUIET | GoSungrow: Silence all | false * |
| | | | messages. | |
| --timeout | | GOSUNGROW_TIMEOUT | Web timeout. | 1m0s |
| --user | -u | GOSUNGROW_USER | SunGrow: api username. | [email protected] |
| --password | -p | GOSUNGROW_PASSWORD | SunGrow: api password. | Scr4152# |
| --appkey | | GOSUNGROW_APPKEY | SunGrow: api application key. | 93D72E60331ABDCDC7B39ADC2D1F32B3 |
| | | | | * |
| --host | | GOSUNGROW_HOST | SunGrow: Provider API URL. | https://augateway.isolarcloud.com |
| | | | | * |
| --token-expiry | | GOSUNGROW_TOKEN_EXPIRY | SunGrow: last login. | 2023-03-09T09:43:26 |
| --save | -s | GOSUNGROW_SAVE | Save output as a file. | false * |
| --mqtt-user | | GOSUNGROW_MQTT_USER | HASSIO: mqtt username. | mqttscr |
| --mqtt-password | | GOSUNGROW_MQTT_PASSWORD | HASSIO: mqtt password. | mqttscr |
| --mqtt-host | | GOSUNGROW_MQTT_HOST | HASSIO: mqtt host. | core-mosquitto |
| --mqtt-port | | GOSUNGROW_MQTT_PORT | HASSIO: mqtt port. | 1883 |
+-----------------+------------+-------------------------+--------------------------------+-----------------------------------+
[01:53:44] INFO: Login to iSolarCloud using gateway https://augateway.isolarcloud.com ...
Email: [email protected]
Create Date: Wed Dec 23 16:37:22 CST 2020
Login Last Date: 2023-03-09 09:43:26
Login Last IP:
Login State: 1
User Account: hxdb6m5x
User Id: 183472
User Name: Chanaka
Is Online: false
Token: 183472_549aa6945f74498288cf3b79c7db022b
Token File: /data/.GoSungrow/AppService_login.json
Email: [email protected]
Create Date: Wed Dec 23 16:37:22 CST 2020
Login Last Date: 2023-03-09 09:53:44
Login Last IP:
Login State: 1
User Account: hxdb6m5x
User Id: 183472
User Name: Chanaka
Is Online: false
Token: 183472_6f71bcc469d24f4da669c90e4eb87ca9
Token File: /data/.GoSungrow/AppService_login.json
[01:53:44] INFO: Syncing data from gateway https://augateway.isolarcloud.com ...
2023/03/09 01:53:44 INFO: Connecting to MQTT HASSIO Service...
2023/03/09 01:53:44 INFO: Connecting to SunGrow...
Email: [email protected]
Create Date: Wed Dec 23 16:37:22 CST 2020
Login Last Date: 2023-03-09 09:53:44
Login Last IP:
Login State: 1
User Account: hxdb6m5x
User Id: 183472
User Name: Chanaka
Is Online: false
Token: 183472_6f71bcc469d24f4da669c90e4eb87ca9
Token File: /data/.GoSungrow/AppService_login.json
2023/03/09 01:53:45 INFO: Found SunGrow 2 devices
2023/03/09 01:53:45 INFO: Caching Sungrow metadata...
2023/03/09 01:53:45 INFO: Cached 681 Sungrow data points...
2023/03/09 01:53:45 ERROR: strconv.Atoi: parsing "1382562_1382563": invalid syntax
Error: strconv.Atoi: parsing "1382562_1382563": invalid syntax
PsId: required
JSON request: {"ps_id":1204183}
Usage:
GoSungrow mqtt run [flags]
Aliases:
run,
Examples:
GoSungrow mqtt run
Flags: Use "GoSungrow help flags" for more info.
Additional help topics:
ERROR: strconv.Atoi: parsing "1382562_1382563": invalid syntax
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

PS ID Required?

Hi Mick,
Thank you for your project. I have installed the addon and it is asking for PS ID? Where should I Enter that data?
please see log below. Can anyone please help. I am quiet newbie to Go lang

--quiet | | GOSUNGROW_QUIET | GoSungrow: Silence all | false * |
| | | | messages. | |
| --timeout | | GOSUNGROW_TIMEOUT | Web timeout. | 1m0s |
| --user | -u | GOSUNGROW_USER | SunGrow: api username. |##########@gmail.com |
| --password | -p | GOSUNGROW_PASSWORD | SunGrow: api password. |######## |
| --appkey | | GOSUNGROW_APPKEY | SunGrow: api application key. | 93D72E60331ABDCDC7B39ADC2D1F32B3 |
| | | | | * |
| --host | | GOSUNGROW_HOST | SunGrow: Provider API URL. | https://augateway.isolarcloud.com |
| | | | | * |
| --token-expiry | | GOSUNGROW_TOKEN_EXPIRY | SunGrow: last login. | 2023-03-26T15:05:32 |
| --save | -s | GOSUNGROW_SAVE | Save output as a file. | false * |
| --mqtt-user | | GOSUNGROW_MQTT_USER | HASSIO: mqtt username. | mqttscr |
| --mqtt-password | | GOSUNGROW_MQTT_PASSWORD | HASSIO: mqtt password. | mqttscr |
| --mqtt-host | | GOSUNGROW_MQTT_HOST | HASSIO: mqtt host. | core-mosquitto |
| --mqtt-port | | GOSUNGROW_MQTT_PORT | HASSIO: mqtt port. | 1883 |
+-----------------+------------+-------------------------+--------------------------------+-----------------------------------+
[07:05:44] INFO: Login to iSolarCloud using gateway https://augateway.isolarcloud.com ...
Email: ##########@gmail.com
Create Date: Wed Dec 23 16:37:22 CST 2020
Login Last Date: 2023-03-26 15:05:32
Login Last IP:
Login State: 1
User Account: hxdb6m5x
User Id: 183472
User Name: Chanaka
Is Online: false
Token: 183472_b8f295b48bf146d594e4a092eba69b35
Token File: /data/.GoSungrow/AppService_login.json
Email: ##########@gmail.com
Create Date: Wed Dec 23 16:37:22 CST 2020
Login Last Date: 2023-03-26 15:05:45
Login Last IP:
Login State: 1
User Account: hxdb6m5x
User Id: 183472
User Name: Chanaka
Is Online: false
Token: 183472_b8f295b48bf146d594e4a092eba69b35
Token File: /data/.GoSungrow/AppService_login.json
[07:05:45] INFO: Syncing data from gateway https://augateway.isolarcloud.com ...
Email: ###########@gmail.com
2023/03/26 07:05:45 INFO: Connecting to MQTT HASSIO Service...
2023/03/26 07:05:45 INFO: Connecting to SunGrow...
Create Date: Wed Dec 23 16:37:22 CST 2020
Login Last Date: 2023-03-26 15:05:45
Login Last IP:
Login State: 1
User Account: hxdb6m5x
User Id: 183472
User Name: Chanaka
Is Online: false
Token: 183472_b8f295b48bf146d594e4a092eba69b35
Token File: /data/.GoSungrow/AppService_login.json
2023/03/26 07:05:45 INFO: Found SunGrow 2 devices
2023/03/26 07:05:45 Option[homeassistant/select/GoSungrow/GoSungrow-option-mqtt_debug/cmd] set to 'enabled'
2023/03/26 07:05:45 MQTT[homeassistant/select/GoSungrow/GoSungrow-option-loglevel/state] -> info
2023/03/26 07:05:45 MQTT[homeassistant/select/GoSungrow/GoSungrow-option-fetchschedule/config] -> {"command_template":"{{ value }}","command_topic":"homeassistant/select/GoSungrow/GoSungrow-option-fetchschedule/cmd","device":{"connections":[["GoSungrow","GoSungrow-options"],["GoSungrow-options","GoSungrow"]],"identifiers":["GoSungrow"],"manufacturer":"GoSungrow","model":"GoSungrow","name":"GoSungrow options - Options","suggested_area":"GoSungrow","sw_version":"GoSungrow https://github.com/MickMake/GoSungrow","via_device":"GoSungrow"},"enabled_by_default":true,"encoding":"utf-8","icon":"mdi:format-list-group","name":"GoSungrow Option Fetch Schedule","object_id":"GoSungrow-option-fetchschedule","options":["2m","3m","4m","5m","6m","7m","8m","9m","10m"],"retain":true,"state_topic":"homeassistant/select/GoSungrow/GoSungrow-option-fetchschedule/state","unique_id":"GoSungrow-option-fetchschedule","value_template":"{{ value }}"}
2023/03/26 07:05:45 INFO: Option[loglevel] set to 'info'
2023/03/26 07:05:45 MQTT[homeassistant/select/GoSungrow/GoSungrow-option-loglevel/state] -> info
2023/03/26 07:05:45 INFO: Option[fetchschedule] set to '4m'
2023/03/26 07:05:45 MQTT[homeassistant/select/GoSungrow/GoSungrow-option-fetchschedule/state] -> 4m
2023/03/26 07:05:45 MQTT[homeassistant/select/GoSungrow/GoSungrow-option-fetchschedule/state] -> 4m
2023/03/26 07:05:45 MQTT[homeassistant/select/GoSungrow/GoSungrow-option-sleepdelay/config] -> {"command_template":"{{ value }}","command_topic":"homeassistant/select/GoSungrow/GoSungrow-option-sleepdelay/cmd","device":{"connections":[["GoSungrow","GoSungrow-options"],["GoSungrow-options","GoSungrow"]],"identifiers":["GoSungrow"],"manufacturer":"GoSungrow","model":"GoSungrow","name":"GoSungrow options - Options","suggested_area":"GoSungrow","sw_version":"GoSungrow https://github.com/MickMake/GoSungrow","via_device":"GoSungrow"},"enabled_by_default":true,"encoding":"utf-8","icon":"mdi:format-list-group","name":"GoSungrow Option Sleep Delay After Schedule","object_id":"GoSungrow-option-sleepdelay","options":["0s","10s","20s","30s","40s","50s","60s"],"retain":true,"state_topic":"homeassistant/select/GoSungrow/GoSungrow-option-sleepdelay/state","unique_id":"GoSungrow-option-sleepdelay","value_template":"{{ value }}"}
2023/03/26 07:05:45 MQTT[homeassistant/select/GoSungrow/GoSungrow-option-sleepdelay/state] -> 40s
2023/03/26 07:05:45 MQTT[homeassistant/select/GoSungrow/GoSungrow-option-servicestate/config] -> {"command_template":"{{ value }}","command_topic":"homeassistant/select/GoSungrow/GoSungrow-option-servicestate/cmd","device":{"connections":[["GoSungrow","GoSungrow-options"],["GoSungrow-options","GoSungrow"]],"identifiers":["GoSungrow"],"manufacturer":"GoSungrow","model":"GoSungrow","name":"GoSungrow options - Options","suggested_area":"GoSungrow","sw_version":"GoSungrow https://github.com/MickMake/GoSungrow","via_device":"GoSungrow"},"enabled_by_default":true,"encoding":"utf-8","icon":"mdi:format-list-group","name":"GoSungrow Option Service State","object_id":"GoSungrow-option-servicestate","options":["Run","Restart","Stop"],"retain":true,"state_topic":"homeassistant/select/GoSungrow/GoSungrow-option-servicestate/state","unique_id":"GoSungrow-option-servicestate","value_template":"{{ value }}"}
2023/03/26 07:05:45 INFO: Option[sleepdelay] set to '60s'
2023/03/26 07:05:45 MQTT[homeassistant/select/GoSungrow/GoSungrow-option-sleepdelay/state] -> 60s
2023/03/26 07:05:45 MQTT[homeassistant/select/GoSungrow/GoSungrow-option-servicestate/state] -> Run
2023/03/26 07:05:45 INFO: Caching Sungrow metadata...
2023/03/26 07:05:45 INFO: Option[servicestate] set to 'run'
2023/03/26 07:05:45 MQTT[homeassistant/select/GoSungrow/GoSungrow-option-servicestate/state] -> run
2023/03/26 07:05:45 INFO: Cached 681 Sungrow data points...
PsId: required
JSON request: {"ps_id":1204183}
2023/03/26 07:05:45 ERROR: strconv.Atoi: parsing "1382562_1382563": invalid syntax
Error: strconv.Atoi: parsing "1382562_1382563": invalid syntax
Usage:
GoSungrow mqtt run [flags]
Aliases:
run,
Examples:
GoSungrow mqtt run
Flags: Use "GoSungrow help flags" for more info.
Additional help topics:
ERROR: strconv.Atoi: parsing "1382562_1382563": invalid syntax
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

Error: Account does not exist '账号不存在'

I'm trying to run GoSungrow on Windows and after running GoSungrow config write --user=xyz --password=xyz, I get stuck on GoSungrow api login with the error: Error: Account does not exist '账号不存在'.

I am using the same credentials as I would use them to log in on the Android app. The API key I am using is still 93D72E60331ABDCDC7B39ADC2D1F32B3.

Any ideas what could cause this?

Parsing Error calling "api get getPsDetailWithPsType"

Hey!
I'm really really thankfull for this project. I want to embed my smart-meter data into my grafana boards, and want to use the information to trigger heating etc.

I was doing a lot of try and error, to find the right API where the smart-meter data is provided. And I only found this one here. But the implementation is broken :-(.

I'm not a Go guy - sorry therefore I can not help to fix the problem. But maybe, you find time to fix.
Or maybe you can help me out if there are other API methods where I can access the smart meter data like, active power, etc.

`/GoSungrow api get getPsDetailWithPsType '{"ps_id":"5076346"}'
PsId: required
JSON request: {"ps_id":5076346}

Error: strconv.ParseInt: parsing "[\n\t\t\t{\n\t\t\t\t"ameter_device_type":7,\n\t\t\t\t"ameter_ps_key":"5076346_7_1_1",\n\t\t\t\t"ameter_uuid":1886463,\n\t\t\t\t"communication_dev_sn":"B21C0204055",\n\t\t\t\t"dev_status":1,\n\t\t\t\t"device_code":1,\n\t\t\t\t"device_model_code":"SG20RT",\n\t\t\t\t"device_name":"SG20RT(COM1-001)_001_001",\n\t\t\t\t"device_state":"3",\n\t\t\t\t"device_type":1,\n\t\t\t\t"energy_flow":[\n\t\t\t\t\t"3"\n\t\t\t\t],\n\t\t\t\t"has_ammeter":1,\n\t\t\t\t"installer_dev_fault_status":3,\n\t\t\t\t"inverter_sn":"A21C0703986",\n\t\t\t\t"owner_dev_fault_status":3,\n\t\t\t\t"p14_map":{\n\t\t\t\t\t"unit":"W",\n\t\t\t\t\t"value":"0"\n\t\t\t\t},\n\t\t\t\t"p14_map_virgin":{\n\t\t\t\t\t"unit":"W",\n\t\t\t\t\t"value":"0"\n\t\t\t\t},\n\t\t\t\t"p24_power_map":{\n\t\t\t\t\t"unit":"W",\n\t\t\t\t\t"value":"0"\n\t\t\t\t},\n\t\t\t\t"p24_power_map_virgin":{\n\t\t\t\t\t"unit":"W",\n\t\t\t\t\t"value":"0"\n\t\t\t\t},\n\t\t\t\t"p8018":"455.0",\n\t\t\t\t"p8074_map":{\n\t\t\t\t\t"unit":"W",\n\t\t\t\t\t"value":"455"\n\t\t\t\t},\n\t\t\t\t"p8074_map_virgin":{\n\t\t\t\t\t"unit":"W",\n\t\t\t\t\t"value":"455"\n\t\t\t\t},\n\t\t\t\t"p8075_map":{\n\t\t\t\t\t"unit":"W",\n\t\t\t\t\t"value":"0"\n\t\t\t\t},\n\t\t\t\t"p8075_map_virgin":{\n\t\t\t\t\t"unit":"W",\n\t\t\t\t\t"value":"0"\n\t\t\t\t},\n\t\t\t\t"p8079_map":{\n\t\t\t\t\t"unit":"W",\n\t\t\t\t\t"value":"455"\n\t\t\t\t},\n\t\t\t\t"p8079_map_virgin":{\n\t\t\t\t\t"unit":"W",\n\t\t\t\t\t"value":"455"\n\t\t\t\t},\n\t\t\t\t"ps_key":"5076346_1_1_1",\n\t\t\t\t"uuid":1088855\n\t\t\t}\n\t\t]": invalid syntax
`

Mqtt implementation

Hi Mick, loving your GoSungrow implementation, all's working as described for me. I have a question rather than an issue, the documentation shows the mqtt flags (username, password, host etc), when I set them should I expect to see traffic on the mqtt broker (Mosquito in this case). Cheers, Craig

Single point reading

Hi everyone,

I'm trying to read a single Point Id (showPSView.XXXXXXX.total_all_power) directly using VS code WIndows version (and GoSungrow.exe in local) to test purpose. Is possible to get this value or I'd have to parse the output (xml file or other format).

PS: With Windows terminal, how do you enter the API JSON request '{"ps_id":"XXXXXXX"}'?

Thanks!!

API put example to change configuration

Hi,

Thx for that great piece of software.

Not really an issue, but a documentation thing (I guess).

I am unsure how I can modify some settings. For example I would like to change the IncomeSetting on a daily basis. When I call get like this:

./GoSungrow api get getIncomeSettingInfos '{"ps_id":"1234567"}'
{
        "code_type": 405,
        "enviormentPowerChargeList": [],
        "param_income_unit": 405,
        "powerElectricalChargeMap": {
                "city_allowance_money": null,
                "code_type": 405,
                "county_allowance_money": null,
                "default_charge": 0.2686,
                "electric_charge_id": 157712,
                "end_time": "2099-12-31",
                "income_style": null,
                "interval_time_charge": null,
                "nation_allowance_money": null,
                "param_income_unit": 405,
                "province_allowance_money": null,
                "ps_id": 1234567,
                "start_time": "2023-01-01",
                "use_sharp_peek_valley_flat": null,
                "valid_flag": true
        },
        "powerIntevalTimesChargeMap": null,
        "powerSelfUseTimesChargeMap": {
                "default_charge": 0.3907,
                "end_time": "2099-12-31",
                "interval_time_charge": "13:00-14:00|0.3906,14:00-15:00|0.3908",
                "online_electricity_percent": 0,
                "ps_id": 1234567,
                "start_time": "2023-01-01",
                "use_electricity_discount": 100
        },
        "ps_id": 1234567
}

I only would like to change powerSelfUseTimesChargeMap."interval_time_charge". How would I need to do that? I guess with put, but without an example I was afraid of breaking something.

Inverter data point

@MickMake , incredible work!
I've managed to gather some data of our power plants through this endpoint: '/v1/commonService/queryMutiPointDataList'.
The thing is, it works only for the ps_key xxxxxxx_11_0_0; where xxxx is the psid (the power station id), 11 seems to stand for the device type (in this case: 'unit', i.e. the power station itself) and the 0s probably channel id or something.
I have been trying to get the same data but for each inverter (our power plants have more than one inverter each - there it differs from yours).
In order to get the devices, I tried this endpoint: "/v1/devService/queryDeviceListForApp"
one example of response was: "ps_key" : "1112873_1_2_1", for a given inverter (type 1 - 'inverter', channeld etc)
but when I pass the inverter ps_key as parameter it doesn't work (null response).
Same for this endpoint: '/v1/commonService/queryDevicePointMinuteDataList'.
It only works with ps_key = "1112873_11_0_0".
Do you have any idea how I could solve it? I've tried changing several parameters on the requests, no success so far.
Any help would be appreciated, although you have already helped as a great deal!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.