foxesscloud 2.9.3__tar.gz → 2.9.5__tar.gz
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-2.9.3/src/foxesscloud.egg-info → foxesscloud-2.9.5}/PKG-INFO +16 -6
- {foxesscloud-2.9.3 → foxesscloud-2.9.5}/README.md +15 -5
- {foxesscloud-2.9.3 → foxesscloud-2.9.5}/pyproject.toml +1 -1
- {foxesscloud-2.9.3 → foxesscloud-2.9.5}/src/foxesscloud/foxesscloud.py +3 -4
- {foxesscloud-2.9.3 → foxesscloud-2.9.5}/src/foxesscloud/openapi.py +58 -36
- {foxesscloud-2.9.3 → foxesscloud-2.9.5/src/foxesscloud.egg-info}/PKG-INFO +16 -6
- {foxesscloud-2.9.3 → foxesscloud-2.9.5}/LICENCE +0 -0
- {foxesscloud-2.9.3 → foxesscloud-2.9.5}/setup.cfg +0 -0
- {foxesscloud-2.9.3 → foxesscloud-2.9.5}/src/foxesscloud.egg-info/SOURCES.txt +0 -0
- {foxesscloud-2.9.3 → foxesscloud-2.9.5}/src/foxesscloud.egg-info/dependency_links.txt +0 -0
- {foxesscloud-2.9.3 → foxesscloud-2.9.5}/src/foxesscloud.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: foxesscloud
|
|
3
|
-
Version: 2.9.
|
|
3
|
+
Version: 2.9.5
|
|
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
|
|
@@ -118,7 +118,7 @@ f.get_peakshaving()
|
|
|
118
118
|
f.get_flag()
|
|
119
119
|
f.get_schedule()
|
|
120
120
|
f.get_named_settings(name)
|
|
121
|
-
f.
|
|
121
|
+
f.get_heating()
|
|
122
122
|
|
|
123
123
|
```
|
|
124
124
|
Each of these calls will return a dictionary or list containing the relevant information.
|
|
@@ -139,6 +139,7 @@ get_settings() will return the battery settings and is equivalent to get_charge(
|
|
|
139
139
|
get_peakshaving() will return the current peak shaving settings for inverters that support this work mode.
|
|
140
140
|
|
|
141
141
|
get_flag() returns the current scheduler enable / support / maxsoc flags. By default support for Max Soc is set to False.
|
|
142
|
+
+ f.max_periods / schedule['maxGroupCount'] gives the maximum number of time periods that are supported.
|
|
142
143
|
|
|
143
144
|
get_schedule() returns the current work mode / soc schedule settings. The result is stored in f.schedule.
|
|
144
145
|
+ if the schedule returned contains any values for 'maxSoc', the f.schedule['maxsoc'] is set to True to indicate that the current inverter supports setting Max Soc in schedules and Max Soc values are set by set_schedule().
|
|
@@ -147,7 +148,7 @@ get_named_settings() returns the value of a named setting. If 'name' is a list,
|
|
|
147
148
|
+ f.named_settings is updated. This is dictionary of information and current value, indexed by 'name'.
|
|
148
149
|
+ named_settings currently available are stored in f.name_list. The settings supported depends on the inverter model and firmware version. An error will be returned if an unsupported variable is used.
|
|
149
150
|
|
|
150
|
-
|
|
151
|
+
get_heating returns the current battery heating parameters and store these in f.device['heating']
|
|
151
152
|
|
|
152
153
|
## Inverter Settings
|
|
153
154
|
You can change inverter settings using:
|
|
@@ -158,7 +159,7 @@ f.set_charge(ch1, st1, en1, ch2, st2, en2, enable)
|
|
|
158
159
|
f.set_period(start, end, mode, min_soc, max_soc, fdsoc, fdpwr, price, segment)
|
|
159
160
|
f.set_schedule(periods, enable)
|
|
160
161
|
f.set_named_settings(name, value, force)
|
|
161
|
-
f.
|
|
162
|
+
f.set_heating(enable, start, end, time1, time2, time3)
|
|
162
163
|
```
|
|
163
164
|
|
|
164
165
|
set_min() applies new SoC settings to the inverter. The parameters update battery_settings:
|
|
@@ -201,7 +202,7 @@ set_named_settings() sets the 'name' setting to 'value'.
|
|
|
201
202
|
+ a return value of 1 is success. 0 means setting failed. None is another error e.g. device not found, invalid name or value.
|
|
202
203
|
+ named_settings currently available are stored in f.name_list. The settings supported depend on the inverter model and firmware version. An error will be returned if an unsupported varaible is used.
|
|
203
204
|
|
|
204
|
-
|
|
205
|
+
set_heating() set the heating parameters as follows:
|
|
205
206
|
+ enable: optional, 0 or 1, default is 1
|
|
206
207
|
+ start, end: optional start and end temperatures. The defaults are start at 9C and end at 12C.
|
|
207
208
|
+ time1, time2, time3: optional times when the battery can heat from the grid time. The structure is {'enable': 1, 'start': '00:30', 'end': '05:30'}. The time slot is disabled by default.
|
|
@@ -496,7 +497,7 @@ This is an example of the output from battery_info():
|
|
|
496
497
|
## Date Ranges
|
|
497
498
|
|
|
498
499
|
```
|
|
499
|
-
f.date_list(s, e, limit, span, today)
|
|
500
|
+
f.date_list(s, e, limit, span, today, step)
|
|
500
501
|
```
|
|
501
502
|
|
|
502
503
|
Returns a list of dates in the format 'YYYY-MM-DD'. This function will not return dates in the future. The last date will be yesterday or today (if today is True). All parameters are optional:
|
|
@@ -506,6 +507,7 @@ Returns a list of dates in the format 'YYYY-MM-DD'. This function will not retur
|
|
|
506
507
|
+ limit: maximum number of days. The default is 200
|
|
507
508
|
+ span: the range of dates. One of 'day', 'week', 'month' or 'year', '2days' or 'weekday'
|
|
508
509
|
+ today: 1 allows today to be included, 2 allows future dates to be included. Default is 0, date list will stop at yesterday
|
|
510
|
+
+ step: optional days to add (default is 1)
|
|
509
511
|
|
|
510
512
|
You can use 'span' as follows:
|
|
511
513
|
+ 'day' provides a single day
|
|
@@ -830,6 +832,14 @@ This setting can be:
|
|
|
830
832
|
|
|
831
833
|
# Version Info
|
|
832
834
|
|
|
835
|
+
2.9.5 - 2026/02/27<br>
|
|
836
|
+
Add step parameter to date_list().
|
|
837
|
+
Get maxGroupCount from v3 scheduler and update f.max_periods with maximum number of time periods supported.
|
|
838
|
+
|
|
839
|
+
2.9.4 - 2026/01/22<br>
|
|
840
|
+
Rename get_battery_heating(), set_battery_heating() to get_heating() and set_heating().
|
|
841
|
+
Update get_heating() to return a dictionary to simplify parameter access.
|
|
842
|
+
|
|
833
843
|
2.9.3 - 2026/01/18<br>
|
|
834
844
|
Update get_device() to use v1 API call.
|
|
835
845
|
Update get_battery() to work out battery count and rated capacity from device battery list.
|
|
@@ -104,7 +104,7 @@ f.get_peakshaving()
|
|
|
104
104
|
f.get_flag()
|
|
105
105
|
f.get_schedule()
|
|
106
106
|
f.get_named_settings(name)
|
|
107
|
-
f.
|
|
107
|
+
f.get_heating()
|
|
108
108
|
|
|
109
109
|
```
|
|
110
110
|
Each of these calls will return a dictionary or list containing the relevant information.
|
|
@@ -125,6 +125,7 @@ get_settings() will return the battery settings and is equivalent to get_charge(
|
|
|
125
125
|
get_peakshaving() will return the current peak shaving settings for inverters that support this work mode.
|
|
126
126
|
|
|
127
127
|
get_flag() returns the current scheduler enable / support / maxsoc flags. By default support for Max Soc is set to False.
|
|
128
|
+
+ f.max_periods / schedule['maxGroupCount'] gives the maximum number of time periods that are supported.
|
|
128
129
|
|
|
129
130
|
get_schedule() returns the current work mode / soc schedule settings. The result is stored in f.schedule.
|
|
130
131
|
+ if the schedule returned contains any values for 'maxSoc', the f.schedule['maxsoc'] is set to True to indicate that the current inverter supports setting Max Soc in schedules and Max Soc values are set by set_schedule().
|
|
@@ -133,7 +134,7 @@ get_named_settings() returns the value of a named setting. If 'name' is a list,
|
|
|
133
134
|
+ f.named_settings is updated. This is dictionary of information and current value, indexed by 'name'.
|
|
134
135
|
+ named_settings currently available are stored in f.name_list. The settings supported depends on the inverter model and firmware version. An error will be returned if an unsupported variable is used.
|
|
135
136
|
|
|
136
|
-
|
|
137
|
+
get_heating returns the current battery heating parameters and store these in f.device['heating']
|
|
137
138
|
|
|
138
139
|
## Inverter Settings
|
|
139
140
|
You can change inverter settings using:
|
|
@@ -144,7 +145,7 @@ f.set_charge(ch1, st1, en1, ch2, st2, en2, enable)
|
|
|
144
145
|
f.set_period(start, end, mode, min_soc, max_soc, fdsoc, fdpwr, price, segment)
|
|
145
146
|
f.set_schedule(periods, enable)
|
|
146
147
|
f.set_named_settings(name, value, force)
|
|
147
|
-
f.
|
|
148
|
+
f.set_heating(enable, start, end, time1, time2, time3)
|
|
148
149
|
```
|
|
149
150
|
|
|
150
151
|
set_min() applies new SoC settings to the inverter. The parameters update battery_settings:
|
|
@@ -187,7 +188,7 @@ set_named_settings() sets the 'name' setting to 'value'.
|
|
|
187
188
|
+ a return value of 1 is success. 0 means setting failed. None is another error e.g. device not found, invalid name or value.
|
|
188
189
|
+ named_settings currently available are stored in f.name_list. The settings supported depend on the inverter model and firmware version. An error will be returned if an unsupported varaible is used.
|
|
189
190
|
|
|
190
|
-
|
|
191
|
+
set_heating() set the heating parameters as follows:
|
|
191
192
|
+ enable: optional, 0 or 1, default is 1
|
|
192
193
|
+ start, end: optional start and end temperatures. The defaults are start at 9C and end at 12C.
|
|
193
194
|
+ time1, time2, time3: optional times when the battery can heat from the grid time. The structure is {'enable': 1, 'start': '00:30', 'end': '05:30'}. The time slot is disabled by default.
|
|
@@ -482,7 +483,7 @@ This is an example of the output from battery_info():
|
|
|
482
483
|
## Date Ranges
|
|
483
484
|
|
|
484
485
|
```
|
|
485
|
-
f.date_list(s, e, limit, span, today)
|
|
486
|
+
f.date_list(s, e, limit, span, today, step)
|
|
486
487
|
```
|
|
487
488
|
|
|
488
489
|
Returns a list of dates in the format 'YYYY-MM-DD'. This function will not return dates in the future. The last date will be yesterday or today (if today is True). All parameters are optional:
|
|
@@ -492,6 +493,7 @@ Returns a list of dates in the format 'YYYY-MM-DD'. This function will not retur
|
|
|
492
493
|
+ limit: maximum number of days. The default is 200
|
|
493
494
|
+ span: the range of dates. One of 'day', 'week', 'month' or 'year', '2days' or 'weekday'
|
|
494
495
|
+ today: 1 allows today to be included, 2 allows future dates to be included. Default is 0, date list will stop at yesterday
|
|
496
|
+
+ step: optional days to add (default is 1)
|
|
495
497
|
|
|
496
498
|
You can use 'span' as follows:
|
|
497
499
|
+ 'day' provides a single day
|
|
@@ -816,6 +818,14 @@ This setting can be:
|
|
|
816
818
|
|
|
817
819
|
# Version Info
|
|
818
820
|
|
|
821
|
+
2.9.5 - 2026/02/27<br>
|
|
822
|
+
Add step parameter to date_list().
|
|
823
|
+
Get maxGroupCount from v3 scheduler and update f.max_periods with maximum number of time periods supported.
|
|
824
|
+
|
|
825
|
+
2.9.4 - 2026/01/22<br>
|
|
826
|
+
Rename get_battery_heating(), set_battery_heating() to get_heating() and set_heating().
|
|
827
|
+
Update get_heating() to return a dictionary to simplify parameter access.
|
|
828
|
+
|
|
819
829
|
2.9.3 - 2026/01/18<br>
|
|
820
830
|
Update get_device() to use v1 API call.
|
|
821
831
|
Update get_battery() to work out battery count and rated capacity from device battery list.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
##################################################################################################
|
|
2
2
|
"""
|
|
3
3
|
Module: Fox ESS Cloud
|
|
4
|
-
Updated:
|
|
4
|
+
Updated: 11 February 2026
|
|
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.11.
|
|
13
|
+
version = "1.11.1"
|
|
14
14
|
print(f"FoxESS-Cloud version {version}")
|
|
15
15
|
|
|
16
16
|
debug_setting = 1
|
|
@@ -3821,7 +3821,7 @@ def battery_monitor(interval=30, run=48, log=1, count=None, save=None, overwrite
|
|
|
3821
3821
|
# span: 'week', 'month' or 'year' generated dates that span a week, month or year
|
|
3822
3822
|
# quiet: do not print results if True
|
|
3823
3823
|
|
|
3824
|
-
def date_list(s = None, e = None, limit = None, span = None, today = 0, quiet = True):
|
|
3824
|
+
def date_list(s = None, e = None, limit = None, span = None, today = 0, quiet = True, step=1):
|
|
3825
3825
|
global debug_setting
|
|
3826
3826
|
latest_date = datetime.date(datetime.now())
|
|
3827
3827
|
today = 0 if today == False else 1 if today == True else today
|
|
@@ -3830,7 +3830,6 @@ def date_list(s = None, e = None, limit = None, span = None, today = 0, quiet =
|
|
|
3830
3830
|
first = datetime.date(datetime.strptime(s, '%Y-%m-%d')) if type(s) is str else s.date() if s is not None else None
|
|
3831
3831
|
last = datetime.date(datetime.strptime(e, '%Y-%m-%d')) if type(e) is str else e.date() if e is not None else None
|
|
3832
3832
|
last = latest_date if last is not None and last > latest_date and today != 2 else last
|
|
3833
|
-
step = 1
|
|
3834
3833
|
if first is None and last is None:
|
|
3835
3834
|
last = latest_date
|
|
3836
3835
|
if span is not None:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
##################################################################################################
|
|
2
2
|
"""
|
|
3
3
|
Module: Fox ESS Cloud using Open API
|
|
4
|
-
Updated:
|
|
4
|
+
Updated: 27 February 2026
|
|
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.9.
|
|
13
|
+
version = "2.9.5"
|
|
14
14
|
print(f"FoxESS-Cloud Open API version {version}")
|
|
15
15
|
|
|
16
16
|
debug_setting = 1
|
|
@@ -692,10 +692,8 @@ def get_battery_real():
|
|
|
692
692
|
# battery heating settings
|
|
693
693
|
##################################################################################################
|
|
694
694
|
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
def get_battery_heating():
|
|
698
|
-
global device_sn, device, battery_heating
|
|
695
|
+
def get_heating():
|
|
696
|
+
global device_sn, device
|
|
699
697
|
if get_device() is None:
|
|
700
698
|
return None
|
|
701
699
|
output(f"getting battery heating", 2)
|
|
@@ -705,42 +703,59 @@ def get_battery_heating():
|
|
|
705
703
|
output(f"** get_battery_heating() got response code {response.status_code}: {response.reason}")
|
|
706
704
|
return None
|
|
707
705
|
errno = response.json().get('errno')
|
|
708
|
-
if errno != 0:
|
|
709
|
-
if errno == 41200:
|
|
710
|
-
output(f"** get_battery_heating(): not supported")
|
|
711
|
-
else:
|
|
712
|
-
output(f"** get_battery_heating(): {errno_message(response)}")
|
|
713
|
-
return None
|
|
714
706
|
result = response.json().get('result')
|
|
715
|
-
|
|
716
|
-
|
|
707
|
+
if errno != 0 and errno != 41200:
|
|
708
|
+
output(f"** get_battery_heating(): {errno_message(response)}")
|
|
709
|
+
return None
|
|
710
|
+
if result is None:
|
|
711
|
+
items = None
|
|
712
|
+
else:
|
|
713
|
+
items = {'result': result}
|
|
714
|
+
for i in result['dataList']:
|
|
715
|
+
n = i['name']
|
|
716
|
+
if 'time' in n:
|
|
717
|
+
j = n[:5]
|
|
718
|
+
if items.get(j) is None:
|
|
719
|
+
items[j] = {'enable': 0, 'start': 0.0, 'end': 0.0}
|
|
720
|
+
k = 'end' if 'End' in n else 'start' if 'Start' in n else 'enable'
|
|
721
|
+
if k == 'enable':
|
|
722
|
+
items[j]['enable'] = 0 if i['value'] == 'disable' else 1
|
|
723
|
+
else:
|
|
724
|
+
t = (int(i['value']) / 60) if 'Minute' in n else int(i['value'])
|
|
725
|
+
items[j][k] += t
|
|
726
|
+
else:
|
|
727
|
+
items[i['name']] = i['value']
|
|
728
|
+
device['heating'] = items
|
|
729
|
+
return items
|
|
717
730
|
|
|
718
731
|
def set_time(body, s, time):
|
|
719
732
|
if time is None:
|
|
720
|
-
body[s + 'Enable'] =
|
|
721
|
-
body[s + 'StartHour'] = 0
|
|
722
|
-
body[s + 'StartMinute'] = 0
|
|
723
|
-
body[s + 'EndHour'] = 0
|
|
724
|
-
body[s + 'EndMinute'] = 0
|
|
733
|
+
body[s + 'Enable'] = 'disable'
|
|
734
|
+
body[s + 'StartHour'] = '0'
|
|
735
|
+
body[s + 'StartMinute'] = '0'
|
|
736
|
+
body[s + 'EndHour'] = '0'
|
|
737
|
+
body[s + 'EndMinute'] = '0'
|
|
725
738
|
else:
|
|
726
|
-
body[s + 'Enable'] = time['enable']
|
|
739
|
+
body[s + 'Enable'] = 'enable' if time['enable'] == 1 else 'disable'
|
|
727
740
|
t = time_hours(time['start'])
|
|
728
|
-
body[s + 'StartHour'] = int(t)
|
|
729
|
-
body[s + 'StartMinute'] = int(60 * (t - int(t)) + 0.5)
|
|
741
|
+
body[s + 'StartHour'] = str(int(t))
|
|
742
|
+
body[s + 'StartMinute'] = str(int(60 * (t - int(t)) + 0.5))
|
|
730
743
|
t = time_hours(time['end'])
|
|
731
|
-
body[s + 'EndHour'] = int(t)
|
|
732
|
-
body[s + 'EndMinute'] = int(60 * (t - int(t)) + 0.5)
|
|
744
|
+
body[s + 'EndHour'] = str(int(t))
|
|
745
|
+
body[s + 'EndMinute'] = str(int(60 * (t - int(t)) + 0.5))
|
|
733
746
|
return
|
|
734
747
|
|
|
735
|
-
def
|
|
748
|
+
def set_heating(enable=None, start=None, end=None, time1=None, time2=None, time3=None):
|
|
736
749
|
global device_sn, device
|
|
737
750
|
if get_device() is None:
|
|
738
751
|
return None
|
|
752
|
+
if get_heating() is None:
|
|
753
|
+
return 0
|
|
739
754
|
output(f"setting battery heating", 2)
|
|
740
755
|
body = {'sn': device_sn}
|
|
741
|
-
body['batteryWarmUpEnable'] =
|
|
742
|
-
body['startTemperature'] = start if start is not None else 9
|
|
743
|
-
body['endTemperature'] = end if end is not None else 12
|
|
756
|
+
body['batteryWarmUpEnable'] = 'disable' if enable is not None and enable == 0 else 'enable'
|
|
757
|
+
body['startTemperature'] = str(start if start is not None else 9)
|
|
758
|
+
body['endTemperature'] = str(end if end is not None else 12)
|
|
744
759
|
set_time(body, 'time1', time1)
|
|
745
760
|
set_time(body, 'time2', time2)
|
|
746
761
|
set_time(body, 'time3', time3)
|
|
@@ -750,11 +765,8 @@ def set_battery_heating(enable=None, start=None, end=None, time1=None, time2=Non
|
|
|
750
765
|
return None
|
|
751
766
|
errno = response.json().get('errno')
|
|
752
767
|
if errno != 0:
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
else:
|
|
756
|
-
output(f"** set_battery_heating(): {errno_message(response)}")
|
|
757
|
-
return None
|
|
768
|
+
output(f"** set_battery_heating(): {errno_message(response)}")
|
|
769
|
+
return 0
|
|
758
770
|
return 1
|
|
759
771
|
|
|
760
772
|
##################################################################################################
|
|
@@ -1139,7 +1151,7 @@ max_periods = 8
|
|
|
1139
1151
|
|
|
1140
1152
|
# get the current switch status
|
|
1141
1153
|
def get_flag():
|
|
1142
|
-
global device_sn, schedule, debug_setting
|
|
1154
|
+
global device_sn, schedule, debug_setting, max_periods
|
|
1143
1155
|
if get_device() is None:
|
|
1144
1156
|
return None
|
|
1145
1157
|
output(f"getting flag", 2)
|
|
@@ -1157,6 +1169,17 @@ def get_flag():
|
|
|
1157
1169
|
schedule['support'] = result.get('support')
|
|
1158
1170
|
if device.get('function') is not None and device['function'].get('scheduler') is not None:
|
|
1159
1171
|
device['function']['scheduler'] = schedule['support']
|
|
1172
|
+
if schedule.get('maxGroupCount') is None:
|
|
1173
|
+
output(f"getting maxGroupCount", 2)
|
|
1174
|
+
body = {'deviceSN': device_sn}
|
|
1175
|
+
response = signed_post(path="/op/v3/device/scheduler/get", body=body)
|
|
1176
|
+
if response.status_code != 200:
|
|
1177
|
+
output(f"** get_flag() got response code getting maxGroupCount {response.status_code}: {response.reason}")
|
|
1178
|
+
return None
|
|
1179
|
+
result = response.json().get('result')
|
|
1180
|
+
if result is not None:
|
|
1181
|
+
schedule['maxGroupCount'] = result.get('maxGroupCount')
|
|
1182
|
+
max_periods = schedule['maxGroupCount']
|
|
1160
1183
|
return schedule
|
|
1161
1184
|
|
|
1162
1185
|
##################################################################################################
|
|
@@ -3608,7 +3631,7 @@ def battery_monitor(interval=30, run=48, log=1, count=None, save=None, overwrite
|
|
|
3608
3631
|
# span: 'week', 'month' or 'year' generated dates that span a week, month or year
|
|
3609
3632
|
# quiet: do not print results if True
|
|
3610
3633
|
|
|
3611
|
-
def date_list(s = None, e = None, limit = None, span = None, today = 0, quiet = True):
|
|
3634
|
+
def date_list(s = None, e = None, limit = None, span = None, today = 0, quiet = True, step=1):
|
|
3612
3635
|
global debug_setting
|
|
3613
3636
|
latest_date = datetime.date(datetime.now())
|
|
3614
3637
|
today = 0 if today == False else 1 if today == True else today
|
|
@@ -3617,7 +3640,6 @@ def date_list(s = None, e = None, limit = None, span = None, today = 0, quiet =
|
|
|
3617
3640
|
first = datetime.date(datetime.strptime(s, '%Y-%m-%d')) if type(s) is str else s.date() if s is not None else None
|
|
3618
3641
|
last = datetime.date(datetime.strptime(e, '%Y-%m-%d')) if type(e) is str else e.date() if e is not None else None
|
|
3619
3642
|
last = latest_date if last is not None and last > latest_date and today != 2 else last
|
|
3620
|
-
step = 1
|
|
3621
3643
|
if first is None and last is None:
|
|
3622
3644
|
last = latest_date
|
|
3623
3645
|
if span is not None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: foxesscloud
|
|
3
|
-
Version: 2.9.
|
|
3
|
+
Version: 2.9.5
|
|
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
|
|
@@ -118,7 +118,7 @@ f.get_peakshaving()
|
|
|
118
118
|
f.get_flag()
|
|
119
119
|
f.get_schedule()
|
|
120
120
|
f.get_named_settings(name)
|
|
121
|
-
f.
|
|
121
|
+
f.get_heating()
|
|
122
122
|
|
|
123
123
|
```
|
|
124
124
|
Each of these calls will return a dictionary or list containing the relevant information.
|
|
@@ -139,6 +139,7 @@ get_settings() will return the battery settings and is equivalent to get_charge(
|
|
|
139
139
|
get_peakshaving() will return the current peak shaving settings for inverters that support this work mode.
|
|
140
140
|
|
|
141
141
|
get_flag() returns the current scheduler enable / support / maxsoc flags. By default support for Max Soc is set to False.
|
|
142
|
+
+ f.max_periods / schedule['maxGroupCount'] gives the maximum number of time periods that are supported.
|
|
142
143
|
|
|
143
144
|
get_schedule() returns the current work mode / soc schedule settings. The result is stored in f.schedule.
|
|
144
145
|
+ if the schedule returned contains any values for 'maxSoc', the f.schedule['maxsoc'] is set to True to indicate that the current inverter supports setting Max Soc in schedules and Max Soc values are set by set_schedule().
|
|
@@ -147,7 +148,7 @@ get_named_settings() returns the value of a named setting. If 'name' is a list,
|
|
|
147
148
|
+ f.named_settings is updated. This is dictionary of information and current value, indexed by 'name'.
|
|
148
149
|
+ named_settings currently available are stored in f.name_list. The settings supported depends on the inverter model and firmware version. An error will be returned if an unsupported variable is used.
|
|
149
150
|
|
|
150
|
-
|
|
151
|
+
get_heating returns the current battery heating parameters and store these in f.device['heating']
|
|
151
152
|
|
|
152
153
|
## Inverter Settings
|
|
153
154
|
You can change inverter settings using:
|
|
@@ -158,7 +159,7 @@ f.set_charge(ch1, st1, en1, ch2, st2, en2, enable)
|
|
|
158
159
|
f.set_period(start, end, mode, min_soc, max_soc, fdsoc, fdpwr, price, segment)
|
|
159
160
|
f.set_schedule(periods, enable)
|
|
160
161
|
f.set_named_settings(name, value, force)
|
|
161
|
-
f.
|
|
162
|
+
f.set_heating(enable, start, end, time1, time2, time3)
|
|
162
163
|
```
|
|
163
164
|
|
|
164
165
|
set_min() applies new SoC settings to the inverter. The parameters update battery_settings:
|
|
@@ -201,7 +202,7 @@ set_named_settings() sets the 'name' setting to 'value'.
|
|
|
201
202
|
+ a return value of 1 is success. 0 means setting failed. None is another error e.g. device not found, invalid name or value.
|
|
202
203
|
+ named_settings currently available are stored in f.name_list. The settings supported depend on the inverter model and firmware version. An error will be returned if an unsupported varaible is used.
|
|
203
204
|
|
|
204
|
-
|
|
205
|
+
set_heating() set the heating parameters as follows:
|
|
205
206
|
+ enable: optional, 0 or 1, default is 1
|
|
206
207
|
+ start, end: optional start and end temperatures. The defaults are start at 9C and end at 12C.
|
|
207
208
|
+ time1, time2, time3: optional times when the battery can heat from the grid time. The structure is {'enable': 1, 'start': '00:30', 'end': '05:30'}. The time slot is disabled by default.
|
|
@@ -496,7 +497,7 @@ This is an example of the output from battery_info():
|
|
|
496
497
|
## Date Ranges
|
|
497
498
|
|
|
498
499
|
```
|
|
499
|
-
f.date_list(s, e, limit, span, today)
|
|
500
|
+
f.date_list(s, e, limit, span, today, step)
|
|
500
501
|
```
|
|
501
502
|
|
|
502
503
|
Returns a list of dates in the format 'YYYY-MM-DD'. This function will not return dates in the future. The last date will be yesterday or today (if today is True). All parameters are optional:
|
|
@@ -506,6 +507,7 @@ Returns a list of dates in the format 'YYYY-MM-DD'. This function will not retur
|
|
|
506
507
|
+ limit: maximum number of days. The default is 200
|
|
507
508
|
+ span: the range of dates. One of 'day', 'week', 'month' or 'year', '2days' or 'weekday'
|
|
508
509
|
+ today: 1 allows today to be included, 2 allows future dates to be included. Default is 0, date list will stop at yesterday
|
|
510
|
+
+ step: optional days to add (default is 1)
|
|
509
511
|
|
|
510
512
|
You can use 'span' as follows:
|
|
511
513
|
+ 'day' provides a single day
|
|
@@ -830,6 +832,14 @@ This setting can be:
|
|
|
830
832
|
|
|
831
833
|
# Version Info
|
|
832
834
|
|
|
835
|
+
2.9.5 - 2026/02/27<br>
|
|
836
|
+
Add step parameter to date_list().
|
|
837
|
+
Get maxGroupCount from v3 scheduler and update f.max_periods with maximum number of time periods supported.
|
|
838
|
+
|
|
839
|
+
2.9.4 - 2026/01/22<br>
|
|
840
|
+
Rename get_battery_heating(), set_battery_heating() to get_heating() and set_heating().
|
|
841
|
+
Update get_heating() to return a dictionary to simplify parameter access.
|
|
842
|
+
|
|
833
843
|
2.9.3 - 2026/01/18<br>
|
|
834
844
|
Update get_device() to use v1 API call.
|
|
835
845
|
Update get_battery() to work out battery count and rated capacity from device battery list.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|