foxesscloud 2.7.6__py3-none-any.whl → 2.7.7__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.
@@ -1,7 +1,7 @@
1
1
  ##################################################################################################
2
2
  """
3
3
  Module: Fox ESS Cloud
4
- Updated: 13 December 2024
4
+ Updated: 11 January 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.8.7"
13
+ version = "1.8.8"
14
14
  print(f"FoxESS-Cloud version {version}")
15
15
 
16
16
  debug_setting = 1
@@ -2380,7 +2380,7 @@ custom_periods = {'name': 'Custom',
2380
2380
  }
2381
2381
 
2382
2382
  tariff_list = [octopus_flux, intelligent_octopus, octopus_cosy, octopus_go, agile_octopus, bg_driver, eon_drive, economy_7, custom_periods]
2383
- tariff = octopus_flux
2383
+ tariff = None
2384
2384
 
2385
2385
  ##################################################################################################
2386
2386
  # Strategy - schedule templates
@@ -3857,18 +3857,19 @@ integrate_load_power = 0
3857
3857
  ##################################################################################################
3858
3858
 
3859
3859
  # get pvoutput data for upload to pvoutput api or via Bulk Loader
3860
- # tou: 0 = no time of use, 1 = use time of use periods if available
3860
+ # tou: 0 = no time of use, 1 = use time of use periods if available, 2 = integrate all values
3861
3861
 
3862
3862
  def get_pvoutput(d = None, tou = 0):
3863
3863
  global tariff, pv_calibration, ct2_calibration, integrate_load_power
3864
3864
  if d is None:
3865
3865
  d = date_list()[0]
3866
- tou = 0 if tariff is None else 1 if tou == 1 or tou == True else 0
3867
3866
  if type(d) is list:
3868
3867
  print(f"---------------- get_pvoutput ------------------")
3869
3868
  print(f"Date range {d[0]} to {d[-1]} has {len(d)} days")
3870
3869
  if tou == 1:
3871
3870
  print(f"Time of use: {tariff['name']}")
3871
+ elif tou == 2:
3872
+ print(f"All values integrated from power")
3872
3873
  if integrate_load_power == 1:
3873
3874
  print(f"Consumption integrated from Load Power")
3874
3875
  print(f"------------------------------------------------")
@@ -3882,12 +3883,15 @@ def get_pvoutput(d = None, tou = 0):
3882
3883
  v = ['feedin', 'gridConsumption']
3883
3884
  if integrate_load_power == 0:
3884
3885
  v.append('loads')
3885
- report_data = get_report('day', d=d, v=v, summary=2)
3886
- if report_data is None:
3887
- return None
3886
+ if tou == 2:
3887
+ report_data = []
3888
+ else:
3889
+ report_data = get_report('day', d=d, v=v, summary=2)
3890
+ if report_data is None:
3891
+ return None
3888
3892
  # get raw power data for the day
3889
- v = ['pvPower', 'meterPower2', 'feedinPower', 'gridConsumptionPower'] if tou == 1 else ['pvPower', 'meterPower2']
3890
- if integrate_load_power == 1:
3893
+ v = ['pvPower', 'meterPower2', 'feedinPower', 'gridConsumptionPower'] if tou > 0 else ['pvPower', 'meterPower2']
3894
+ if integrate_load_power == 1 or tou == 2:
3891
3895
  v.append('loadsPower')
3892
3896
  raw_data = get_raw('day', d=d + ' 00:00:00', v=v , summary=1)
3893
3897
  if raw_data is None or len(raw_data) == 0 or raw_data[0].get('kwh') is None or raw_data[0].get('max') is None:
@@ -3937,10 +3941,12 @@ def get_pvoutput(d = None, tou = 0):
3937
3941
  generate = f"{wh},"
3938
3942
  power = f"{int(var['max'] * 1000)},{var['max_time']},"
3939
3943
  elif var['variable'] == 'feedinPower':
3944
+ export_wh = wh if tou == 2 else export_wh
3940
3945
  calibrate = export_wh / wh if wh > 0.0 else 1.0
3941
3946
  export = f","
3942
3947
  export_tou = f"{int(peak * calibrate)},{int(off_peak * calibrate)},{int((wh - peak - off_peak) * calibrate)},0"
3943
3948
  elif var['variable'] == 'gridConsumptionPower':
3949
+ grid_wh = wh if tou == 2 else grid_wh
3944
3950
  calibrate = grid_wh / wh if wh > 0.0 else 1.0
3945
3951
  grid = f"{int(peak * calibrate)},{int(off_peak * calibrate)},{int((wh - peak - off_peak) * calibrate)},0,"
3946
3952
  elif var['variable'] == 'loadsPower':
foxesscloud/openapi.py CHANGED
@@ -1,7 +1,7 @@
1
1
  ##################################################################################################
2
2
  """
3
3
  Module: Fox ESS Cloud using Open API
4
- Updated: 13 December 2024
4
+ Updated: 11 January 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.7.6"
13
+ version = "2.7.7"
14
14
  print(f"FoxESS-Cloud Open API version {version}")
15
15
 
16
16
  debug_setting = 1
@@ -2052,7 +2052,7 @@ custom_periods = {'name': 'Custom',
2052
2052
  }
2053
2053
 
2054
2054
  tariff_list = [octopus_flux, intelligent_octopus, octopus_cosy, octopus_go, agile_octopus, bg_driver, eon_drive, economy_7, custom_periods]
2055
- tariff = octopus_flux
2055
+ tariff = None
2056
2056
 
2057
2057
  ##################################################################################################
2058
2058
  # Strategy - schedule templates
@@ -3529,18 +3529,19 @@ integrate_load_power = 0
3529
3529
  ##################################################################################################
3530
3530
 
3531
3531
  # get pvoutput data for upload to pvoutput api or via Bulk Loader
3532
- # tou: 0 = no time of use, 1 = use time of use periods if available
3532
+ # tou: 0 = no time of use, 1 = use time of use periods if available, 2 = integrate all values
3533
3533
 
3534
3534
  def get_pvoutput(d = None, tou = 0):
3535
3535
  global tariff, pv_calibration, ct2_calibration, integrate_load_power
3536
3536
  if d is None:
3537
3537
  d = date_list()[0]
3538
- tou = 0 if tariff is None else 1 if tou == 1 or tou == True else 0
3539
3538
  if type(d) is list:
3540
3539
  print(f"---------------- get_pvoutput ------------------")
3541
3540
  print(f"Date range {d[0]} to {d[-1]} has {len(d)} days")
3542
3541
  if tou == 1:
3543
3542
  print(f"Time of use: {tariff['name']}")
3543
+ elif tou == 2:
3544
+ print(f"All values integrated from power")
3544
3545
  if integrate_load_power == 1:
3545
3546
  print(f"Consumption integrated from Load Power")
3546
3547
  print(f"------------------------------------------------")
@@ -3554,12 +3555,15 @@ def get_pvoutput(d = None, tou = 0):
3554
3555
  v = ['feedin', 'gridConsumption']
3555
3556
  if integrate_load_power == 0:
3556
3557
  v.append('loads')
3557
- report_data = get_report('day', d=d, v=v, summary=2)
3558
- if report_data is None:
3559
- return None
3558
+ if tou == 2:
3559
+ report_data = []
3560
+ else:
3561
+ report_data = get_report('day', d=d, v=v, summary=2)
3562
+ if report_data is None:
3563
+ return None
3560
3564
  # get raw power data for the day
3561
- v = ['pvPower', 'meterPower2', 'feedinPower', 'gridConsumptionPower'] if tou == 1 else ['pvPower', 'meterPower2']
3562
- if integrate_load_power == 1:
3565
+ v = ['pvPower', 'meterPower2', 'feedinPower', 'gridConsumptionPower'] if tou > 0 else ['pvPower', 'meterPower2']
3566
+ if integrate_load_power == 1 or tou == 2:
3563
3567
  v.append('loadsPower')
3564
3568
  raw_data = get_raw('day', d=d + ' 00:00:00', v=v , summary=1)
3565
3569
  if raw_data is None or len(raw_data) == 0 or raw_data[0].get('kwh') is None or raw_data[0].get('max') is None:
@@ -3609,10 +3613,12 @@ def get_pvoutput(d = None, tou = 0):
3609
3613
  generate = f"{wh},"
3610
3614
  power = f"{int(var['max'] * 1000)},{var['max_time']},"
3611
3615
  elif var['variable'] == 'feedinPower':
3616
+ export_wh = wh if tou == 2 else export_wh
3612
3617
  calibrate = export_wh / wh if wh > 0.0 else 1.0
3613
3618
  export = f","
3614
3619
  export_tou = f"{int(peak * calibrate)},{int(off_peak * calibrate)},{int((wh - peak - off_peak) * calibrate)},0"
3615
3620
  elif var['variable'] == 'gridConsumptionPower':
3621
+ grid_wh = wh if tou == 2 else grid_wh
3616
3622
  calibrate = grid_wh / wh if wh > 0.0 else 1.0
3617
3623
  grid = f"{int(peak * calibrate)},{int(off_peak * calibrate)},{int((wh - peak - off_peak) * calibrate)},0,"
