juham-automation 0.0.15__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.
- {juham_automation-0.0.15/juham_automation.egg-info → juham_automation-0.0.17}/PKG-INFO +1 -1
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/automation/hotwateroptimizer.py +24 -11
- {juham_automation-0.0.15 → juham_automation-0.0.17/juham_automation.egg-info}/PKG-INFO +1 -1
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation.egg-info/SOURCES.txt +1 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/pyproject.toml +1 -1
- juham_automation-0.0.17/tests/__pycache__/__init__.cpython-312.pyc +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/LICENSE.rst +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/MANIFEST.in +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/README.rst +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/docs/source/CHANGELOG.rst +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/docs/source/CONTRIBUTING.rst +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/docs/source/LICENSE.rst +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/docs/source/README.rst +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/examples/myapp.log +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/examples/myapp.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/__init__.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/automation/__init__.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/automation/energycostcalculator.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/automation/powermeter_simulator.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/automation/spothintafi.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/automation/watercirculator.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/japp.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/py.typed +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/ts/__init__.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/ts/electricityprice_ts.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/ts/energycostcalculator_ts.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/ts/forecast_ts.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/ts/log_ts.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/ts/power_ts.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/ts/powermeter_ts.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/ts/powerplan_ts.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation.egg-info/dependency_links.txt +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation.egg-info/entry_points.txt +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation.egg-info/requires.txt +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation.egg-info/top_level.txt +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/setup.cfg +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/__init__.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/__pycache__/test_japp.cpython-312.pyc +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/automation/__init__.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/automation/__pycache__/__init__.cpython-312.pyc +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/automation/__pycache__/test_energycostcalculator.cpython-312.pyc +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/automation/__pycache__/test_hotwateroptimizer.cpython-312.pyc +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/automation/__pycache__/test_juham.cpython-312.pyc +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/automation/__pycache__/test_powermeter_simulator.cpython-312.pyc +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/automation/__pycache__/test_spothintafi.cpython-312.pyc +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/automation/test_energycostcalculator.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/automation/test_hotwateroptimizer.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/automation/test_juham.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/automation/test_spothintafi.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/test_japp.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/__init__.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/__pycache__/__init__.cpython-312.pyc +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/__pycache__/test_energycostcalculator_ts.cpython-312.pyc +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/__pycache__/test_forecast_ts.cpython-312.pyc +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/__pycache__/test_log_ts.cpython-312.pyc +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/__pycache__/test_power_ts.cpython-312.pyc +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/__pycache__/test_powermeter_ts.cpython-312.pyc +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/__pycache__/test_powerplan_ts.cpython-312.pyc +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/test_energycostcalculator_ts.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/test_forecast_ts.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/test_log_ts.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/test_power_ts.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/test_powermeter_ts.py +0 -0
- {juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/test_powerplan_ts.py +0 -0
{juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/automation/hotwateroptimizer.py
RENAMED
@@ -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
|
-
|
23
|
-
|
24
|
-
|
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
|
@@ -306,12 +314,19 @@ class HotWaterOptimizer(Juham):
|
|
306
314
|
# don't bother to switch the relay on for small intervals, to avoid
|
307
315
|
# wearing contactors out
|
308
316
|
if remaining_ts < self.operation_threshold:
|
317
|
+
print(
|
318
|
+
f"Skipping balance, remaining time {remaining_ts}s < {self.operation_threshold}s"
|
319
|
+
)
|
309
320
|
return False
|
310
321
|
|
311
322
|
# check if the balance is sufficient for heating the next half of the energy balancing interval
|
312
323
|
# if yes then switch heating on for the next half an hour
|
313
324
|
needed_energy = 0.5 * self.radiator_power * remaining_ts
|
314
325
|
elapsed_interval = ts - self.net_energy_balance_ts
|
326
|
+
print(
|
327
|
+
f"Needed energy {int(needed_energy)}Wh, current balance {int(self.net_energy_balance)}Wh"
|
328
|
+
)
|
329
|
+
|
315
330
|
if (
|
316
331
|
self.net_energy_balance > needed_energy
|
317
332
|
) and not self.net_energy_balancing_rc:
|
@@ -342,7 +357,7 @@ class HotWaterOptimizer(Juham):
|
|
342
357
|
|
343
358
|
# check if we have energy to consume, if so return 1
|
344
359
|
if self.consider_net_energy_balance(ts):
|
345
|
-
self.
|
360
|
+
self.info("Net energy balance positive")
|
346
361
|
return 1
|
347
362
|
elif self.net_energy_balancing_mode:
|
348
363
|
balancing_slot_start_ts = quantize(self.energy_balancing_interval, ts)
|
@@ -350,13 +365,11 @@ class HotWaterOptimizer(Juham):
|
|
350
365
|
if elapsed_b > self.energy_balancing_interval:
|
351
366
|
self.net_energy_balancing_mode = False
|
352
367
|
self.info(
|
353
|
-
f"
|
368
|
+
f"Exiting net energy balancing mode: {elapsed_b}s > {self.energy_balancing_interval}s"
|
354
369
|
)
|
355
370
|
else:
|
356
|
-
self.info(
|
357
|
-
|
358
|
-
)
|
359
|
-
# return 0
|
371
|
+
self.info(f"Net energy balance waiting interval {elapsed_b}s to end")
|
372
|
+
return 0
|
360
373
|
|
361
374
|
if self.current_temperature > self.maximum_boiler_temperature:
|
362
375
|
self.info(
|
@@ -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.
|
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"
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/automation/spothintafi.py
RENAMED
File without changes
|
{juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/automation/watercirculator.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/ts/electricityprice_ts.py
RENAMED
File without changes
|
{juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation/ts/energycostcalculator_ts.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation.egg-info/dependency_links.txt
RENAMED
File without changes
|
{juham_automation-0.0.15 → juham_automation-0.0.17}/juham_automation.egg-info/entry_points.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{juham_automation-0.0.15 → juham_automation-0.0.17}/tests/__pycache__/test_japp.cpython-312.pyc
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{juham_automation-0.0.15 → juham_automation-0.0.17}/tests/automation/test_energycostcalculator.py
RENAMED
File without changes
|
{juham_automation-0.0.15 → juham_automation-0.0.17}/tests/automation/test_hotwateroptimizer.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/__pycache__/__init__.cpython-312.pyc
RENAMED
File without changes
|
File without changes
|
File without changes
|
{juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/__pycache__/test_log_ts.cpython-312.pyc
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{juham_automation-0.0.15 → juham_automation-0.0.17}/tests/ts/test_energycostcalculator_ts.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|