Skip to content

Conversation

@kaisarturan
Copy link

Model SPF 5000 ES Inverter

AC Output Source Priority:
0:Bat Priority (SBU)
1:Pv Priority (SOL)
2:Uti Priority (UEI)
3:Pv&Uti Priority (SUB)

Example Request Parameters:

default = {
    "action":"storageSPF5000Set",
    "serialNum":"0X0Y0X0Y0X",
    "type":"storage_spf5000_ac_output_source",
    "param1":"","param2":"","param3":"","param4":"",
}
params = {"param1":"0"}
print(api.update_inverter_setting(default_parameters=default, parameters=params))

@muppet3000
Copy link
Contributor

The changes to removed the unused parameters are good - not sure how that was missed in the previous PR, although they're superfluous anyway as the update_inverter_setting is designed to be called indirectly anyway.
I'd need to validate the correct API endpoint though I'm certain that the last time I checked newTcpsetAPI.do was the correct endpoint.

@kaisarturan
Copy link
Author

newTcpsetAPI.do does not work with Model SPF 5000 ES Inverter
tcpSet.do does work with Model SPF 5000 ES Inverter
tcpSet.do also work with data retrieval from inverter.
Example:

default  = {}
params = {
    "action":"readStorageParam",
    "paramId":"storage_spf5000_ac_output_source",
    "serialNum":"0X0Y0X0Y0X",
    "startAddr":-1,
    "endAddr":-1,
}
print(api.update_inverter_setting(default_parameters=default, parameters=params))

Output:

{'msg': '3', 'success': True}

update_inverter_setting should be public because many exceptional case people want to pass raw parameters. Although this is possible in other way but I thought this is a neat.

I don't know you how validated or which inverter you validated to. Maybe growatt uses different API endpoint for different inverters.

@muppet3000
Copy link
Contributor

Thanks @kaisarturan I don't think this was tested against the SPF inverter, which is why you're seeing this issue.
In order to make this universal and not break compatibility my suggestion would be to add a new parameter to the update_inverter_setting function called endpoint and make it default to the existing value.
Then add a new helper function like we have for mix and ac for spf inverters, that function can then override the default value for endpoint used by the update_inverter_setting function.
This will ensure it's then backwards compatible for other users as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants