foxesscloud 2.8.7__py3-none-any.whl → 2.8.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- foxesscloud/foxesscloud.py +20 -12
- foxesscloud/openapi.py +13 -9
- {foxesscloud-2.8.7.dist-info → foxesscloud-2.8.9.dist-info}/METADATA +12 -4
- foxesscloud-2.8.9.dist-info/RECORD +7 -0
- foxesscloud-2.8.7.dist-info/RECORD +0 -7
- {foxesscloud-2.8.7.dist-info → foxesscloud-2.8.9.dist-info}/LICENCE +0 -0
- {foxesscloud-2.8.7.dist-info → foxesscloud-2.8.9.dist-info}/WHEEL +0 -0
- {foxesscloud-2.8.7.dist-info → foxesscloud-2.8.9.dist-info}/top_level.txt +0 -0
foxesscloud/foxesscloud.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################################
|
2
2
|
"""
|
3
3
|
Module: Fox ESS Cloud
|
4
|
-
Updated:
|
4
|
+
Updated: 12 October 2025
|
5
5
|
By: Tony Matthews
|
6
6
|
"""
|
7
7
|
##################################################################################################
|
@@ -10,7 +10,7 @@ By: Tony Matthews
|
|
10
10
|
# ALL RIGHTS ARE RESERVED © Tony Matthews 2023
|
11
11
|
##################################################################################################
|
12
12
|
|
13
|
-
version = "1.9.
|
13
|
+
version = "1.9.9"
|
14
14
|
print(f"FoxESS-Cloud version {version}")
|
15
15
|
|
16
16
|
debug_setting = 1
|
@@ -912,14 +912,14 @@ def get_min():
|
|
912
912
|
output(f"** get_min(), no result data, {errno_message(errno)}")
|
913
913
|
return None
|
914
914
|
battery_settings['minSoc'] = result.get('minSoc')
|
915
|
-
battery_settings['
|
915
|
+
battery_settings['minSocOnGrid'] = result.get('minGridSoc')
|
916
916
|
return battery_settings
|
917
917
|
|
918
918
|
##################################################################################################
|
919
919
|
# set min soc from battery_settings or parameters
|
920
920
|
##################################################################################################
|
921
921
|
|
922
|
-
def set_min(
|
922
|
+
def set_min(minSocOnGrid = None, minSoc = None, force = 0):
|
923
923
|
global device_sn, battery_settings, debug_setting, messages
|
924
924
|
if get_device() is None:
|
925
925
|
return None
|
@@ -928,16 +928,24 @@ def set_min(minGridSoc = None, minSoc = None, force = 0):
|
|
928
928
|
output(f"** set_min(): cannot set min SoC mode when a schedule is enabled")
|
929
929
|
return None
|
930
930
|
set_schedule(enable=0)
|
931
|
-
data = {'sn': device_sn}
|
932
931
|
if battery_settings is None:
|
933
932
|
battery_settings = {}
|
934
|
-
if
|
935
|
-
|
936
|
-
|
933
|
+
if minSocOnGrid is not None:
|
934
|
+
if minSocOnGrid < 0 or minSocOnGrid > 100:
|
935
|
+
output(f"** set_min(): invalid minSocOnGrid = {minSocOnGrid}. Must be between 0 and 100")
|
936
|
+
return None
|
937
|
+
battery_settings['minSocOnGrid'] = minSocOnGrid
|
937
938
|
if minSoc is not None:
|
938
|
-
|
939
|
+
if minSoc < 0 or minSoc > 100:
|
940
|
+
output(f"** set_min(): invalid minSoc = {minSoc}. Must be between 0 and 100")
|
941
|
+
return None
|
939
942
|
battery_settings['minSoc'] = minSoc
|
940
|
-
|
943
|
+
data = {'sn': device_sn}
|
944
|
+
if battery_settings.get('minSocOnGrid') is not None:
|
945
|
+
data['minGridSoc'] = battery_settings['minSocOnGrid']
|
946
|
+
if battery_settings.get('minSoc') is not None:
|
947
|
+
data['minSoc'] = battery_settings['minSoc']
|
948
|
+
output(f"\nSetting minSocOnGrid = {battery_settings.get('minSocOnGrid')}, minSoc = {battery_settings.get('minSoc')}", 1)
|
941
949
|
setting_delay()
|
942
950
|
response = signed_post(path="/c/v0/device/battery/soc/set", data=data)
|
943
951
|
if response.status_code != 200:
|
@@ -2937,7 +2945,7 @@ base_time = None
|
|
2937
2945
|
|
2938
2946
|
# charge_needed settings
|
2939
2947
|
charge_config = {
|
2940
|
-
'contingency': [15,10,
|
2948
|
+
'contingency': [25,15,10,20], # % of consumption. Single value or [winter, spring, summer, autumn]
|
2941
2949
|
'capacity': None, # Battery capacity (over-ride)
|
2942
2950
|
'min_soc': None, # Minimum Soc. Default 10%
|
2943
2951
|
'max_soc': None, # Maximum Soc. Default 100%
|
@@ -2966,7 +2974,7 @@ charge_config = {
|
|
2966
2974
|
'forecast_selection': 1, # 0 = use available forecast / generation, 1 only update settings with forecast
|
2967
2975
|
'annual_consumption': None, # optional annual consumption in kWh
|
2968
2976
|
'timed_mode': 0, # 0 = None, 1 = timed mode, 2 = strategy mode
|
2969
|
-
'special_contingency':
|
2977
|
+
'special_contingency': 35, # contingency for special days when consumption might be higher
|
2970
2978
|
'special_days': ['12-25', '12-26', '01-01'],
|
2971
2979
|
'full_charge': None, # day of month (1-28) to do full charge, or 'daily' or 'Mon', 'Tue' etc
|
2972
2980
|
'data_wrap': 6, # data items to show per line
|
foxesscloud/openapi.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################################
|
2
2
|
"""
|
3
3
|
Module: Fox ESS Cloud using Open API
|
4
|
-
Updated:
|
4
|
+
Updated: 12 October 2025
|
5
5
|
By: Tony Matthews
|
6
6
|
"""
|
7
7
|
##################################################################################################
|
@@ -10,7 +10,7 @@ By: Tony Matthews
|
|
10
10
|
# ALL RIGHTS ARE RESERVED © Tony Matthews 2024
|
11
11
|
##################################################################################################
|
12
12
|
|
13
|
-
version = "2.8.
|
13
|
+
version = "2.8.9"
|
14
14
|
print(f"FoxESS-Cloud Open API version {version}")
|
15
15
|
|
16
16
|
debug_setting = 1
|
@@ -823,13 +823,13 @@ def set_min(minSocOnGrid = None, minSoc = None, force = 0):
|
|
823
823
|
if battery_settings is None:
|
824
824
|
battery_settings = {}
|
825
825
|
if minSocOnGrid is not None:
|
826
|
-
if minSocOnGrid <
|
827
|
-
output(f"** set_min(): invalid minSocOnGrid = {minSocOnGrid}. Must be between
|
826
|
+
if minSocOnGrid < 0 or minSocOnGrid > 100:
|
827
|
+
output(f"** set_min(): invalid minSocOnGrid = {minSocOnGrid}. Must be between 0 and 100")
|
828
828
|
return None
|
829
829
|
battery_settings['minSocOnGrid'] = minSocOnGrid
|
830
830
|
if minSoc is not None:
|
831
|
-
if minSoc <
|
832
|
-
output(f"** set_min(): invalid minSoc = {minSoc}. Must be between
|
831
|
+
if minSoc < 0 or minSoc > 100:
|
832
|
+
output(f"** set_min(): invalid minSoc = {minSoc}. Must be between 0 and 100")
|
833
833
|
return None
|
834
834
|
battery_settings['minSoc'] = minSoc
|
835
835
|
body = {'sn': device_sn}
|
@@ -837,7 +837,7 @@ def set_min(minSocOnGrid = None, minSoc = None, force = 0):
|
|
837
837
|
body['minSocOnGrid'] = battery_settings['minSocOnGrid']
|
838
838
|
if battery_settings.get('minSoc') is not None:
|
839
839
|
body['minSoc'] = battery_settings['minSoc']
|
840
|
-
output(f"\nSetting
|
840
|
+
output(f"\nSetting minSocOnGrid = {battery_settings.get('minSocOnGrid')}, minSoc = {battery_settings.get('minSoc')}", 1)
|
841
841
|
setting_delay()
|
842
842
|
response = signed_post(path="/op/v0/device/battery/soc/set", body=body)
|
843
843
|
if response.status_code != 200:
|
@@ -1665,6 +1665,10 @@ def get_report(dimension='day', d=None, v=None, summary=1, save=None, load=None,
|
|
1665
1665
|
if errno > 0 or result is None or len(result) == 0:
|
1666
1666
|
output(f"** get_report(), no report data available, {errno_message(response)}")
|
1667
1667
|
return None
|
1668
|
+
# correct variables in year report (AP 19/09/2025):
|
1669
|
+
if dimension == 'year':
|
1670
|
+
for i, var in enumerate(result):
|
1671
|
+
var['variable'] = v[i]
|
1668
1672
|
# correct errors in report values:
|
1669
1673
|
if fix_values == 1:
|
1670
1674
|
for var in result:
|
@@ -2638,7 +2642,7 @@ base_time = None
|
|
2638
2642
|
|
2639
2643
|
# charge_needed settings
|
2640
2644
|
charge_config = {
|
2641
|
-
'contingency': [15,10,
|
2645
|
+
'contingency': [25,15,10,20], # % of consumption. Single value or [winter, spring, summer, autumn]
|
2642
2646
|
'capacity': None, # Battery capacity (over-ride)
|
2643
2647
|
'min_soc': None, # Minimum Soc. Default 10%
|
2644
2648
|
'max_soc': None, # Maximum Soc. Default 100%
|
@@ -2667,7 +2671,7 @@ charge_config = {
|
|
2667
2671
|
'forecast_selection': 1, # 0 = use available forecast / generation, 1 only update settings with forecast
|
2668
2672
|
'annual_consumption': None, # optional annual consumption in kWh
|
2669
2673
|
'timed_mode': 0, # 0 = None, 1 = timed mode, 2 = strategy mode
|
2670
|
-
'special_contingency':
|
2674
|
+
'special_contingency': 35, # contingency for special days when consumption might be higher
|
2671
2675
|
'special_days': ['12-25', '12-26', '01-01'],
|
2672
2676
|
'full_charge': None, # day of month (1-28) to do full charge, or 'daily' or 'Mon', 'Tue' etc
|
2673
2677
|
'data_wrap': 6, # data items to show per line
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: foxesscloud
|
3
|
-
Version: 2.8.
|
3
|
+
Version: 2.8.9
|
4
4
|
Summary: library for accessing Fox ESS cloud data using Open API
|
5
5
|
Author-email: Tony Matthews <tony@quasair.co.uk>
|
6
6
|
Project-URL: Homepage, https://github.com/TonyM1958/FoxESS-Cloud
|
@@ -163,6 +163,7 @@ f.set_named_settings(name, value, force)
|
|
163
163
|
set_min() applies new SoC settings to the inverter. The parameters update battery_settings:
|
164
164
|
+ minSocOnGrid: min Soc on Grid setting e.g. 15 = 15%
|
165
165
|
+ minSoc: min Soc setting e.g. 10 = 10%
|
166
|
+
+ force: setting to 1 will disable Mode Scheduler, if enabled. Default is 0.
|
166
167
|
|
167
168
|
set_charge() takes the charge times from the battery_settings and applies these to the inverter. The parameters are optional and will update battery_settings. You should specify all 3 parameter for a time period:
|
168
169
|
+ ch1: enable charge from grid for period 1 (default True)
|
@@ -191,7 +192,7 @@ set_schedule() configures a list of scheduled work mode / soc changes with enabl
|
|
191
192
|
|
192
193
|
set_named_settings() sets the 'name' setting to 'value'.
|
193
194
|
+ 'name' may also be a list of (name, value) pairs.
|
194
|
-
+
|
195
|
+
+ force: setting to 1 will disable Mode Scheduler, if enabled. Default is 0.
|
195
196
|
+ a return value of 1 is success. 0 means setting failed. None is another error e.g. device not found, invalid name or value.
|
196
197
|
+ named_settings currently supported include: ExportLimit, MinSoc, MinSocOnGrid, MaxSoc, GridCode, WorkMode
|
197
198
|
|
@@ -389,7 +390,7 @@ Given the data available, the modelling works as follows:
|
|
389
390
|
|
390
391
|
The following parameters and default values are used to configure charge_needed and may be updated if required using name=value:
|
391
392
|
```
|
392
|
-
contingency: [
|
393
|
+
contingency: [25,15,10,20] # % of consumption. Single or [winter, spring, summer, autumn] values
|
393
394
|
capacity: None # Battery capacity in kWh (over-rides generated value if set)
|
394
395
|
charge_current: None # max battery charge current setting in A. None uses a value derrived from the inverter model
|
395
396
|
discharge_current: None # max battery discharge current setting in A. None uses a value derrived from the inverter model
|
@@ -418,7 +419,7 @@ solar_adjust: 100 # % adjustment to make to Solar forecast
|
|
418
419
|
forecast_selection: 1 # 1 = only update charge times if forecast is available, 0 = use best available data. Default is 1.
|
419
420
|
annual_consumption: None # optional annual consumption in kWh. If set, this replaces consumption history
|
420
421
|
timed_mode: 0 # 0 = None, 1 = use timed work mode, 2 = strategy mode
|
421
|
-
special_contingency:
|
422
|
+
special_contingency: 35 # contingency for special days when consumption might be higher
|
422
423
|
special_days: ['12-25', '12-26', '01-01']
|
423
424
|
full_charge: None # day of month (1-28) to do full charge or 'daily' or day of week: 'Mon', 'Tue' etc
|
424
425
|
force: 1 # 1 = disable strategy periods when setting charge. 0 = fail if strategy period has been set.
|
@@ -819,6 +820,13 @@ This setting can be:
|
|
819
820
|
|
820
821
|
|
821
822
|
# Version Info
|
823
|
+
2.8.9 - 2025/10/12<br>
|
824
|
+
Change default contingency for charge_needed() to [25,15,10,20] and special contingency to 35.
|
825
|
+
|
826
|
+
2.8.8<br>
|
827
|
+
Fix problem where Open API returns conflicting variable names when reporting stats by year.
|
828
|
+
Update daily template for Saturn Cloud to new YAML format.
|
829
|
+
Update set_min() to accept 0 instead of 10.
|
822
830
|
|
823
831
|
2.8.7<br>
|
824
832
|
Added f.get_signal().
|
@@ -0,0 +1,7 @@
|
|
1
|
+
foxesscloud/foxesscloud.py,sha256=O31bhb4DubVGdK5FA48DrVyDq_YJoNvOcgnucc3oSDk,225904
|
2
|
+
foxesscloud/openapi.py,sha256=FYijuE6zvvwoeDzZTXO66OJigmekQTJdfKoUc72NjHY,211085
|
3
|
+
foxesscloud-2.8.9.dist-info/LICENCE,sha256=8JF-24QkE8UfdII-g6RaIEvM-PZ9zwaEcxlwYUDMt-4,1079
|
4
|
+
foxesscloud-2.8.9.dist-info/METADATA,sha256=ANCdboZ7B0-pOvSPC05_ss5RZXBe3PC9OsLnGoN3P74,66253
|
5
|
+
foxesscloud-2.8.9.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
6
|
+
foxesscloud-2.8.9.dist-info/top_level.txt,sha256=IWOrKSNZCLU6IDXSX_b4_bqCfbZoWAT4CC0w0Lg7PuU,12
|
7
|
+
foxesscloud-2.8.9.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
foxesscloud/foxesscloud.py,sha256=fUB4O3p4UvnHAU2YMzUYh5eunMYjqJu9FpIfE9mPtVE,225412
|
2
|
-
foxesscloud/openapi.py,sha256=ZpVcrpMU11FI8oAQlrbhoXCiFGP-ooD6me7D37CbkkE,210915
|
3
|
-
foxesscloud-2.8.7.dist-info/LICENCE,sha256=8JF-24QkE8UfdII-g6RaIEvM-PZ9zwaEcxlwYUDMt-4,1079
|
4
|
-
foxesscloud-2.8.7.dist-info/METADATA,sha256=XqyaBg9PXtXn82IkUJmvRQ59GFOCgUKUyqtxfvfr1xk,65846
|
5
|
-
foxesscloud-2.8.7.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
6
|
-
foxesscloud-2.8.7.dist-info/top_level.txt,sha256=IWOrKSNZCLU6IDXSX_b4_bqCfbZoWAT4CC0w0Lg7PuU,12
|
7
|
-
foxesscloud-2.8.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|