juham-automation 0.0.16__tar.gz → 0.0.17__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 (64) hide show
  1. {juham_automation-0.0.16/juham_automation.egg-info → juham_automation-0.0.17}/PKG-INFO +1 -1
  2. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/automation/hotwateroptimizer.py +15 -7
  3. {juham_automation-0.0.16 → juham_automation-0.0.17/juham_automation.egg-info}/PKG-INFO +1 -1
  4. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation.egg-info/SOURCES.txt +1 -0
  5. {juham_automation-0.0.16 → juham_automation-0.0.17}/pyproject.toml +1 -1
  6. juham_automation-0.0.17/tests/__pycache__/__init__.cpython-312.pyc +0 -0
  7. {juham_automation-0.0.16 → juham_automation-0.0.17}/LICENSE.rst +0 -0
  8. {juham_automation-0.0.16 → juham_automation-0.0.17}/MANIFEST.in +0 -0
  9. {juham_automation-0.0.16 → juham_automation-0.0.17}/README.rst +0 -0
  10. {juham_automation-0.0.16 → juham_automation-0.0.17}/docs/source/CHANGELOG.rst +0 -0
  11. {juham_automation-0.0.16 → juham_automation-0.0.17}/docs/source/CONTRIBUTING.rst +0 -0
  12. {juham_automation-0.0.16 → juham_automation-0.0.17}/docs/source/LICENSE.rst +0 -0
  13. {juham_automation-0.0.16 → juham_automation-0.0.17}/docs/source/README.rst +0 -0
  14. {juham_automation-0.0.16 → juham_automation-0.0.17}/examples/myapp.log +0 -0
  15. {juham_automation-0.0.16 → juham_automation-0.0.17}/examples/myapp.py +0 -0
  16. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/__init__.py +0 -0
  17. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/automation/__init__.py +0 -0
  18. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/automation/energycostcalculator.py +0 -0
  19. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/automation/powermeter_simulator.py +0 -0
  20. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/automation/spothintafi.py +0 -0
  21. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/automation/watercirculator.py +0 -0
  22. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/japp.py +0 -0
  23. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/py.typed +0 -0
  24. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/ts/__init__.py +0 -0
  25. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/ts/electricityprice_ts.py +0 -0
  26. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/ts/energycostcalculator_ts.py +0 -0
  27. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/ts/forecast_ts.py +0 -0
  28. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/ts/log_ts.py +0 -0
  29. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/ts/power_ts.py +0 -0
  30. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/ts/powermeter_ts.py +0 -0
  31. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation/ts/powerplan_ts.py +0 -0
  32. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation.egg-info/dependency_links.txt +0 -0
  33. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation.egg-info/entry_points.txt +0 -0
  34. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation.egg-info/requires.txt +0 -0
  35. {juham_automation-0.0.16 → juham_automation-0.0.17}/juham_automation.egg-info/top_level.txt +0 -0
  36. {juham_automation-0.0.16 → juham_automation-0.0.17}/setup.cfg +0 -0
  37. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/__init__.py +0 -0
  38. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/__pycache__/test_japp.cpython-312.pyc +0 -0
  39. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/automation/__init__.py +0 -0
  40. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/automation/__pycache__/__init__.cpython-312.pyc +0 -0
  41. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/automation/__pycache__/test_energycostcalculator.cpython-312.pyc +0 -0
  42. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/automation/__pycache__/test_hotwateroptimizer.cpython-312.pyc +0 -0
  43. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/automation/__pycache__/test_juham.cpython-312.pyc +0 -0
  44. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/automation/__pycache__/test_powermeter_simulator.cpython-312.pyc +0 -0
  45. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/automation/__pycache__/test_spothintafi.cpython-312.pyc +0 -0
  46. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/automation/test_energycostcalculator.py +0 -0
  47. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/automation/test_hotwateroptimizer.py +0 -0
  48. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/automation/test_juham.py +0 -0
  49. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/automation/test_spothintafi.py +0 -0
  50. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/test_japp.py +0 -0
  51. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/ts/__init__.py +0 -0
  52. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/ts/__pycache__/__init__.cpython-312.pyc +0 -0
  53. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/ts/__pycache__/test_energycostcalculator_ts.cpython-312.pyc +0 -0
  54. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/ts/__pycache__/test_forecast_ts.cpython-312.pyc +0 -0
  55. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/ts/__pycache__/test_log_ts.cpython-312.pyc +0 -0
  56. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/ts/__pycache__/test_power_ts.cpython-312.pyc +0 -0
  57. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/ts/__pycache__/test_powermeter_ts.cpython-312.pyc +0 -0
  58. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/ts/__pycache__/test_powerplan_ts.cpython-312.pyc +0 -0
  59. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/ts/test_energycostcalculator_ts.py +0 -0
  60. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/ts/test_forecast_ts.py +0 -0
  61. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/ts/test_log_ts.py +0 -0
  62. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/ts/test_power_ts.py +0 -0
  63. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/ts/test_powermeter_ts.py +0 -0
  64. {juham_automation-0.0.16 → juham_automation-0.0.17}/tests/ts/test_powerplan_ts.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: juham-automation