3618
3624
  elif var['variable'] == 'loadsPower':
@@ -1,4 +1,4 @@
1
- Copyright (c) 2023 Tony Matthews
1
+ Copyright (c) 2023-2025 Tony Matthews
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foxesscloud
3
- Version: 2.7.6
3
+ Version: 2.7.7
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
@@ -629,7 +629,7 @@ f.get_pvoutput(d, tou)
629
629
  ```
630
630
 
631
631
  + d is the date or a list of dates, to get data for. The default is yesterday.
632
- + tou: optional, setting tou=1 uploads data with time of use. The default, tou=0 does not split data and is more accurate.
632
+ + tou: the default, tou=0, does not split data and is more accurate. Setting tou=1 uploads data with time of use. Setting tou=2 integrates all values and allows set_pvoutput() to work with pv inverters that do not provide energy stats.
633
633
  + setting integrate_load_power to 1 will calculate load energy by integrating the load power instead of using data from Fox. This tries to overcome the limitation where the inverter does not track load power / energy correctly when there is secondary generation. When set to 0 (default), the Fox load energy is used.
634
634
 
635
635
  You can copy and paste the output data to the pvoutput data CSV Loader, using the following settings:
@@ -652,7 +652,7 @@ f.set_pvoutput(d, system_id, tou, push, run_after)
652
652
 
653
653
  + d is optional and is the date, or a list of dates, to upload
654
654
  + system_id is optional and allow you to select where data is uploaded to (where you have more than 1 registered system)
655
- + tou: optional, setting tou=1 uploads data with time of use. The default, tou=0 does not split data and is more accurate
655
+ + tou: the default, tou=0, does not split data and is more accurate. Setting tou=1 uploads data with time of use. Setting tou=2 integrates all values and allows set_pvoutput() to work with pv inverters that do not provide energy stats.
656
656
  + push: optional. 0 = do not sent to pushover, 1 = send summary to pushover, 2 = send first day summary only
657
657
  + run_after: optional. Only generate data on or after this hour. Default 0.
658
658
 
@@ -807,6 +807,10 @@ This setting can be:
807
807
 
808
808
  # Version Info
809
809
 
810
+ 2.7.7<br>
811
+ Updates to get_pvoutput() to support solar inverters that don't provide grid energy by setting tou=2.
812
+ Default tariff changed to None.
813
+
810
814
  2.7.6<br>
811
815
  Updates to support F, G, R and S series inverters.
812
816
  Updates to set_named_settings() to load metadata if not already done and save new value.
@@ -0,0 +1,7 @@
1
+ foxesscloud/foxesscloud.py,sha256=mh_Yopg3c5Hx8rl1LVet58EUnzacoUjjh0g2n68KwPQ,223311
2
+ foxesscloud/openapi.py,sha256=e9Uf9NTAFPWTh2xzCyTg-6vS8obogmwok-41u5c1lhE,207725
3
+ foxesscloud-2.7.7.dist-info/LICENCE,sha256=8JF-24QkE8UfdII-g6RaIEvM-PZ9zwaEcxlwYUDMt-4,1079
4
+ foxesscloud-2.7.7.dist-info/METADATA,sha256=luevOoQZLqPj4c74WkyG6FLYFmlq6GwNd_O3xJ3J490,63042
5
+ foxesscloud-2.7.7.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
6
+ foxesscloud-2.7.7.dist-info/top_level.txt,sha256=IWOrKSNZCLU6IDXSX_b4_bqCfbZoWAT4CC0w0Lg7PuU,12
7
+ foxesscloud-2.7.7.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- foxesscloud/foxesscloud.py,sha256=rveGdZDyv3zwQmjw6UzJJKtw_L_lXA2fQFFqMI0lvWI,223108
2
- foxesscloud/openapi.py,sha256=GTiyfeMke5i_mLgdYb35pJ0JiCMsFXaMGSXMsqiQ5RI,207522
3
- foxesscloud-2.7.6.dist-info/LICENCE,sha256=-3xv8CElCJV8Bc8PbAsg3iyxMpAK8MoJneM3rXigxqI,1074
4
- foxesscloud-2.7.6.dist-info/METADATA,sha256=7g3S1fNFk8eL-TiZncUO_2hVIeOod8m5hLm5jEaxMCE,62666
5
- foxesscloud-2.7.6.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
6
- foxesscloud-2.7.6.dist-info/top_level.txt,sha256=IWOrKSNZCLU6IDXSX_b4_bqCfbZoWAT4CC0w0Lg7PuU,12
7
- foxesscloud-2.7.6.dist-info/RECORD,,