juham-automation 0.2.7__tar.gz → 0.2.23__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 (92) hide show
  1. {juham_automation-0.2.7/juham_automation.egg-info → juham_automation-0.2.23}/PKG-INFO +2 -3
  2. {juham_automation-0.2.7/docs/source → juham_automation-0.2.23}/README.rst +0 -1
  3. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/__init__.py +0 -2
  4. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/automation/__init__.py +0 -2
  5. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/automation/heatingoptimizer.py +6 -7
  6. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/automation/leakdetector.py +0 -2
  7. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/japp.py +0 -2
  8. {juham_automation-0.2.7 → juham_automation-0.2.23/juham_automation.egg-info}/PKG-INFO +2 -3
  9. juham_automation-0.2.23/juham_automation.egg-info/SOURCES.txt +47 -0
  10. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation.egg-info/entry_points.txt +0 -1
  11. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation.egg-info/requires.txt +1 -1
  12. {juham_automation-0.2.7 → juham_automation-0.2.23}/pyproject.toml +2 -3
  13. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/automation/test_heatingoptimizer.py +2 -9
  14. juham_automation-0.2.7/README.rst +0 -173
  15. juham_automation-0.2.7/docs/source/CHANGELOG.rst +0 -191
  16. juham_automation-0.2.7/docs/source/CONTRIBUTING.rst +0 -44
  17. juham_automation-0.2.7/docs/source/LICENSE.rst +0 -25
  18. juham_automation-0.2.7/examples/myapp.log +0 -52
  19. juham_automation-0.2.7/juham_automation/automation/spothintafi.py +0 -140
  20. juham_automation-0.2.7/juham_automation.egg-info/SOURCES.txt +0 -89
  21. juham_automation-0.2.7/tests/__pycache__/__init__.cpython-312.pyc +0 -0
  22. juham_automation-0.2.7/tests/__pycache__/test_japp.cpython-312-pytest-9.0.1.pyc +0 -0
  23. juham_automation-0.2.7/tests/__pycache__/test_japp.cpython-312.pyc +0 -0
  24. juham_automation-0.2.7/tests/automation/__pycache__/__init__.cpython-312.pyc +0 -0
  25. juham_automation-0.2.7/tests/automation/__pycache__/test_energybalancer.cpython-312-pytest-9.0.1.pyc +0 -0
  26. juham_automation-0.2.7/tests/automation/__pycache__/test_energybalancer.cpython-312.pyc +0 -0
  27. juham_automation-0.2.7/tests/automation/__pycache__/test_energycostcalculator.cpython-312-pytest-9.0.1.pyc +0 -0
  28. juham_automation-0.2.7/tests/automation/__pycache__/test_energycostcalculator.cpython-312.pyc +0 -0
  29. juham_automation-0.2.7/tests/automation/__pycache__/test_heatingoptimizer.cpython-312-pytest-9.0.1.pyc +0 -0
  30. juham_automation-0.2.7/tests/automation/__pycache__/test_heatingoptimizer.cpython-312.pyc +0 -0
  31. juham_automation-0.2.7/tests/automation/__pycache__/test_juham.cpython-312-pytest-9.0.1.pyc +0 -0
  32. juham_automation-0.2.7/tests/automation/__pycache__/test_juham.cpython-312.pyc +0 -0
  33. juham_automation-0.2.7/tests/automation/__pycache__/test_leakdetector.cpython-312-pytest-9.0.1.pyc +0 -0
  34. juham_automation-0.2.7/tests/automation/__pycache__/test_leakdetector.cpython-312.pyc +0 -0
  35. juham_automation-0.2.7/tests/automation/__pycache__/test_spothintafi.cpython-312-pytest-9.0.1.pyc +0 -0
  36. juham_automation-0.2.7/tests/automation/__pycache__/test_spothintafi.cpython-312.pyc +0 -0
  37. juham_automation-0.2.7/tests/automation/__pycache__/test_watercirculator.cpython-312-pytest-9.0.1.pyc +0 -0
  38. juham_automation-0.2.7/tests/automation/__pycache__/test_watercirculator.cpython-312.pyc +0 -0
  39. juham_automation-0.2.7/tests/automation/test_spothintafi.py +0 -67
  40. juham_automation-0.2.7/tests/ts/__pycache__/__init__.cpython-312.pyc +0 -0
  41. juham_automation-0.2.7/tests/ts/__pycache__/test_electricityprice_ts.cpython-312-pytest-9.0.1.pyc +0 -0
  42. juham_automation-0.2.7/tests/ts/__pycache__/test_electricityprice_ts.cpython-312.pyc +0 -0
  43. juham_automation-0.2.7/tests/ts/__pycache__/test_energybalancer_ts.cpython-312-pytest-9.0.1.pyc +0 -0
  44. juham_automation-0.2.7/tests/ts/__pycache__/test_energybalancer_ts.cpython-312.pyc +0 -0
  45. juham_automation-0.2.7/tests/ts/__pycache__/test_energycostcalculator_ts.cpython-312-pytest-9.0.1.pyc +0 -0
  46. juham_automation-0.2.7/tests/ts/__pycache__/test_energycostcalculator_ts.cpython-312.pyc +0 -0
  47. juham_automation-0.2.7/tests/ts/__pycache__/test_forecast_ts.cpython-312-pytest-9.0.1.pyc +0 -0
  48. juham_automation-0.2.7/tests/ts/__pycache__/test_forecast_ts.cpython-312.pyc +0 -0
  49. juham_automation-0.2.7/tests/ts/__pycache__/test_log_ts.cpython-312-pytest-9.0.1.pyc +0 -0
  50. juham_automation-0.2.7/tests/ts/__pycache__/test_log_ts.cpython-312.pyc +0 -0
  51. juham_automation-0.2.7/tests/ts/__pycache__/test_power_ts.cpython-312-pytest-9.0.1.pyc +0 -0
  52. juham_automation-0.2.7/tests/ts/__pycache__/test_power_ts.cpython-312.pyc +0 -0
  53. juham_automation-0.2.7/tests/ts/__pycache__/test_powermeter_ts.cpython-312-pytest-9.0.1.pyc +0 -0
  54. juham_automation-0.2.7/tests/ts/__pycache__/test_powermeter_ts.cpython-312.pyc +0 -0
  55. juham_automation-0.2.7/tests/ts/__pycache__/test_powerplan_ts.cpython-312-pytest-9.0.1.pyc +0 -0
  56. juham_automation-0.2.7/tests/ts/__pycache__/test_powerplan_ts.cpython-312.pyc +0 -0
  57. {juham_automation-0.2.7 → juham_automation-0.2.23}/LICENSE.rst +0 -0
  58. {juham_automation-0.2.7 → juham_automation-0.2.23}/MANIFEST.in +0 -0
  59. {juham_automation-0.2.7 → juham_automation-0.2.23}/examples/myapp.py +0 -0
  60. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/automation/energybalancer.py +0 -0
  61. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/automation/energycostcalculator.py +0 -0
  62. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/automation/watercirculator.py +0 -0
  63. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/py.typed +0 -0
  64. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/ts/__init__.py +0 -0
  65. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/ts/electricityprice_ts.py +0 -0
  66. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/ts/energybalancer_ts.py +0 -0
  67. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/ts/energycostcalculator_ts.py +0 -0
  68. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/ts/forecast_ts.py +0 -0
  69. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/ts/log_ts.py +0 -0
  70. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/ts/power_ts.py +0 -0
  71. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/ts/powermeter_ts.py +0 -0
  72. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation/ts/powerplan_ts.py +0 -0
  73. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation.egg-info/dependency_links.txt +0 -0
  74. {juham_automation-0.2.7 → juham_automation-0.2.23}/juham_automation.egg-info/top_level.txt +0 -0
  75. {juham_automation-0.2.7 → juham_automation-0.2.23}/setup.cfg +0 -0
  76. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/__init__.py +0 -0
  77. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/automation/__init__.py +0 -0
  78. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/automation/test_energybalancer.py +0 -0
  79. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/automation/test_energycostcalculator.py +0 -0
  80. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/automation/test_juham.py +0 -0
  81. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/automation/test_leakdetector.py +0 -0
  82. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/automation/test_watercirculator.py +0 -0
  83. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/test_japp.py +0 -0
  84. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/ts/__init__.py +0 -0
  85. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/ts/test_electricityprice_ts.py +0 -0
  86. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/ts/test_energybalancer_ts.py +0 -0
  87. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/ts/test_energycostcalculator_ts.py +0 -0
  88. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/ts/test_forecast_ts.py +0 -0
  89. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/ts/test_log_ts.py +0 -0
  90. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/ts/test_power_ts.py +0 -0
  91. {juham_automation-0.2.7 → juham_automation-0.2.23}/tests/ts/test_powermeter_ts.py +0 -0
  92. {juham_automation-0.2.7 → juham_automation-0.2.23}/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.2.7
3
+ Version: 0.2.23
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>
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.8
18
18
  Requires-Python: >=3.8
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE.rst
21
- Requires-Dist: juham_core>=0.2.4
21
+ Requires-Dist: juham_core>=0.2.6
22
22
  Provides-Extra: dev
23
23
  Requires-Dist: check-manifest; extra == "dev"
24
24
  Requires-Dist: coverage>=7.0; extra == "dev"
@@ -38,7 +38,6 @@ It consists of two main sub-modules:
38
38
 
39
39
  This folder contains automation classes that listen to Juham™ MQTT topics and control various home automation tasks.
40
40
 
41
- - **spothintafi**: Acquires electricity prices in Finland.
42
41
  - **watercirculator**: Automates a water circulator pump based on hot water temperature and motion detection.
43
42
  - **heatingoptimizer**: Controls hot water radiators based on temperature sensors and electricity price data.
44
43
  - **energycostcalculator**: Monitors power consumption and electricity prices, and computes the energy balance in euros.
@@ -12,7 +12,6 @@ It consists of two main sub-modules:
12
12
 
13
13
  This folder contains automation classes that listen to Juham™ MQTT topics and control various home automation tasks.
14
14
 
15
- - **spothintafi**: Acquires electricity prices in Finland.
16
15
  - **watercirculator**: Automates a water circulator pump based on hot water temperature and motion detection.
17
16
  - **heatingoptimizer**: Controls hot water radiators based on temperature sensors and electricity price data.
18
17
  - **energycostcalculator**: Monitors power consumption and electricity prices, and computes the energy balance in euros.
@@ -7,7 +7,6 @@ Juham - Juha's Ultimate Home Automation Masterpiece
7
7
  """
8
8
 
9
9
  from .automation import EnergyCostCalculator
10
- from .automation import SpotHintaFi
11
10
  from .automation import WaterCirculator
12
11
  from .automation import HeatingOptimizer
13
12
  from .automation import EnergyBalancer
@@ -34,7 +33,6 @@ __all__ = [
34
33
  "PowerTs",
35
34
  "PowerPlanTs",
36
35
  "PowerMeterTs",
37
- "SpotHintaFi",
38
36
  "WaterCirculator",
39
37
  "JApp",
40
38
  "ElectricityPriceTs",
@@ -7,7 +7,6 @@ Juham - Juha's Ultimate Home Automation classes
7
7
  """
8
8
 
9
9
  from .energycostcalculator import EnergyCostCalculator
10
- from .spothintafi import SpotHintaFi
11
10
  from .watercirculator import WaterCirculator
12
11
  from .heatingoptimizer import HeatingOptimizer
13
12
  from .energybalancer import EnergyBalancer
@@ -16,7 +15,6 @@ from .leakdetector import LeakDetector
16
15
  __all__ = [
17
16
  "EnergyCostCalculator",
18
17
  "HeatingOptimizer",
19
- "SpotHintaFi",
20
18
  "WaterCirculator",
21
19
  "EnergyBalancer",
22
20
  "LeakDetector",
@@ -903,8 +903,8 @@ class HeatingOptimizer(Juham):
903
903
  return (
904
904
  slot >= self.start_slot
905
905
  and slot < end_slot
906
- and float(spot) < self.spot_limit
907
- and fom > self.uoi_threshold
906
+ and float(spot) < 3*self.spot_limit
907
+ #and fom > self.uoi_threshold
908
908
  )
909
909
 
910
910
  def create_heating_plan(self) -> list[dict[str, Any]]:
@@ -916,13 +916,13 @@ class HeatingOptimizer(Juham):
916
916
 
917
917
  state = 0
918
918
  heating_plan: list[dict[str, Any]] = []
919
- slot: int = 0
919
+
920
920
  for hp in self.power_plan:
921
921
  ts: float = hp["Timestamp"]
922
922
  fom = hp["FOM"]
923
923
  spot = hp["Spot"]
924
- end_slot: float = self.start_slot + self.heating_slots_per_day
925
- slot: float = self.timestamp_slot(ts)
924
+ end_slot: int = self.start_slot + self.heating_slots_per_day
925
+ slot: int = self.timestamp_slot(ts)
926
926
  schedule_on: bool = self.is_slot_within_schedule(
927
927
  slot, self.schedule_start_slot, self.schedule_stop_slot
928
928
  )
@@ -939,9 +939,8 @@ class HeatingOptimizer(Juham):
939
939
  "UOI": fom,
940
940
  "Spot": spot,
941
941
  }
942
-
943
942
  heating_plan.append(heat)
944
- slot = slot + 1
943
+
945
944
 
946
945
  self.info(f"{self.name} heating plan of {len(heating_plan)} slots created", "")
947
946
  return heating_plan
@@ -144,8 +144,6 @@ class LeakDetector(Juham):
144
144
  data (dict): Motion sensor data containing timestamp.