3
- Version: 0.0.16
3
+ Version: 0.0.17
4
4
  Summary: Juha's Ultimate Home Automation Masterpiece
5
5
  Author-email: J Meskanen <juham.api@gmail.com>
6
6
  Maintainer-email: "J. Meskanen" <juham.api@gmail.com>
@@ -16,13 +16,17 @@ from juham_core.timeutils import (
16
16
 
17
17
  class HotWaterOptimizer(Juham):
18
18
  """Automation class for optimized control of temperature driven home energy consumers e.g hot
19
- water radiators. Reads spot prices, electricity forecast and temperatures to minimize electricity bill.
20
- Additional control over heating is provided by the following attributes
19
+ water radiators. Reads spot prices, electricity forecast, power meter and temperatures to minimize electricity bill.
21
20
 
22
- Computes UOI - optimization utilization index for each hour, based on the spot price and the solar power forecast.
23
- Value of 0 means the hour is expensive, value of 1 means the hour is free. The UOI threshold determines the slots
24
- that are allowed to be consumed.
21
+ Represents a heating system that knows the power rating of its radiator (e.g., 3kW).
22
+ The system subscribes to the 'power' topic to track the current power balance. If the solar panels
23
+ generate more energy than is being consumed, the optimizer activates a relay to ensure that all excess energy
24
+ produced within that hour is used for heating. The goal is to achieve a net zero energy balance for each hour,
25
+ ensuring that any surplus energy from the solar panels is fully utilized.
25
26
 
27
+ Computes also UOI - optimization utilization index for each hour, based on the spot price and the solar power forecast.
28
+ For negative energy balance this determines when energy is consumed. Value of 0 means the hour is expensive, value of 1 means
29
+ the hour is free. The UOI threshold determines the slots that are allowed to be consumed.
26
30
 
27
31
  """
28
32
 
@@ -299,6 +303,10 @@ class HotWaterOptimizer(Juham):
299
303
  bool: true if production exceeds the consumption
300
304
  """
301
305
 
306
+ # if net energy balance is negative, then we are not in balancing mode
307
+ if self.net_energy_balance < 0:
308
+ return False
309
+
302
310
  # elapsed and remaining time within the current balancing slot
303
311
  elapsed_ts = ts - quantize(self.energy_balancing_interval, ts)
304
312
  remaining_ts = self.energy_balancing_interval - elapsed_ts
@@ -316,7 +324,7 @@ class HotWaterOptimizer(Juham):
316
324
  needed_energy = 0.5 * self.radiator_power * remaining_ts
317
325
  elapsed_interval = ts - self.net_energy_balance_ts
318
326
  print(
319
- f"Needed energy {needed_energy}Wh, current balance {self.net_energy_balance}Wh"
327
+ f"Needed energy {int(needed_energy)}Wh, current balance {int(self.net_energy_balance)}Wh"
320
328
  )
321
329
 
322
330
  if (
@@ -349,7 +357,7 @@ class HotWaterOptimizer(Juham):
349
357
 
350
358
  # check if we have energy to consume, if so return 1
351
359
  if self.consider_net_energy_balance(ts):
352
- self.warning("Net energy balance positive")
360
+ self.info("Net energy balance positive")
353
361
  return 1
354
362
  elif self.net_energy_balancing_mode:
355
363
  balancing_slot_start_ts = quantize(self.energy_balancing_interval, ts)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: juham-automation
3
- Version: 0.0.16
3
+ Version: 0.0.17
4
4
  Summary: Juha's Ultimate Home Automation Masterpiece
5
5
  Author-email: J Meskanen <juham.api@gmail.com>
6
6
  Maintainer-email: "J. Meskanen" <juham.api@gmail.com>
@@ -33,6 +33,7 @@ juham_automation/ts/powermeter_ts.py
33
33
  juham_automation/ts/powerplan_ts.py
34
34
  tests/__init__.py
35
35
  tests/test_japp.py
36
+ tests/__pycache__/__init__.cpython-312.pyc
36
37
  tests/__pycache__/test_japp.cpython-312.pyc
37
38
  tests/automation/__init__.py
38
39
  tests/automation/test_energycostcalculator.py
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "juham-automation"
8
- version = "0.0.16"
8
+ version = "0.0.17"
9
9
  description = "Juha's Ultimate Home Automation Masterpiece"
10
10
  readme = {file = "README.rst", content-type = "text/markdown"}
11
11
  requires-python = ">=3.8"