Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/shinephone/inverter_settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,6 @@ Known working settings & parameters are as follows (all parameter values are str

The four functions `update_tlx_inverter_setting`, `update_mix_inverter_setting`, `update_ac_inverter_setting`, and `update_inverter_setting` take either a dictionary or an array. If an array is passed it will automatically generate the `paramN` key based on array index since all params for settings seem to used the same numbering scheme.

Only the settings described above have been tested with `update_tlx_inverter_setting` and they all take only one single parameter. It is very likely that the function works with all settings returned by `tlx_get_enabled_settings`, but this has not been tested. A helper function `update_tlx_inverter_time_segment` is provided for the settings that require more than one parameter.
Only the settings described above have been tested with `update_tlx_inverter_setting` and they all take only one single parameter. It is very likely that the function works with all settings returned by `tlx_get_enabled_settings`, but this has not been tested. A helper function `update_tlx_inverter_time_segment` is provided for the settings that require more than one parameter.

The `api.get_mix_inverter_settings` method can be used to get the current inverter settings for the specified serial number including charge/discharge schedule for hybrid systems.
4 changes: 3 additions & 1 deletion examples/settings_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
current_settings = api.get_plant_settings(plant_id)
#pp.pprint(current_settings)


#Get mix inverter settings
inverter_settings = api.get_mix_inverter_settings(device_sn)
pp.pprint(inverter_settings)

#Change the timezone of the plant
plant_settings_changes = {
Expand Down
18 changes: 18 additions & 0 deletions growattServer/base_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,24 @@ def mix_detail(self, mix_id, plant_id, timespan=Timespan.hour, date=None):

return response.json().get('obj', {})

def get_mix_inverter_settings(self, serial_number):
"""
Gets the inverter settings related to battery modes
Keyword arguments:
serial_number -- The serial number (device_sn) of the inverter
Returns:
A dictionary of settings
"""

default_params = {
'op': 'getMixSetParams',
'serialNum': serial_number,
'kind': 0
}
response = self.session.get(self.get_url('newMixApi.do'), params=default_params)
data = json.loads(response.content.decode('utf-8'))
return data

def dashboard_data(self, plant_id, timespan=Timespan.hour, date=None):
"""
Get 'dashboard' data for specified timespan
Expand Down