misc/soliscloud-inverter-control#9: Provide ability to change charge rate



Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Milestone: PoC
Created: 02-Jan-25 09:01



Description

The API doesn't currently expose the ability to change the charge or discharge rate.

I'd like to be able to change these on demand.

There are two ways that we could go about this:

  • Change start* endpoints to accept a rate in the post body
  • Add a new endpoint which simply changes the rates

The second way would allow independent changes, but would usually mean 2 API calls (which by extension means Soliscloud has to set registers twice).

I think the answer is probably to implement both



Toggle State Changes

Activity


assigned to @btasker

mentioned in issue solar#38

verified

mentioned in commit 53a0a80a3e86e33b4e0221b4bd0f99f4c90f86d4

Commit: 53a0a80a3e86e33b4e0221b4bd0f99f4c90f86d4 
Author: B Tasker                            
                            
Date: 2025-01-02T12:10:14.000+00:00 

Message

feat: allow custom charge rates to be set (misc/soliscloud-inverter-control#9)

This allows new charge and discharge rates to be provided when triggering an immediate start or stop

+25 -10 (35 lines changed)

The following functions now accept an optional argument rates

  • immediateStart()
  • immediateStop()
  • startCharge()
  • stopCharge()
  • startDischarge()
  • stopDischarge()

When supplied, rates is a dict which contains one or both of charge_current and discharge_current

The stop* functions support it so that current settings can be changed back if they were boosted when calling immedateStart()

verified

mentioned in commit cd72add228c566841770a5fc8260ef61cf6df12b

Commit: cd72add228c566841770a5fc8260ef61cf6df12b 
Author: B Tasker                            
                            
Date: 2025-01-02T12:22:35.000+00:00 

Message

feat: control_server now allows rates to be set (misc/soliscloud-inverter-control#9)

+54 -12 (66 lines changed)
verified

mentioned in commit 33aa4f4fe42dd70cf94a0db49cae3140c915a9b1

Commit: 33aa4f4fe42dd70cf94a0db49cae3140c915a9b1 
Author: B Tasker                            
                            
Date: 2025-01-02T12:45:35.000+00:00 

Message

feat: start/stop end points can accept charge rates (misc/soliscloud-inverter-control#9)

+1 -1 (2 lines changed)

The start/stop endpoints can now accept charge and discharge rates.

This ticket can't be closed yet though, we also need to give the control server and API endpoint to only change the rate (so that rates can be put back without interrupting charging).

verified

mentioned in commit a4acb63d70ed8e5b16988c51a75594fca2e1c4da

Commit: a4acb63d70ed8e5b16988c51a75594fca2e1c4da 
Author: B Tasker                            
                            
Date: 2025-01-02T13:53:09.000+00:00 

Message

feat: new endpoint to set current without changing timings (misc/soliscloud-inverter-control#9)

+59 -0 (59 lines changed)

The commit above adds an API endpoint to the control server: /api/v1/setCurrent

This accepts a JSON payload

curl -H "Content-type: application/json" \
-d '{"charge_current" : 30, "discharge_current": 55}' \
http://127.0.0.1:8081/api/v1/setCurrent

In order to support this, the python library also has a new method

soliscloud.setCurrents(rates)

rates is a dict:

{
  "charge_current": 30,
  "discharge_current": 55
}

The function will read configuration from the inverter, overlay the provided currents and post back.

mentioned in issue solar#40