juham-automation 0.0.12__py3-none-any.whl → 0.2.11__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.
Files changed (27) hide show
  1. juham_automation/__init__.py +8 -6
  2. juham_automation/automation/__init__.py +6 -6
  3. juham_automation/automation/energybalancer.py +281 -0
  4. juham_automation/automation/energycostcalculator.py +112 -68
  5. juham_automation/automation/heatingoptimizer.py +971 -0
  6. juham_automation/automation/leakdetector.py +162 -0
  7. juham_automation/automation/watercirculator.py +1 -20
  8. juham_automation/japp.py +4 -2
  9. juham_automation/ts/__init__.py +3 -1
  10. juham_automation/ts/electricityprice_ts.py +1 -1
  11. juham_automation/ts/energybalancer_ts.py +73 -0
  12. juham_automation/ts/energycostcalculator_ts.py +3 -1
  13. juham_automation/ts/log_ts.py +19 -16
  14. juham_automation/ts/power_ts.py +17 -14
  15. juham_automation/ts/powermeter_ts.py +3 -5
  16. juham_automation/ts/powerplan_ts.py +37 -18
  17. juham_automation-0.2.11.dist-info/METADATA +198 -0
  18. juham_automation-0.2.11.dist-info/RECORD +24 -0
  19. {juham_automation-0.0.12.dist-info → juham_automation-0.2.11.dist-info}/WHEEL +1 -1
  20. {juham_automation-0.0.12.dist-info → juham_automation-0.2.11.dist-info}/entry_points.txt +3 -2
  21. juham_automation/automation/hotwateroptimizer.py +0 -567
  22. juham_automation/automation/powermeter_simulator.py +0 -139
  23. juham_automation/automation/spothintafi.py +0 -140
  24. juham_automation-0.0.12.dist-info/METADATA +0 -109
  25. juham_automation-0.0.12.dist-info/RECORD +0 -23
  26. {juham_automation-0.0.12.dist-info → juham_automation-0.2.11.dist-info/licenses}/LICENSE.rst +0 -0
  27. {juham_automation-0.0.12.dist-info → juham_automation-0.2.11.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,198 @@
1
+ Metadata-Version: 2.4
2
+ Name: juham-automation
3
+ Version: 0.2.11
4
+ Summary: Juha's Ultimate Home Automation Masterpiece
5
+ Author-email: J Meskanen <juham.api@gmail.com>
6
+ Maintainer-email: "J. Meskanen" <juham.api@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://gitlab.com/juham/juham/juham-automation
9
+ Project-URL: Bug Reports, https://gitlab.com/juham/juham/juham-automationt
10
+ Project-URL: Funding, https://meskanen.com
11
+ Project-URL: Say Thanks!, http://meskanen.com
12
+ Project-URL: Source, https://gitlab.com/juham/juham/juham-automation
13
+ Keywords: home,automation,juham
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Topic :: Software Development
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE.rst
21
+ Requires-Dist: juham_core>=0.2.6
22
+ Provides-Extra: dev
23
+ Requires-Dist: check-manifest; extra == "dev"
24
+ Requires-Dist: coverage>=7.0; extra == "dev"
25
+ Dynamic: license-file
26
+
27
+ Welcome to Juham™ - Juha's Ultimate Home Automation Masterpiece
28
+ ===============================================================
29
+
30
+ Project Description
31
+ -------------------
32
+
33
+ Beyond its super-cool name, this package provides essential home automation building blocks that address most common needs.
34
+
35
+ It consists of two main sub-modules:
36
+
37
+ ``automation``:
38
+
39
+ This folder contains automation classes that listen to Juham™ MQTT topics and control various home automation tasks.
40
+
41
+ - **watercirculator**: Automates a water circulator pump based on hot water temperature and motion detection.
42
+ - **heatingoptimizer**: Controls hot water radiators based on temperature sensors and electricity price data.
43
+ - **energycostcalculator**: Monitors power consumption and electricity prices, and computes the energy balance in euros.
44
+ - **energybalancer**: Handles real-time energy balancing and net billing.
45
+
46
+ ``ts``:
47
+
48
+ This folder contains time series recorders that listen for Juham™ topics and store the data in a time series database for later inspection.
49
+
50
+ - **electricityprice_ts** : publishes electricity prices to timeseries database.
51
+ - **energybalancer_ts**: for monitoring the operation of energy balancer.
52
+ - **energycostcalculator_ts**: publishes actualized energy prices per hour and per day.
53
+ - **forecast_ts**: publishes the forecast datat to timeseries database.
54
+ - **log_ts**: Writes log events to timeseries datbase.
55
+ - **powerplan_ts**: publishes power plan data to timeseries database, when relays are planned to be switched on/off.
56
+ - **powermeter_ts**: publishes powermeter data to timeseries database.
57
+
58
+
59
+ Project Status
60
+ --------------
61
+
62
+ **Current State**: **Beta (Status 4)**
63
+
64
+ All classes have been tested to some extent, and no known bugs have been reported.
65
+
66
+
67
+ Project Links
68
+ -------------
69
+
70
+ - **Source code:** https://gitlab.com/juham/juham/juham-automation
71
+ - **Issue tracker:** https://gitlab.com/juham/juham/juham-automation/-/issues
72
+ - **Documentation:** https://juham-automation-c6383e.gitlab.io
73
+ - **PyPI page:** https://pypi.org/project/juham-automation
74
+
75
+
76
+
77
+ Features
78
+ --------
79
+
80
+ **HeatingAutomater** listens to the power meter to compute the net energy balance.
81
+
82
+ .. image:: _static/images/juham_powermeter.png
83
+ :alt: Powermeter
84
+ :width: 400px
85
+
86
+ Powermeter is needed to measure the real-time energy consumption
87
+
88
+
89
+ **Energy Revenue** is computed based on the electricity price and transmission costs. This is the total cost one has to pay for consuming energy.
90
+
91
+ .. image:: _static/images/juham_energyrevenue.png
92
+ :alt: Energy Revenue
93
+ :width: 400px
94
+
95
+ Energy revenue per hour and per day
96
+
97
+
98
+ **Real-time temperature** trends monitored by the **Shelly Plus Add-on** and **DS18B20** sensors
99
+
100
+ .. image:: _static/images/juham_boilertemperatures.png
101
+ :alt: Energy Revenue
102
+ :width: 400px
103
+
104
+ Temperature time series.
105
+
106
+
107
+ **Real-time humidity** trends monitored by the **Shelly Plus Add-on** and **DHT22** sensors
108
+
109
+ .. image:: _static/images/juham_humiditysensors.png
110
+ :alt: Energy Revenue
111
+ :width: 400px
112
+
113
+ Relative humidity time series.
114
+
115
+
116
+
117
+ **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.
118
+
119
+ .. image:: _static/images/juham_uoi.png
120
+ :alt: Power Plan
121
+ :width: 400px
122
+
123
+ 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.
124
+
125
+
126
+ **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.
127
+
128
+ .. image:: _static/images/juham_powerplan.png
129
+ :alt: Power Plan
130
+ :width: 400px
131
+
132
+ Powerplan optimizing consumers to use the cheapest hours
133
+
134
+
135
+ **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.
136
+
137
+ .. image:: _static/images/juham_automation_energybalancer.png
138
+ :alt: Energy Balancer
139
+ :width: 400px
140
+
141
+ Energy balancer activating consumers based on the actual real-time net energy
142
+
143
+
144
+ **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.
145
+
146
+ .. image:: _static/images/juham_automation_relays.png
147
+ :alt: Relays
148
+ :width: 400px
149
+
150
+ The operation of the relays for diagnosis.
151
+
152
+
153
+ Installing
154
+ ----------
155
+
156
+ Juham™ ships with a minimal yet fully functional home automation application that can be found in the **examples** folder.
157
+ It creates a **PowerMeterSimulator** and **ShellyMotionSimulator** objets to generate simulated motion sensor and power meter readings.
158
+ Later, you can replace it with your actual power meter, as well as plug in other input sensors to read and relays to control.
159
+
160
+ 1. Set up a Mosquitto MQTT broker service. For more information read the manuals.
161
+
162
+ .. code-block:: bash
163
+
164
+ sudo apt install mosquitto mosquitto-clients
165
+
166
+ 2. Configure Juham to talk to Mosquitto.
167
+
168
+ In ``PahoMqtt.json``:
169
+
170
+ .. code-block:: json
171
+
172
+ {"paho_version" : 2}
173
+
174
+ In ``Juham.json``:
175
+
176
+ .. code-block:: json
177
+
178
+ {"mqtt_class_id": "PahoMqtt", "mqtt_root_topic": "myapp", "mqtt_host": "localhost", "mqtt_port": 1883}
179
+
180
+ In ``Timeseries.json``:
181
+
182
+ .. code-block:: json
183
+
184
+ {
185
+ "token": "your-influx-token",
186
+ "org": "your-organization",
187
+ "host": "https://us-east-1-1.aws.cloud2.influxdata.com",
188
+ "database": "your-database"
189
+ }
190
+
191
+ 3. In the ``juham/examples`` folder, run:
192
+
193
+ .. code-block:: bash
194
+
195
+ python3 myapp.py
196
+
197
+ The application will start and time series data will show up in your InfluxDB database,
198
+ which you can then visualize with tools such as Grafana.
@@ -0,0 +1,24 @@
1
+ juham_automation/__init__.py,sha256=pe0JYVYlrusLGrKxUBHo7lW8pNMk_7mCQGtQAFepsYw,859
2
+ juham_automation/japp.py,sha256=e8kXkvAeWFz54gBH2lk9fa4ONd3XP_gQyVKVuSJ4BtM,1578
3
+ juham_automation/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
4
+ juham_automation/automation/__init__.py,sha256=qA4iU1nhL2IKP6uJ3nJq_SGYxrjEfCoCGb1U8ocmAoM,444
5
+ juham_automation/automation/energybalancer.py,sha256=Kw0Czah4JLOgDVAx6ca4nJpFpfZa9LXmv6pr612f-Fg,11473
6
+ juham_automation/automation/energycostcalculator.py,sha256=96pidMxi4tK9g8iLepn9XuTeauZhxi74qGXvvQJe-6s,13023
7
+ juham_automation/automation/heatingoptimizer.py,sha256=AO1VHBHfgQJ8kENsgZH3O3GHZjSksQx_CrsdZZoxjoM,39038
8
+ juham_automation/automation/leakdetector.py,sha256=Q-3X0NOFJf0C5MlR7R_QQp8yw5XvTt85oduuTRYIu_0,6003
9
+ juham_automation/automation/watercirculator.py,sha256=QcLAP9oLA-tYYRH2SjnPT6_kIOdiQbOSf2tQPMitEN0,5471
10
+ juham_automation/ts/__init__.py,sha256=kTEzVkDi6ednH4-fxKxrY6enlTuTXmSw09pPAQX3CMc,612
11
+ juham_automation/ts/electricityprice_ts.py,sha256=kRIewAAtTPi5JvHLEgGGVp_28LkWyB6lGyUH_2dKqBQ,1677
12
+ juham_automation/ts/energybalancer_ts.py,sha256=XHl56G5fBjJOCSIJtdjzGpSTMAQN1xsnXpC4Ipl7ynw,2585
13
+ juham_automation/ts/energycostcalculator_ts.py,sha256=ceYvZOvpXftJmAMW7bb33zI1lh1o0nf71XBJGuijD0s,1296
14
+ juham_automation/ts/forecast_ts.py,sha256=Gk46hIlS8ijxs-zyy8fBvXrhI7J-8e5Gt2QEe6gFB6s,3158
15
+ juham_automation/ts/log_ts.py,sha256=GLOqnwmk2cJdoWPWlrC3XAADp-N1JdfZ407YNQxnxhA,1901
16
+ juham_automation/ts/power_ts.py,sha256=_i_mBPtaVFfH9ycv426uQ4VtSzHacLJB6mEApe26fhE,1571
17
+ juham_automation/ts/powermeter_ts.py,sha256=a4sVERj7k397QlJF_VFg-S7DXSg8oAanPcxdYQBzN4w,2218
18
+ juham_automation/ts/powerplan_ts.py,sha256=TXD4aI8TAv2oGrbHZRjxkhrWkOubJ4Lq3sdotsgAn2Q,2358
19
+ juham_automation-0.2.11.dist-info/licenses/LICENSE.rst,sha256=QVHD5V5_HSys2PdPdig_xKggDj8cGX33ALKqRsYyjtI,1089
20
+ juham_automation-0.2.11.dist-info/METADATA,sha256=C4gTUMdYu2wpqTU53rey0i9tUnDWQiFScUXNgHr-R7M,7562
21
+ juham_automation-0.2.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
+ juham_automation-0.2.11.dist-info/entry_points.txt,sha256=rM4wM2dDeJ2LatuqJ4JKKX8rNrcbd3wVUtT9MNphdlc,555
23
+ juham_automation-0.2.11.dist-info/top_level.txt,sha256=jfohvtocvX_gfT21AhJk7Iay5ZiQsS3HzrDjF7S4Qp0,17
24
+ juham_automation-0.2.11.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,10 +1,11 @@
1
1
  [juham.plugins]
2
2
  electricityprice_plugin = juham_automation:ElectricityPriceTs
3
+ energybalancer_plugin = juham_automation:EnergyBalancer
4
+ energybalancerts_plugin = juham_automation:EnergyBalancerTs
3
5
  energycostcalculator_plugin = juham_automation:EnergyCostCalculator
4
6
  forecast_plugin = juham_automation:ForecastTs
5
- hotwateroptimizer_plugin = juham_automation:HotWaterOptimizer
7
+ heatingoptimizer_plugin = juham_automation:HeatingOptimizer
6
8
  logts_plugin = juham_automation:LogTs
7
9
  powerplan_plugin = juham_automation:PowerPlanTs
8
10
  powerts_plugin = juham_automation:PowerTs
9
11
  rwatercirculator_plugin = juham_automation:WaterCirculator
10
- spothintafi_plugin = juham_automation:SpotHintaFi