juham-automation 0.0.7__py3-none-any.whl → 0.0.9__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.
@@ -489,7 +489,7 @@ class HotWaterOptimizer(Juham):
489
489
  if len(powers) >= 8: # at least 8 hours of solar energy forecast
490
490
  for spot, solar in zip(spots, powers):
491
491
  ts = spot["Timestamp"]
492
- solarenergy = solar["Solarenergy"]
492
+ solarenergy = solar["Solarenergy"] * 1000 # argh, this is in kW
493
493
  spotprice = spot["PriceWithTax"]
494
494
  effective_price: float = self.compute_effective_price(
495
495
  self.radiator_power, solarenergy, spotprice
@@ -18,6 +18,9 @@ class SpotHintaFiThread(JuhamCloudThread):
18
18
  _spot_topic: str = ""
19
19
  _url: str = ""
20
20
  _interval: float = 12 * 3600
21
+ grid_cost_day: float = 0.0314
22
+ grid_cost_night: float = 0.0132
23
+ grid_cost_tax: float = 0.028272
21
24
 
22
25
  def __init__(self, client: Optional[Mqtt] = None) -> None:
23
26
  super().__init__(client)
@@ -51,11 +54,19 @@ class SpotHintaFiThread(JuhamCloudThread):
51
54
  for e in data:
52
55
  ts = time.mktime(time.strptime(e["DateTime"], "%Y-%m-%dT%H:%M:%S%z"))
53
56
  hour = datetime.utcfromtimestamp(ts).strftime("%H")
57
+ total_price: float
58
+ grid_cost: float
59
+ if int(hour) < 22 and int(hour) >= 6:
60
+ grid_cost = self.grid_cost_day
61
+ else:
62
+ grid_cost = self.grid_cost_night
63
+ total_price = e["SpotPrice"] + grid_cost + self.grid_cost_tax
54
64
  h = {
55
65
  "Timestamp": ts,
56
66
  "hour": hour,
57
67
  "Rank": e["Rank"],
58
- "PriceWithTax": e["PriceWithTax"],
68
+ "PriceWithTax": total_price,
69
+ "GridCost": grid_cost + self.grid_cost_tax,
59
70
  }
60
71
  spot.append(h)
61
72
  self.publish(self._spot_topic, json.dumps(spot), 1, True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: juham-automation
3
- Version: 0.0.7
3
+ Version: 0.0.9
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>
@@ -50,7 +50,6 @@ Requires-Dist: masterpiece_pahomqtt>=0.0.3
50
50
  Requires-Dist: juham_core>=0.0.7
51
51
  Requires-Dist: requests>=2.31
52
52
  Requires-Dist: pytz>=2024.1
53
- Requires-Dist: importlib-metadata
54
53
  Provides-Extra: dev
55
54
  Requires-Dist: check-manifest; extra == "dev"
56
55
  Requires-Dist: types-pyz; extra == "dev"
@@ -64,7 +63,14 @@ Project Description
64
63
  This package extends the ``juham_core`` package, providing home automation building blocks that cover most common needs.
65
64
  It consists of two main sub-modules:
66
65
 
66
+ .. image:: _static/images/juham_automation.png
67
+ :alt: Basic automation classes for optimizing energy consumption and minimizing electricity costs.
68
+ :width: 640px
69
+ :align: center
70
+
71
+
67
72
  - ``automation``
73
+
68
74
  * **spothintafi**: Acquires electricity prices in Finland.
69
75
  * **watercirculator**: Automates a water circulator pump based on hot water temperature and motion detection.
70
76
  * **hotwateroptimizer**: Controls hot water radiators based on temperature sensors and electricity price data.
@@ -72,8 +78,9 @@ It consists of two main sub-modules:
72
78
 
73
79
 
74
80
  - ``ts``
75
- * This folder contains time series recorders that listen for Juham™ topics and store the data in a time series database
76
- for later inspection.
81
+
82
+ * This folder contains time series recorders that listen for Juham™ topics and store the data in a time series database
83
+ for later inspection.
77
84
 
78
85
 
79
86
  Project Status
@@ -3,9 +3,9 @@ juham_automation/japp.py,sha256=DuxMpoI3u9xP5-HaF1s3xI29PWa05jzBcOR8JNn0M0U,1471
3
3
  juham_automation/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
4
4
  juham_automation/automation/__init__.py,sha256=HV67cq9oXTcoAk5uBbHw3F1vR_saKztsHQxlFizqnHQ,460
5
5
  juham_automation/automation/energycostcalculator.py,sha256=R9BjsPw04ZxmpYEnn67zqiQzGFQYVT6bq-S2b3x6trg,10825
6
- juham_automation/automation/hotwateroptimizer.py,sha256=WoLNCCMTnua64XYVkhj0yEUXdOM53OeqqFoIhuiZFQg,22102
6
+ juham_automation/automation/hotwateroptimizer.py,sha256=-g6EJv0_gh6y1De8f0FAFhfX6OKjJxn0Ccis84gAiT4,22132
7
7
  juham_automation/automation/powermeter_simulator.py,sha256=3WZcjByRTdqnC77l7LjP-TEjmZ8XBEO4hClYsrjxmBE,4549
8
- juham_automation/automation/spothintafi.py,sha256=bHcceRLzfYve7zhq32LK2CpW3ZbXnm1EibVJCgcd_Js,3740
8
+ juham_automation/automation/spothintafi.py,sha256=FMYi6ZnWRPQ0AnXsxHTG8T021SB_SGp8UsMZaTrIM04,4198
9
9
  juham_automation/automation/watercirculator.py,sha256=a8meMNaONbHcIH3y0vP0UulJc1-gZiLZpw7H8kAOreY,6410
10
10
  juham_automation/ts/__init__.py,sha256=SinjhBcaRVP5FUyCMFWJGR3P7ZetL7ya8-VqhRb2skg,525
11
11
  juham_automation/ts/electricityprice_ts.py,sha256=bRfQbdLmSSXGMq4IdgZrGvMjHXbXfafdxoxK3YayqeI,1510
@@ -15,9 +15,9 @@ juham_automation/ts/log_ts.py,sha256=XsNaazuPmRUZLUqxU0DZae_frtT6kAFcXJTc598CtOA
15
15
  juham_automation/ts/power_ts.py,sha256=e7bSeZjitY4C_gLup9L0NjvU_WnQsl3ayDhVShj32KY,1399
16
16
  juham_automation/ts/powermeter_ts.py,sha256=wkCROQj9kXHgDdMuIbbAjhgP5Pr6TA6eT2T-r9sHidw,2351
17
17
  juham_automation/ts/powerplan_ts.py,sha256=LZeE7TnzPCDaugggKlaV-K48lDwwnC1ZNum50JYAWaY,1482
18
- juham_automation-0.0.7.dist-info/LICENSE.rst,sha256=QVHD5V5_HSys2PdPdig_xKggDj8cGX33ALKqRsYyjtI,1089
19
- juham_automation-0.0.7.dist-info/METADATA,sha256=2__uo9xeWgFHaBCvsnsc1_OCFwyQk1M7N_gnLWI70CI,4624
20
- juham_automation-0.0.7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
21
- juham_automation-0.0.7.dist-info/entry_points.txt,sha256=di8tXChhP8B_98bQ44u-1zkOha2kZCoJpCAXxTgoSw8,491
22
- juham_automation-0.0.7.dist-info/top_level.txt,sha256=jfohvtocvX_gfT21AhJk7Iay5ZiQsS3HzrDjF7S4Qp0,17
23
- juham_automation-0.0.7.dist-info/RECORD,,
18
+ juham_automation-0.0.9.dist-info/LICENSE.rst,sha256=QVHD5V5_HSys2PdPdig_xKggDj8cGX33ALKqRsYyjtI,1089
19
+ juham_automation-0.0.9.dist-info/METADATA,sha256=OZTeygIeiJ7ClXuj4mTmvGhwy0dyZcxnRNzZx01Q9rY,4781
20
+ juham_automation-0.0.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
21
+ juham_automation-0.0.9.dist-info/entry_points.txt,sha256=di8tXChhP8B_98bQ44u-1zkOha2kZCoJpCAXxTgoSw8,491
22
+ juham_automation-0.0.9.dist-info/top_level.txt,sha256=jfohvtocvX_gfT21AhJk7Iay5ZiQsS3HzrDjF7S4Qp0,17
23
+ juham_automation-0.0.9.dist-info/RECORD,,