emhass 0.13.4__tar.gz → 0.13.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.
Files changed (32) hide show
  1. {emhass-0.13.4 → emhass-0.13.5}/PKG-INFO +1 -1
  2. {emhass-0.13.4 → emhass-0.13.5}/pyproject.toml +1 -1
  3. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/optimization.py +16 -26
  4. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/utils.py +3 -0
  5. {emhass-0.13.4 → emhass-0.13.5}/.gitignore +0 -0
  6. {emhass-0.13.4 → emhass-0.13.5}/LICENSE +0 -0
  7. {emhass-0.13.4 → emhass-0.13.5}/README.md +0 -0
  8. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/__init__.py +0 -0
  9. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/command_line.py +0 -0
  10. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/data/associations.csv +0 -0
  11. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/data/cec_inverters.pbz2 +0 -0
  12. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/data/cec_modules.pbz2 +0 -0
  13. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/data/config_defaults.json +0 -0
  14. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/forecast.py +0 -0
  15. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/img/emhass_icon.png +0 -0
  16. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/machine_learning_forecaster.py +0 -0
  17. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/machine_learning_regressor.py +0 -0
  18. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/retrieve_hass.py +0 -0
  19. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/static/advanced.html +0 -0
  20. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/static/basic.html +0 -0
  21. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/static/configuration_list.html +0 -0
  22. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/static/configuration_script.js +0 -0
  23. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/static/data/param_definitions.json +0 -0
  24. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/static/img/emhass_icon.png +0 -0
  25. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/static/img/emhass_logo_short.svg +0 -0
  26. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/static/img/feather-sprite.svg +0 -0
  27. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/static/script.js +0 -0
  28. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/static/style.css +0 -0
  29. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/templates/configuration.html +0 -0
  30. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/templates/index.html +0 -0
  31. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/templates/template.html +0 -0
  32. {emhass-0.13.4 → emhass-0.13.5}/src/emhass/web_server.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: emhass
3
- Version: 0.13.4
3
+ Version: 0.13.5
4
4
  Summary: An Energy Management System for Home Assistant
5
5
  Project-URL: Homepage, https://github.com/davidusb-geek/emhass
6
6
  Project-URL: Source, https://github.com/davidusb-geek/emhass
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "emhass"
3
- version = "0.13.4"
3
+ version = "0.13.5"
4
4
  description = "An Energy Management System for Home Assistant"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10, <3.13"
@@ -195,6 +195,8 @@ class Optimization:
195
195
 
196
196
  # If def_total_timestep os set, bypass def_total_hours
197
197
  if def_total_timestep is not None:
198
+ if def_total_hours is None:
199
+ def_total_hours = self.optim_conf["operating_hours_of_each_deferrable_load"]
198
200
  def_total_hours = [0 if x != 0 else x for x in def_total_hours]
199
201
  elif def_total_hours is None:
200
202
  def_total_hours = self.optim_conf["operating_hours_of_each_deferrable_load"]
@@ -616,18 +618,18 @@ class Optimization:
616
618
  }
617
619
  )
618
620
 
619
- else:
620
- if self.plant_conf["compute_curtailment"]:
621
- constraints.update(
622
- {
623
- f"constraint_curtailment_{i}": plp.LpConstraint(
624
- e=P_PV_curtailment[i] - max(P_PV[i], 0),
625
- sense=plp.LpConstraintLE,
626
- rhs=0,
627
- )
628
- for i in set_I
629
- }
630
- )
621
+ # Apply curtailment constraint if enabled, regardless of inverter type
622
+ if self.plant_conf["compute_curtailment"]:
623
+ constraints.update(
624
+ {
625
+ f"constraint_curtailment_{i}": plp.LpConstraint(
626
+ e=P_PV_curtailment[i] - max(P_PV[i], 0),
627
+ sense=plp.LpConstraintLE,
628
+ rhs=0,
629
+ )
630
+ for i in set_I
631
+ }
632
+ )
631
633
 
632
634
  # Two special constraints just for a self-consumption cost function
633
635
  if self.costfun == "self-consumption":
@@ -904,10 +906,7 @@ class Optimization:
904
906
  def_start, def_end, warning = Optimization.validate_def_timewindow(
905
907
  def_start_timestep[k],
906
908
  def_end_timestep[k],
907
- ceil(
908
- (60 / ((self.freq.seconds / 60) * def_total_timestep[k]))
909
- / self.timeStep
910
- ),
909
+ ceil(def_total_timestep[k]),
911
910
  n,
912
911
  )
913
912
  else:
@@ -1042,16 +1041,7 @@ class Optimization:
1042
1041
  f"constraint_pdef{k}_start5": plp.LpConstraint(
1043
1042
  e=plp.lpSum(P_def_bin2[k][i] for i in set_I),
1044
1043
  sense=plp.LpConstraintEQ,
1045
- rhs=(
1046
- (
1047
- 60
1048
- / (
1049
- (self.freq.seconds / 60)
1050
- * def_total_timestep[k]
1051
- )
1052
- )
1053
- / self.timeStep
1054
- ),
1044
+ rhs=def_total_timestep[k],
1055
1045
  )
1056
1046
  }
1057
1047
  )
@@ -962,6 +962,7 @@ def get_injection_dict(df: pd.DataFrame, plot_size: int | None = 1366) -> dict:
962
962
  template="presentation",
963
963
  line_shape="hv",
964
964
  color_discrete_sequence=colors,
965
+ render_mode="svg",
965
966
  )
966
967
  fig_0.update_layout(xaxis_title="Timestamp", yaxis_title="System powers (W)")
967
968
  if "SOC_opt" in df.columns.to_list():
@@ -971,6 +972,7 @@ def get_injection_dict(df: pd.DataFrame, plot_size: int | None = 1366) -> dict:
971
972
  template="presentation",
972
973
  line_shape="hv",
973
974
  color_discrete_sequence=colors,
975
+ render_mode="svg",
974
976
  )
975
977
  fig_1.update_layout(xaxis_title="Timestamp", yaxis_title="Battery SOC (%)")
976
978
  cols_cost = [i for i in df.columns.to_list() if "cost_" in i or "unit_" in i]
@@ -984,6 +986,7 @@ def get_injection_dict(df: pd.DataFrame, plot_size: int | None = 1366) -> dict:
984
986
  template="presentation",
985
987
  line_shape="hv",
986
988
  color_discrete_sequence=colors,
989
+ render_mode="svg",
987
990
  )
988
991
  fig_2.update_layout(xaxis_title="Timestamp", yaxis_title="System costs (currency)")
989
992
  # Get full path to image
File without changes
File without changes
File without changes
File without changes
File without changes