145
145
  """
146
146
  if "motion" in data and data["motion"]:
147
- readable :str = datetime.fromtimestamp(self.motion_last_detected_ts).strftime("%Y-%m-%d %H:%M:%S")
148
- self.warning(f"Leak suspect reset due to detected motion", f"Last detected motion {readable}")
149
147
  self.motion_last_detected_ts = data["ts"]
150
148
 
151
149
  @override
@@ -10,7 +10,6 @@ from .ts import EnergyBalancerTs
10
10
  from .ts import LogTs
11
11
  from .ts import EnergyCostCalculatorTs
12
12
  from .ts import ElectricityPriceTs
13
- from .automation import SpotHintaFi
14
13
  from .automation import EnergyCostCalculator
15
14
 
16
15
 
@@ -40,7 +39,6 @@ class JApp(Application):
40
39
  self.add(PowerPlanTs())
41
40
  self.add(PowerMeterTs())
42
41
  self.add(LogTs())
43
- self.add(SpotHintaFi())
44
42
  self.add(EnergyCostCalculator())
45
43
  self.add(EnergyCostCalculatorTs())
46
44
  self.add(ElectricityPriceTs())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: juham-automation
3
- Version: 0.2.7
3
+ Version: 0.2.23
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>
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.8
18
18
  Requires-Python: >=3.8
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE.rst
21
- Requires-Dist: juham_core>=0.2.4
21
+ Requires-Dist: juham_core>=0.2.6
22
22
  Provides-Extra: dev
23
23
  Requires-Dist: check-manifest; extra == "dev"
24
24
  Requires-Dist: coverage>=7.0; extra == "dev"
@@ -38,7 +38,6 @@ It consists of two main sub-modules:
38
38
 
39
39
  This folder contains automation classes that listen to Juham™ MQTT topics and control various home automation tasks.
40
40
 
41
- - **spothintafi**: Acquires electricity prices in Finland.
42
41
  - **watercirculator**: Automates a water circulator pump based on hot water temperature and motion detection.
43
42
  - **heatingoptimizer**: Controls hot water radiators based on temperature sensors and electricity price data.
44
43
  - **energycostcalculator**: Monitors power consumption and electricity prices, and computes the energy balance in euros.
@@ -0,0 +1,47 @@
1
+ LICENSE.rst
2
+ MANIFEST.in
3
+ README.rst
4
+ pyproject.toml
5
+ examples/myapp.py
6
+ juham_automation/__init__.py
7
+ juham_automation/japp.py
8
+ juham_automation/py.typed
9
+ juham_automation.egg-info/PKG-INFO
10
+ juham_automation.egg-info/SOURCES.txt
11
+ juham_automation.egg-info/dependency_links.txt
12
+ juham_automation.egg-info/entry_points.txt
13
+ juham_automation.egg-info/requires.txt
14
+ juham_automation.egg-info/top_level.txt
15
+ juham_automation/automation/__init__.py
16
+ juham_automation/automation/energybalancer.py
17
+ juham_automation/automation/energycostcalculator.py
18
+ juham_automation/automation/heatingoptimizer.py
19
+ juham_automation/automation/leakdetector.py
20
+ juham_automation/automation/watercirculator.py
21
+ juham_automation/ts/__init__.py
22
+ juham_automation/ts/electricityprice_ts.py
23
+ juham_automation/ts/energybalancer_ts.py
24
+ juham_automation/ts/energycostcalculator_ts.py
25
+ juham_automation/ts/forecast_ts.py
26
+ juham_automation/ts/log_ts.py
27
+ juham_automation/ts/power_ts.py
28
+ juham_automation/ts/powermeter_ts.py
29
+ juham_automation/ts/powerplan_ts.py
30
+ tests/__init__.py
31
+ tests/test_japp.py
32
+ tests/automation/__init__.py
33
+ tests/automation/test_energybalancer.py
34
+ tests/automation/test_energycostcalculator.py
35
+ tests/automation/test_heatingoptimizer.py
36
+ tests/automation/test_juham.py
37
+ tests/automation/test_leakdetector.py
38
+ tests/automation/test_watercirculator.py
39
+ tests/ts/__init__.py
40
+ tests/ts/test_electricityprice_ts.py
41
+ tests/ts/test_energybalancer_ts.py
42
+ tests/ts/test_energycostcalculator_ts.py
43
+ tests/ts/test_forecast_ts.py
44
+ tests/ts/test_log_ts.py
45
+ tests/ts/test_power_ts.py
46
+ tests/ts/test_powermeter_ts.py
47
+ tests/ts/test_powerplan_ts.py
@@ -9,4 +9,3 @@ logts_plugin = juham_automation:LogTs
9
9
  powerplan_plugin = juham_automation:PowerPlanTs
10
10
  powerts_plugin = juham_automation:PowerTs
11
11
  rwatercirculator_plugin = juham_automation:WaterCirculator
12
- spothintafi_plugin = juham_automation:SpotHintaFi
@@ -1,4 +1,4 @@
1
- juham_core>=0.2.4
1
+ juham_core>=0.2.6
2
2
 
3
3
  [dev]
4
4
  check-manifest
@@ -7,7 +7,7 @@ include-package-data = true
7
7
 
8
8
  [project]
9
9
  name = "juham-automation"
10
- version = "0.2.7"
10
+ version = "0.2.23"
11
11
  description = "Juha's Ultimate Home Automation Masterpiece"
12
12
  readme = {file = "README.rst", content-type = "text/markdown"}
13
13
  requires-python = ">=3.8"
@@ -28,7 +28,7 @@ classifiers = [
28
28
  ]
29
29
 
30
30
  dependencies = [
31
- "juham_core >= 0.2.4",
31
+ "juham_core >= 0.2.6",
32
32
  ]
33
33
 
34
34
 
@@ -45,7 +45,6 @@ powerts_plugin = "juham_automation:PowerTs"
45
45
  powerplan_plugin = "juham_automation:PowerPlanTs"
46
46
  energybalancerts_plugin = "juham_automation:EnergyBalancerTs"
47
47
  logts_plugin = "juham_automation:LogTs"
48
- spothintafi_plugin = "juham_automation:SpotHintaFi"
49
48
  rwatercirculator_plugin = "juham_automation:WaterCirculator"
50
49
  energycostcalculator_plugin = "juham_automation:EnergyCostCalculator"
51
50
  energybalancer_plugin = "juham_automation:EnergyBalancer"
@@ -85,8 +85,6 @@ class HeatingOptimizerTest2(unittest.TestCase):
85
85
  self.assertGreater(uoi, 0)
86
86
  # Price above expected_average_price
87
87
  self.ho.expected_average_price = 0.2
88
- uoi2 = self.ho.compute_uoi(price=0.3, slot=7 * 3600/self.ho.energy_balancing_interval)
89
- self.assertEqual(uoi2, 0.0)
90
88
 
91
89
  def test_compute_effective_price(self):
92
90
  price = self.ho.compute_effective_price(requested_power=6000, available_solpower=3000, spot=0.2)
@@ -158,8 +156,7 @@ class TestHeatingOptimizer(unittest.TestCase):
158
156
  self.patcher_warning.stop()
159
157
 
160
158
  def test_initialization(self) -> None:
161
- self.assertEqual(self.optimizer.heating_slots_per_day, 3*3600 // self.optimizer.energy_balancing_interval)
162
- self.assertEqual(self.optimizer.start_slot, 5 * 3600 // self.optimizer.energy_balancing_interval)
159
+ self.assertEqual(self.optimizer.schedule_start_slot, 0)
163
160
  self.assertEqual(self.optimizer.spot_limit, 0.25)
164
161
  self.assertEqual(self.optimizer.current_temperature, 100)
165
162
  self.assertFalse(self.optimizer.relay)
@@ -354,33 +351,29 @@ class HeatingOptimizerOnPowerPlanTest(unittest.TestCase):
354
351
  min_a, max_a = self.ho.calculate_target_temps(
355
352
  MIN_MONTHLY, MAX_MONTHLY, -30.0, TARGET_HOME_TEMP
356
353
  )
357
- self.assertEqual(40.0, min_a);
354
+
358
355
  self.assertEqual(70.0, max_a);
359
356
 
360
357
  # --- Scenario 2: 0C Forecast (Low Demand) ---
361
358
  min_b, max_b = self.ho.calculate_target_temps(
362
359
  MIN_MONTHLY, MAX_MONTHLY, -20.0, TARGET_HOME_TEMP
363
360
  )
364
- self.assertEqual(40.0, min_b);
365
361
  self.assertEqual(64.0, max_b);
366
362
 
367
363
  # --- Scenario 3: Warm Forecast (Very Low Demand) ---
368
364
  min_c, max_c = self.ho.calculate_target_temps(
369
365
  MIN_MONTHLY, MAX_MONTHLY, -10, TARGET_HOME_TEMP
370
366
  )
371
- self.assertEqual(40.0, min_c);
372
367
  self.assertEqual(58.0, max_c);
373
368
 
374
369
  # --- Scenario 4: Hot Forecast ---
375
370
  min_d, max_d = self.ho.calculate_target_temps(
376
371
  MIN_MONTHLY, MAX_MONTHLY, 0, TARGET_HOME_TEMP
377
372
  )
378
- self.assertEqual(40.0, min_d);
379
373
  self.assertEqual(52.0, max_d);
380
374
  min_e, max_e = self.ho.calculate_target_temps(
381
375
  MIN_MONTHLY, MAX_MONTHLY, 30, TARGET_HOME_TEMP
382
376
  )
383
- self.assertEqual(40.0, min_e);
384
377
  self.assertEqual(40.0, max_e);
385
378
 
386
379
 
@@ -1,173 +0,0 @@
1
- Welcome to Juham™ - Juha's Ultimate Home Automation Masterpiece
2
- ===============================================================
3
-
4
- Project Description
5
- -------------------
6
-
7
- Beyond its super-cool name, this package provides essential home automation building blocks that address most common needs.
8
-
9
- It consists of two main sub-modules:
10
-
11
- ``automation``:
12
-
13
- This folder contains automation classes that listen to Juham™ MQTT topics and control various home automation tasks.
14
-
15
- - **spothintafi**: Acquires electricity prices in Finland.
16
- - **watercirculator**: Automates a water circulator pump based on hot water temperature and motion detection.
17
- - **heatingoptimizer**: Controls hot water radiators based on temperature sensors and electricity price data.
18
- - **energycostcalculator**: Monitors power consumption and electricity prices, and computes the energy balance in euros.
19
- - **energybalancer**: Handles real-time energy balancing and net billing.
20
-
21
- ``ts``:
22
-
23
- This folder contains time series recorders that listen for Juham™ topics and store the data in a time series database for later inspection.
24
-
25
- - **electricityprice_ts** : publishes electricity prices to timeseries database.
26
- - **energybalancer_ts**: for monitoring the operation of energy balancer.
27
- - **energycostcalculator_ts**: publishes actualized energy prices per hour and per day.
28
- - **forecast_ts**: publishes the forecast datat to timeseries database.
29
- - **log_ts**: Writes log events to timeseries datbase.
30
- - **powerplan_ts**: publishes power plan data to timeseries database, when relays are planned to be switched on/off.
31
- - **powermeter_ts**: publishes powermeter data to timeseries database.
32
-
33
-
34
- Project Status
35
- --------------
36
-
37
- **Current State**: **Beta (Status 4)**
38
-
39
- All classes have been tested to some extent, and no known bugs have been reported.
40
-
41
-
42
- Project Links
43
- -------------
44
-
45
- - **Source code:** https://gitlab.com/juham/juham/juham-automation
46
- - **Issue tracker:** https://gitlab.com/juham/juham/juham-automation/-/issues
47
- - **Documentation:** https://juham-automation-c6383e.gitlab.io
48
- - **PyPI page:** https://pypi.org/project/juham-automation
49
-
50
-
51
-
52
- Features
53
- --------
54
-
55
- **HeatingAutomater** listens to the power meter to compute the net energy balance.
56
-
57
- .. image:: _static/images/juham_powermeter.png
58
- :alt: Powermeter
59
- :width: 400px
60
-
61
- Powermeter is needed to measure the real-time energy consumption
62
-
63
-
64
- **Energy Revenue** is computed based on the electricity price and transmission costs. This is the total cost one has to pay for consuming energy.
65
-
66
- .. image:: _static/images/juham_energyrevenue.png
67
- :alt: Energy Revenue
68
- :width: 400px
69
-
70
- Energy revenue per hour and per day
71
-
72
-
73
- **Real-time temperature** trends monitored by the **Shelly Plus Add-on** and **DS18B20** sensors
74
-
75
- .. image:: _static/images/juham_boilertemperatures.png
76
- :alt: Energy Revenue
77
- :width: 400px
78
-
79
- Temperature time series.
80
-
81
-
82
- **Real-time humidity** trends monitored by the **Shelly Plus Add-on** and **DHT22** sensors
83
-
84
- .. image:: _static/images/juham_humiditysensors.png
85
- :alt: Energy Revenue
86
- :width: 400px
87
-
88
- Relative humidity time series.
89
-
90
-
91
-
92
- **Utilization Optimization Index**: The Utilization Optimization Index predicts the optimal hours for energy consumption by factoring in electricity prices, temperature, and forecasts for wind and solar energy. It identifies the best times to activate heating systems. The cheapest hours within the current period may be skipped if the solar forecast predicts free electricity in the next period.period.
93
-
94
- .. image:: _static/images/juham_uoi.png
95
- :alt: Power Plan
96
- :width: 400px
97
-
98
- UOI cast for heating the primary and sun pre-heating boilers for two types of solar panels and boilers: electric-based panels and solar thermal panels, which use water circulation. The primary one is electrically heated, while the secondary ‘pre-heating’ boiler is heated by the hot water from the solar thermal panels, or by electricity when there's a positive energy balance.
99
-
100
-
101
- **Power Plan** is computed for the next 12 hours based on the electricity price and solar energy forecast. If no solar energy is available, the power plan determines power consumption, e.g., when the hot water radiators are enabled.
102
-
103
- .. image:: _static/images/juham_powerplan.png
104
- :alt: Power Plan
105
- :width: 400px
106
-
107
- Powerplan optimizing consumers to use the cheapest hours
108
-
109
-
110
- **Energy Balancer**: When the energy balance is positive (e.g., when solar panels produce more energy than is currently being consumed), the energy balancer is activated. It monitors the energy balance in 15-minute (or one-hour) intervals and computes when a consumer with a specific power demand should be activated to consume all the energy produced so far.
111
-
112
- .. image:: _static/images/juham_automation_energybalancer.png
113
- :alt: Energy Balancer
114
- :width: 400px
115
-
116
- Energy balancer activating consumers based on the actual real-time net energy
117
-
118
-
119
- **Power Diagnosis**: All controlled relays are monitored to ensure their correct operation. This ensures that relays are enabled according to the power plan and energy balancer commands.
120
-
121
- .. image:: _static/images/juham_automation_relays.png
122
- :alt: Relays
123
- :width: 400px
124
-
125
- The operation of the relays for diagnosis.
126
-
127
-
128
- Installing
129
- ----------
130
-
131
- Juham™ ships with a minimal yet fully functional home automation application that can be found in the **examples** folder.
132
- It creates a **PowerMeterSimulator** and **ShellyMotionSimulator** objets to generate simulated motion sensor and power meter readings.
133
- Later, you can replace it with your actual power meter, as well as plug in other input sensors to read and relays to control.
134
-
135
- 1. Set up a Mosquitto MQTT broker service. For more information read the manuals.
136
-
137
- .. code-block:: bash
138
-
139
- sudo apt install mosquitto mosquitto-clients
140
-
141
- 2. Configure Juham to talk to Mosquitto.
142
-
143
- In ``PahoMqtt.json``:
144
-
145
- .. code-block:: json
146
-
147
- {"paho_version" : 2}
148
-
149
- In ``Juham.json``:
150
-
151
- .. code-block:: json
152
-
153
- {"mqtt_class_id": "PahoMqtt", "mqtt_root_topic": "myapp", "mqtt_host": "localhost", "mqtt_port": 1883}
154
-
155
- In ``Timeseries.json``:
156
-
157
- .. code-block:: json
158
-
159
- {
160
- "token": "your-influx-token",
161
- "org": "your-organization",
162
- "host": "https://us-east-1-1.aws.cloud2.influxdata.com",
163
- "database": "your-database"
164
- }
165
-
166
- 3. In the ``juham/examples`` folder, run:
167
-
168
- .. code-block:: bash
169
-
170
- python3 myapp.py
171
-
172
- The application will start and time series data will show up in your InfluxDB database,
173
- which you can then visualize with tools such as Grafana.
@@ -1,191 +0,0 @@
1
- Changelog
2
- =========
3
-
4
- [0.2.7] - December 1 2025
5
- -------------------------
6
-
7
- - LeakDetector migrated from juham-watermeter
8
-
9
-
10
- [0.2.6] - November 30 2025
11
- --------------------------
12
-
13
- - More agressive spot sensitivity.
14
-
15
-
16
-
17
- [0.2.5] - 2025-11-21
18
- --------------------
19
-
20
- - Project development status elevated to **Beta**.
21
- - Added an electricity-forecast–aware heating algorithm:
22
- If today's electricity price is high and tomorrow's is lower, the system
23
- automatically reduces heating today to optimize cost.
24
- - Introduced **SupervisorThread**, responsible for:
25
- - Detecting and listing crashed threads
26
- - Logging failures
27
- - Automatically restarting affected threads
28
- - Added a significant number of new unit tests to improve stability and
29
- coverage.
30
- - Extracted **powermeter_simulator.py** into a separate simulation plugin
31
- for cleaner architecture and modularity.
32
-
33
-
34
-
35
- [0.1.13] - Nov 15, 2025
36
- -----------------------
37
-
38
- - Installation instructions added into README.rst
39
- - Failure in **ts/log_ts.py** logging method logged the failure, leading to Infinite logging loop. Fixed.
40
-
41
-
42
- [0.1.11] - Nov 11, 2025
43
- -----------------------
44
-
45
- - New heating plan attributes published to timeseries
46
- - Heating plan now includes flags indicating whether temperature and solar power forecasts were used.
47
- - Min and max temperature limits published with the powerplan.
48
- - Minor issues in docstrings fixed.
49
- - Unit tests updated to reflect new heating plan attributes.
50
-
51
-
52
- [0.1.5] - Nov 07, 2025
53
- ----------------------
54
-
55
- - Heating plan optimization logic improved to better account for temperature and solar power forecasts.
56
- - Unit tests added for significantly higher coverage.
57
- - Documentation updated to reflect changes in temperature and solar power forecast handling.
58
- - SolarForecast and TemperatureForecast fields added to PowerPlan time series.
59
-
60
-
61
-
62
- [0.1.3] - Nov 01, 2025
63
- ----------------------
64
-
65
- - Added support for arbitrary energy balancing intervals in the automation module.
66
- - Default energy balancing interval changed from 1 hour to 15 minutes to comply with the new EU energy market directive.
67
- - Updated energy cost calculator and heating optimizer components to work with configurable intervals.
68
- - Improved unit tests to validate behavior across various interval lengths.
69
-
70
-
71
-
72
- [0.1.1] - Oct 28, 2025
73
- ----------------------
74
-
75
- - Project status elevated from Pre-Alpha to Alpha.
76
- - The default energy balancing interval for **HeatingOptimizer** is now 15 minutes.
77
- - Added "converage" package to [project.optional-dependencies] in pyproject.toml
78
-
79
-
80
-
81
- [0.0.73] - Aug 30, 2025
82
- -----------------------
83
-
84
- - Default boiler temperature limits adjusted.
85
-
86
-
87
- [0.0.34] - May 02, 2025
88
- -----------------------
89
-
90
- - Weight attribute added to heatingoptimizer. Determines how large a share of the time slot
91
- a consumer receives compared to others.
92
-
93
-
94
-
95
- [0.0.33] - May 01, 2025
96
- -----------------------
97
-
98
- - Workaround to Sphinx issue with multiply defined instance variables.
99
-
100
-
101
- [0.0.32] - April 27, 2025
102
- -------------------------
103
-
104
- * **HeatingOptimizer** single minimum and maximum temperature attributes replaced by a montly limits.
105
-
106
- .. code-block:: python
107
-
108
- pip install masterpiece_plugin
109
- boiler.temperature_limits = {
110
- 1: (50, 68), # January: colder, need hotter heating water
111
- 2: (50, 68), # February
112
- 3: (50, 68), # March
113
- 4: (40, 68), # April
114
- 5: (30, 68), # May
115
- 6: (30, 68), # June: warmer, need less heating
116
- 7: (30, 68), # July
117
- 8: (30, 68), # August
118
- 9: (40, 68), # September
119
- 10: (50, 68), # October
120
- 11: (50, 68), # November
121
- 12: (50, 68), # December
122
- }
123
-
124
- * **HeatingOptimizer** class attributes documented.
125
-
126
-
127
-
128
- [0.0.31] - April 21, 2025
129
- -------------------------
130
-
131
- * EnergyBalancer and EnergyBalancerTs classes improved. There is now two MQTT sub-topics: status,
132
- for controlling consumers, and diagnostics for monitoring the operation of the energy balancer.
133
-
134
-
135
- [0.0.29] - April 20, 2025
136
- -------------------------
137
-
138
- * Bug fixes to EnergyBalancer.
139
- * PriceForecast class updated (not there yet)
140
-
141
- [0.0.28] - April 20, 2025
142
- -------------------------
143
-
144
- * EnergyBalancer logic improved. Instead of activating all consumers at the same time, it now activates them one at a time
145
- in a serialized manner to minimize the maximum power (and fuse capacity, which affects the energy bill) required
146
- during balancing cycles.
147
-
148
-
149
- [0.0.27] - April 16, 2025
150
- -------------------------
151
-
152
- * CI pipeline unification.
153
- * EnergyBalacing features isolated from the HeatingOptimizer and implemented as a separate energybalancer module.
154
-
155
-
156
-
157
- [0.0.23] - April 04, 2025
158
- -------------------------
159
- * The HotWaterOptimizer class has been renamed to HeatingOptimizer to better reflect its general-purpose nature.
160
- * Added test_energybalancer.py
161
- * Added publish_diagnostics() method to track energy balance driven heating.
162
- * Added heatingoptimizer_ts module to support time series recording.
163
- * Fixed bug in net-energy balancing system.
164
- * Removed redundand dependencies in ``pyproject.toml``.
165
- * Enabled net energy balance feature.
166
-
167
-
168
- [0.1.12] - March 03, 2025
169
- -------------------------
170
-
171
- * Updated for the new modularized ci-templates and docs
172
- * New unit tests written, for better coverage. Not nearly there yet.
173
-
174
-
175
- [0.1.8-10] - February 23, 2025
176
- ------------------------------
177
-
178
- * Support for grid (network) prices and tax added.
179
-
180
- * Bug fix in the computation of the utilization optimization index: solar power was previously
181
- given in kW, while radiator power was in W, which underestimated the effect of available solar power.
182
-
183
- * New attribute added to time series: GridCost (cost and tax per kWh)
184
-
185
-
186
-
187
- [0.1.7] - February 08, 2025
188
- ---------------------------
189
-
190
- Initial release for GitLab. Pre-alpha!
191
-