The manufacturer docs say that we need to request cid 103
from /v2/api/atRead
When I run the read command, this results in the following output (pretty printed for convenience)
{
"msg": "success",
"code": "0",
"data": {
"msg": "20,55,00:00-06:00,00:00-00:00,0,0,12:00-16:00,00:00-00:00,0,0,00:00-00:00,00:00-00:00",
"yuanzhi": "20,55,00:00-06:00,00:00-00:00,0,0,12:00-16:00,00:00-00:00,0,0,00:00-00:00,00:00-00:00",
"command": "AT+TEST=GIN485:01 03 a8 85 00 1e f4 4b",
"needLoop": "false"
},
"orderId": "1735662097308_195",
"time": "1735662097308"
}
This differs to the value that the docs say we have to post to change values:
[{"name": "Charge current 1", "value": "1", "type": "1", "unit": "A", "min":0, "max":100},{"name": "Discharge current 1", "value": "1", "type": "1", "unit": "A", "min":0," max":100},{"name": "Charge time 1", "name1": "Start time", "name2": "End time", "value": "1", "type": "0"},{"name": "Discharge time 1", "name1": "Start time", "name2": "End time"," value": "1", "type": "0"},{"name": "Charge current 2", "value": "1", "type": "1", "unit": "A", "min":0, "max":100},{"name": "Discharge current 2", "value": "1", "type": "1" , "unit": "A", "min":0, "max":100},{"name": "Charge Time 2", "name1": "Start Time", "name2": "End Time", "value": "1", "type": "0"},{"name": "Discharge Time 2", "name1": "Start Time ", "name2": "End time", "value": "1", "type": "0"},{"name": "Charge current 3", "value": "1", "type": "1", "unit": "A", "min":0, "max":100},{"name": "Discharge current 3"," value": "1", "type": "1", "unit": "A", "min":0, "max":100},{"name": "Charge time 3", "name1": "Start time", "name2": "End time", "value": "1", "type": "0"},{"name". "Discharge Time 3", "name1": "Start Time", "name2": "End Time", "value": "1", "type": "0"}]
The break down into individual times and currents is reminscent of the old control interface - earlier in 2024 Solis revised it and current is only defined once now.
The docs spreadsheet also has a sheet called Demo
with an example that's noted as
For hybrid inverter, Set the charging current to 50A & discharging current to 20A, also set the battery force charge at 2:00-3:00, battery force discharge at 3:00-4:00.
The example payload looks more like the one that I've just retrieved:
{
"cid":"103",
"inverterSn":"xxxx",
"value":"50,20,02:00-03:00,03:00-04:00,0,0,00:00-00:00,00:00-00:00,0,0,00:00-00:00,00:00-00:00",
"language":"2"
}
An additional note is given
Notice:1. Please set the working mode first. Voltage and current settings can only be set once, for all time periods
So, although there appears to be slots for current before other timeslots, those presumably aren't honoured.
I think we need to stick with that format and ignore the API doc
Activity
31-Dec-24 16:29
assigned to @btasker
31-Dec-24 16:37
mentioned in commit 526b322ced31f4efc53b43566d0a395a292e9252
Message
feat: process the read response according to spec (misc/soliscloud-inverter-control#1)
31-Dec-24 16:52
OK, I've been able to change the value
When I logged into Soliscloud to check, it had changed:
That period can be disabled by setting it back to
00:00-00:00
I'll commit the current state, but it's not particularly intuitive to use at the moment, I think we should probably abstract out to a dict so that things can be labelled
charge
anddischarge
31-Dec-24 17:49
mentioned in commit a9a8070732d4186f29e3ef108f0bd840a899b5a4
Message
chore: make timings object more intuitive (misc/soliscloud-inverter-control#1)
31-Dec-24 17:54
mentioned in commit 5249849b2f89b06fa6de58e8c6c5a34528128536
Message
fix: force type of currents (misc/soliscloud-inverter-control#1)
The API requires a string, but it'd be easy to forget and pass an int
31-Dec-24 17:56
OK, the format of the timings dict has been made more intuitive.
It can be created as follows:
Timings must be format
HH:MM-HH:MM
. All slots are mandatory but a value of00:00-00:00
means nothing will happen/change.charge_current
anddischarge_current
should be provided as strings, but will be caste to strings by the class.There are now three class methods:
readChargeDischargeSchedule(sn)
Read timings information from the inverter with serial numbersn
(will return a timings dict)setChargeDischargeTimings(sn, timings)
Set timings information for the inverter with serial numbersn
validateTimingsObj(timings)
Validate a timings dict (is called automatically by setChargeDischargeTimings)