gazpar2haws 0.2.0b1__py3-none-any.whl → 0.3.0__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.
- gazpar2haws/__main__.py +14 -18
- gazpar2haws/bridge.py +19 -16
- gazpar2haws/config_utils.py +10 -6
- gazpar2haws/configuration.py +28 -0
- gazpar2haws/date_array.py +259 -0
- gazpar2haws/gazpar.py +246 -106
- gazpar2haws/haws.py +10 -28
- gazpar2haws/model.py +235 -0
- gazpar2haws/pricer.py +579 -0
- gazpar2haws-0.3.0.dist-info/METADATA +541 -0
- gazpar2haws-0.3.0.dist-info/RECORD +15 -0
- {gazpar2haws-0.2.0b1.dist-info → gazpar2haws-0.3.0.dist-info}/WHEEL +1 -1
- gazpar2haws-0.2.0b1.dist-info/METADATA +0 -278
- gazpar2haws-0.2.0b1.dist-info/RECORD +0 -11
- {gazpar2haws-0.2.0b1.dist-info → gazpar2haws-0.3.0.dist-info}/LICENSE +0 -0
@@ -0,0 +1,541 @@
|
|
1
|
+
Metadata-Version: 2.3
|
2
|
+
Name: gazpar2haws
|
3
|
+
Version: 0.3.0
|
4
|
+
Summary: Gazpar2HAWS is a gateway that reads data history from the GrDF (French gas provider) meter and send it to Home Assistant using WebSocket interface
|
5
|
+
License: MIT License
|
6
|
+
|
7
|
+
Copyright (c) 2024 Stéphane Senart
|
8
|
+
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
11
|
+
in the Software without restriction, including without limitation the rights
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
14
|
+
furnished to do so, subject to the following conditions:
|
15
|
+
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
17
|
+
copies or substantial portions of the Software.
|
18
|
+
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
25
|
+
SOFTWARE.
|
26
|
+
Author: Stéphane Senart
|
27
|
+
Requires-Python: >=3.10
|
28
|
+
Classifier: Programming Language :: Python :: 3.10
|
29
|
+
Classifier: Programming Language :: Python :: 3.11
|
30
|
+
Classifier: Programming Language :: Python :: 3.12
|
31
|
+
Classifier: Programming Language :: Python :: 3.13
|
32
|
+
Requires-Dist: pydantic-extra-types (>=2.10.2,<3.0.0)
|
33
|
+
Requires-Dist: pydantic[email] (>=2.10.6,<3.0.0)
|
34
|
+
Requires-Dist: pygazpar (>=1.3.0)
|
35
|
+
Requires-Dist: pyyaml (>=6.0.2)
|
36
|
+
Requires-Dist: websockets (>=14.1)
|
37
|
+
Description-Content-Type: text/markdown
|
38
|
+
|
39
|
+
# gazpar2haws
|
40
|
+
|
41
|
+
Gazpar2HAWS is a gateway that reads data history from the GrDF (French gas provider) meter and send it to Home Assistant using WebSocket interface.
|
42
|
+
|
43
|
+
It is compatible with Home Assistant Energy Dashboard and permits to upload the history and keep it updated with the latest readings.
|
44
|
+
|
45
|
+
It is a complement to the other available projects:
|
46
|
+
|
47
|
+
- [home-assistant-gazpar](https://github.com/ssenart/home-assistant-gazpar): HA integration that publishes a Gazpar entity with the corresponding meter value.
|
48
|
+
- [gazpar2mqtt](https://github.com/ssenart/gazpar2mqtt): [home-assistant-gazpar](https://github.com/ssenart/home-assistant-gazpar) alternative but using MQTT events (it reduce coupling with HA).
|
49
|
+
- [lovelace-gazpar-card](https://github.com/ssenart/lovelace-gazpar-card): HA dashboard card compatible with [home-assistant-gazpar](https://github.com/ssenart/home-assistant-gazpar) and [gazpar2mqtt](https://github.com/ssenart/gazpar2mqtt).
|
50
|
+
|
51
|
+
## Installation
|
52
|
+
|
53
|
+
Gazpar2HAWS can be installed in many ways.
|
54
|
+
|
55
|
+
### 1. Home Assistant Add-on
|
56
|
+
|
57
|
+
In the **Add-on store**, click **⋮ → Repositories**, fill in **`https://github.com/ssenart/gazpar2haws`** and click **Add → Close** or click the **Add repository** button below, click **Add → Close** (You might need to enter the **internal IP address** of your Home Assistant instance first).
|
58
|
+
|
59
|
+
[](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Fssenart%2Fgazpar2haws)
|
60
|
+
|
61
|
+
For usage and configuration, read the documentation [here](addons/gazpar2haws/DOCS.md).
|
62
|
+
|
63
|
+
### 2. Using Docker Hub
|
64
|
+
|
65
|
+
The following steps permits to run a container from an existing image available in the Docker Hub repository.
|
66
|
+
|
67
|
+
1. Copy and save the following docker-compose.yaml file:
|
68
|
+
|
69
|
+
```yaml
|
70
|
+
services:
|
71
|
+
gazpar2haws:
|
72
|
+
image: ssenart/gazpar2haws:latest
|
73
|
+
container_name: gazpar2haws
|
74
|
+
restart: unless-stopped
|
75
|
+
network_mode: bridge
|
76
|
+
user: "1000:1000"
|
77
|
+
volumes:
|
78
|
+
- ./gazpar2haws/config:/app/config
|
79
|
+
- ./gazpar2haws/log:/app/log
|
80
|
+
environment:
|
81
|
+
- GRDF_USERNAME=<GrDF account username>
|
82
|
+
- GRDF_PASSWORD=<GrDF account password>
|
83
|
+
- GRDF_PCE_IDENTIFIER=<GrDF PCE meter identifier>
|
84
|
+
- HOMEASSISTANT_HOST=<Home Assistant instance host name>
|
85
|
+
- HOMEASSISTANT_TOKEN=<Home Assistant access token>
|
86
|
+
```
|
87
|
+
|
88
|
+
Edit the environment variable section according to your setup.
|
89
|
+
|
90
|
+
2. Run the container:
|
91
|
+
|
92
|
+
```sh
|
93
|
+
$ docker compose up -d
|
94
|
+
```
|
95
|
+
|
96
|
+
### 3. Using PIP package
|
97
|
+
|
98
|
+
```sh
|
99
|
+
$ cd /path/to/my_install_folder/
|
100
|
+
|
101
|
+
$ mkdir gazpar2haws
|
102
|
+
|
103
|
+
$ cd gazpar2haws
|
104
|
+
|
105
|
+
$ python -m venv .venv
|
106
|
+
|
107
|
+
$ source .venv/bin/activate
|
108
|
+
|
109
|
+
$ pip install gazpar2haws
|
110
|
+
|
111
|
+
```
|
112
|
+
|
113
|
+
### 4. Using Dockerfile
|
114
|
+
|
115
|
+
The following steps permit to build the Docker image based on the local source files.
|
116
|
+
|
117
|
+
1. Clone the repo locally:
|
118
|
+
|
119
|
+
```sh
|
120
|
+
$ cd /path/to/my_install_folder/
|
121
|
+
|
122
|
+
$ git clone https://github.com/ssenart/gazpar2haws.git
|
123
|
+
```
|
124
|
+
|
125
|
+
2. Edit the docker-compose.yaml file by setting the environment variables corresponding to your GrDF account and Home Assistant setup:
|
126
|
+
|
127
|
+
```yaml
|
128
|
+
environment:
|
129
|
+
- GRDF_USERNAME=<GrDF account username>
|
130
|
+
- GRDF_PASSWORD=<GrDF account password>
|
131
|
+
- GRDF_PCE_IDENTIFIER=<GrDF PCE meter identifier>
|
132
|
+
- HOMEASSISTANT_HOST=<Home Assistant instance host name>
|
133
|
+
- HOMEASSISTANT_PORT=<Home Assistant instance port number>
|
134
|
+
- HOMEASSISTANT_TOKEN=<Home Assistant access token>
|
135
|
+
```
|
136
|
+
|
137
|
+
3. Build the image:
|
138
|
+
|
139
|
+
```sh
|
140
|
+
$ docker compose -f docker/docker-compose.yaml build
|
141
|
+
```
|
142
|
+
|
143
|
+
4. Run the container:
|
144
|
+
|
145
|
+
```sh
|
146
|
+
$ docker compose -f docker/docker-compose.yaml up -d
|
147
|
+
```
|
148
|
+
|
149
|
+
### 5. Using source files
|
150
|
+
|
151
|
+
The project requires [Poetry](https://python-poetry.org/) tool for dependency and package management.
|
152
|
+
|
153
|
+
```sh
|
154
|
+
$ cd /path/to/my_install_folder/
|
155
|
+
|
156
|
+
$ git clone https://github.com/ssenart/gazpar2haws.git
|
157
|
+
|
158
|
+
$ cd gazpar2haws
|
159
|
+
|
160
|
+
$ poetry install
|
161
|
+
|
162
|
+
$ poetry shell
|
163
|
+
|
164
|
+
```
|
165
|
+
|
166
|
+
## Usage
|
167
|
+
|
168
|
+
### Command line
|
169
|
+
|
170
|
+
```sh
|
171
|
+
$ python -m gazpar2haws --config /path/to/configuration.yaml --secrets /path/to/secrets.yaml
|
172
|
+
```
|
173
|
+
|
174
|
+
### Configuration file
|
175
|
+
|
176
|
+
The default configuration file is below.
|
177
|
+
|
178
|
+
```yaml
|
179
|
+
logging:
|
180
|
+
file: log/gazpar2haws.log
|
181
|
+
console: true
|
182
|
+
level: debug
|
183
|
+
format: "%(asctime)s %(levelname)s [%(name)s] %(message)s"
|
184
|
+
|
185
|
+
grdf:
|
186
|
+
scan_interval: 0 # Number of minutes between each data retrieval (0 means no scan: a single data retrieval at startup, then stops).
|
187
|
+
devices:
|
188
|
+
- name: gazpar2haws # Name of the device in home assistant. It will be used as the entity_ids: sensor.${name}_volume and sensor.${name}_energy.
|
189
|
+
username: "!secret grdf.username"
|
190
|
+
password: "!secret grdf.password"
|
191
|
+
pce_identifier: "!secret grdf.pce_identifier"
|
192
|
+
timezone: Europe/Paris
|
193
|
+
last_days: 365 # Number of days of data to retrieve
|
194
|
+
reset: false # If true, the data will be reset before the first data retrieval
|
195
|
+
|
196
|
+
homeassistant:
|
197
|
+
host: "!secret homeassistant.host"
|
198
|
+
port: "!secret homeassistant.port"
|
199
|
+
token: "!secret homeassistant.token"
|
200
|
+
```
|
201
|
+
|
202
|
+
The default secret file:
|
203
|
+
|
204
|
+
```yaml
|
205
|
+
grdf.username: ${GRDF_USERNAME}
|
206
|
+
grdf.password: ${GRDF_PASSWORD}
|
207
|
+
grdf.pce_identifier: ${GRDF_PCE_IDENTIFIER}
|
208
|
+
|
209
|
+
homeassistant.host: ${HA_HOST}
|
210
|
+
homeassistant.port: ${HA_PORT}
|
211
|
+
homeassistant.token: ${HA_TOKEN}
|
212
|
+
```
|
213
|
+
|
214
|
+
The history is uploaded on the entities with names:
|
215
|
+
|
216
|
+
- sensor.${name}\_volume: Volume history in m³.
|
217
|
+
- sensor.${name}\_energy: Energy history in kWh.
|
218
|
+
|
219
|
+
`${name}` is 'gazpar2haws' defined in the above configuration file. It can be replaced by any other name.
|
220
|
+
|
221
|
+
### Cost configuration
|
222
|
+
|
223
|
+
Gazpar2HAWS is able to compute and publish cost history to Home Assistant.
|
224
|
+
|
225
|
+
The cost computation is based in gas prices defined in the configuration files.
|
226
|
+
|
227
|
+
The section 'Pricing' is broken into 5 sub-sections:
|
228
|
+
- vat: Value added tax definition.
|
229
|
+
- consumption_prices: All the gas price history in €/kWh.
|
230
|
+
- subscription_prices: The subscription prices in €/month (or year).
|
231
|
+
- transport_prices: The fixed prices in €/month (or year) to transport the gas.
|
232
|
+
- energy_taxes: Various taxes on energy in €/kWh.
|
233
|
+
|
234
|
+
Below, many examples illustrates how to use pricing configuration for use cases from the simplest to the most complex.
|
235
|
+
|
236
|
+
|
237
|
+
Example 1: A fixed consumption price
|
238
|
+
---
|
239
|
+
|
240
|
+
The given price applies at the given date, after and before.
|
241
|
+
|
242
|
+
The default unit is € per kWh.
|
243
|
+
|
244
|
+
**Formula:**
|
245
|
+
```math
|
246
|
+
cost[€] = quantity[kWh] * price[€/kWh]
|
247
|
+
```
|
248
|
+
|
249
|
+
|
250
|
+
```yaml
|
251
|
+
pricing:
|
252
|
+
consumption_prices:
|
253
|
+
- start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
254
|
+
value: 0.07790 # Default unit is €/kWh.
|
255
|
+
```
|
256
|
+
|
257
|
+
Example 2: A fixed consumption price in another unit
|
258
|
+
---
|
259
|
+
|
260
|
+
*value_unit* is the price unit (default: €).
|
261
|
+
*base_unit* is the denominator unit (default: kWh).
|
262
|
+
|
263
|
+
**Formula:**
|
264
|
+
```math
|
265
|
+
cost[€] = \frac{quantity[kWh] * price[¢/MWh] * converter\_factor[¢->€]} {converter\_factor[MWh->kWh]}
|
266
|
+
```
|
267
|
+
|
268
|
+
|
269
|
+
```yaml
|
270
|
+
pricing:
|
271
|
+
consumption_prices:
|
272
|
+
- start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
273
|
+
value: 7790.0 # Unit is now ¢/MWh.
|
274
|
+
value_unit: "¢"
|
275
|
+
base_unit: "MWh"
|
276
|
+
```
|
277
|
+
|
278
|
+
Example 3: Multiple prices over time
|
279
|
+
---
|
280
|
+
|
281
|
+
```yaml
|
282
|
+
pricing:
|
283
|
+
consumption_prices:
|
284
|
+
- start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
285
|
+
value: 0.07790 # Default unit is €/kWh.
|
286
|
+
- start_date: "2024-01-01"
|
287
|
+
value: 0.06888 # Default unit is €/kWh.
|
288
|
+
```
|
289
|
+
|
290
|
+
Price is 0.07790 before 2024-01-01.
|
291
|
+
|
292
|
+
Price is 0.06888 on 2024-01-01 and after.
|
293
|
+
|
294
|
+
|
295
|
+
Example 4: Price is given excluding tax
|
296
|
+
---
|
297
|
+
|
298
|
+
The *normal* value added tax (*vat*) rate is 20%.
|
299
|
+
|
300
|
+
```yaml
|
301
|
+
pricing:
|
302
|
+
vat:
|
303
|
+
- id: normal
|
304
|
+
start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
305
|
+
value: 0.20 # It is the tax rate in [0, 1.0] <==> [0% - 100%].
|
306
|
+
consumption_prices:
|
307
|
+
- start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
308
|
+
value: 0.07790 # Default unit is €/kWh.
|
309
|
+
vat_id: "normal" # Reference to the vat rate that is applied for this period.
|
310
|
+
```
|
311
|
+
|
312
|
+
**Formula:**
|
313
|
+
```math
|
314
|
+
cost[€] = quantity[kWh] * price[€/kWh] * (1 + vat[normal])
|
315
|
+
```
|
316
|
+
|
317
|
+
Example 5: Subscription price
|
318
|
+
---
|
319
|
+
|
320
|
+
A fixed montly subscription is due over consumption.
|
321
|
+
|
322
|
+
Subscription *vat* tax may be different than the consumption *vat* tax.
|
323
|
+
|
324
|
+
```yaml
|
325
|
+
pricing:
|
326
|
+
vat:
|
327
|
+
- id: normal
|
328
|
+
start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
329
|
+
value: 0.20 # It is the tax rate in [0, 1.0] <==> [0% - 100%].
|
330
|
+
- id: reduced
|
331
|
+
start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
332
|
+
value: 0.0550
|
333
|
+
consumption_prices:
|
334
|
+
- start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
335
|
+
value: 0.07790 # Default unit is €/kWh.
|
336
|
+
vat_id: "normal" # Reference to the vat rate that is applied for this period.
|
337
|
+
subscription_prices:
|
338
|
+
- start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
339
|
+
value: 19.83
|
340
|
+
value_unit: "€"
|
341
|
+
base_unit: "month"
|
342
|
+
vat_id: "reduced"
|
343
|
+
```
|
344
|
+
|
345
|
+
**Formula:**
|
346
|
+
```math
|
347
|
+
cost[€] = quantity[kWh] * cons\_price[€/kWh] * (1 + vat[normal]) + sub\_price * (1 + vat[reduced])
|
348
|
+
```
|
349
|
+
|
350
|
+
|
351
|
+
Example 6: Transport price
|
352
|
+
---
|
353
|
+
|
354
|
+
A fixed yearly transport may be charged as well.
|
355
|
+
|
356
|
+
```yaml
|
357
|
+
pricing:
|
358
|
+
vat:
|
359
|
+
- id: normal
|
360
|
+
start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
361
|
+
value: 0.20 # It is the tax rate in [0, 1.0] <==> [0% - 100%].
|
362
|
+
- id: reduced
|
363
|
+
start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
364
|
+
value: 0.0550
|
365
|
+
consumption_prices:
|
366
|
+
- start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
367
|
+
value: 0.07790 # Default unit is €/kWh.
|
368
|
+
vat_id: "normal" # Reference to the vat rate that is applied for this period.
|
369
|
+
transport_prices:
|
370
|
+
- start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
371
|
+
value: 34.38
|
372
|
+
value_unit: "€"
|
373
|
+
base_unit: "year"
|
374
|
+
vat_id: reduced
|
375
|
+
```
|
376
|
+
**Formula:**
|
377
|
+
```math
|
378
|
+
cost[€] = quantity[kWh] * cons\_price[€/kWh] * (1 + vat[normal]) + trans\_price * (1 + vat[reduced])
|
379
|
+
```
|
380
|
+
|
381
|
+
Example 7: Energy taxes
|
382
|
+
---
|
383
|
+
|
384
|
+
Consumption may be taxed by additional taxes (known as energy taxes).
|
385
|
+
|
386
|
+
```yaml
|
387
|
+
pricing:
|
388
|
+
vat:
|
389
|
+
- id: normal
|
390
|
+
start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
391
|
+
value: 0.20 # It is the tax rate in [0, 1.0] <==> [0% - 100%].
|
392
|
+
- id: reduced
|
393
|
+
start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
394
|
+
value: 0.0550
|
395
|
+
consumption_prices:
|
396
|
+
- start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
397
|
+
value: 0.07790 # Default unit is €/kWh.
|
398
|
+
vat_id: "normal" # Reference to the vat rate that is applied for this period.
|
399
|
+
energy_taxes:
|
400
|
+
- start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
401
|
+
value: 0.00837
|
402
|
+
value_unit: "€"
|
403
|
+
base_unit: "kWh"
|
404
|
+
vat_id: normal
|
405
|
+
```
|
406
|
+
**Formula:**
|
407
|
+
```math
|
408
|
+
cost[€] = quantity[kWh] * (cons\_price[€/kWh] + ener\_taxes[€/kWh])* (1 + vat[normal])
|
409
|
+
```
|
410
|
+
|
411
|
+
Example 8: All in one
|
412
|
+
---
|
413
|
+
|
414
|
+
In the price list, the first item properties are propagated to the next items in the list. If their values does not change, it is not required to repeat them.
|
415
|
+
|
416
|
+
```yaml
|
417
|
+
pricing:
|
418
|
+
vat:
|
419
|
+
- id: reduced
|
420
|
+
start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
421
|
+
value: 0.0550
|
422
|
+
- id: normal
|
423
|
+
start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
424
|
+
value: 0.20
|
425
|
+
consumption_prices:
|
426
|
+
- start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
427
|
+
value: 0.07790
|
428
|
+
value_unit: "€"
|
429
|
+
base_unit: "kWh"
|
430
|
+
vat_id: normal
|
431
|
+
- start_date: "2023-07-01"
|
432
|
+
value: 0.05392
|
433
|
+
- start_date: "2023-08-01"
|
434
|
+
value: 0.05568
|
435
|
+
- start_date: "2023-09-01"
|
436
|
+
value: 0.05412
|
437
|
+
- start_date: "2023-10-01"
|
438
|
+
value: 0.06333
|
439
|
+
- start_date: "2023-11-01"
|
440
|
+
value: 0.06716
|
441
|
+
- start_date: "2023-12-01"
|
442
|
+
value: 0.07235
|
443
|
+
- start_date: "2024-01-01"
|
444
|
+
value: 0.06888
|
445
|
+
- start_date: "2024-02-01"
|
446
|
+
value: 0.05972
|
447
|
+
- start_date: "2024-03-01"
|
448
|
+
value: 0.05506
|
449
|
+
- start_date: "2024-04-01"
|
450
|
+
value: 0.04842
|
451
|
+
- start_date: "2025-01-01"
|
452
|
+
value: 0.07807
|
453
|
+
subscription_prices:
|
454
|
+
- start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
455
|
+
value: 19.83
|
456
|
+
value_unit: "€"
|
457
|
+
base_unit: "month"
|
458
|
+
vat_id: reduced
|
459
|
+
- start_date: "2023-07-01"
|
460
|
+
value: 20.36
|
461
|
+
transport_prices:
|
462
|
+
- start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
463
|
+
value: 34.38
|
464
|
+
value_unit: "€"
|
465
|
+
base_unit: "year"
|
466
|
+
vat_id: reduced
|
467
|
+
energy_taxes:
|
468
|
+
- start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
|
469
|
+
value: 0.00837
|
470
|
+
value_unit: "€"
|
471
|
+
base_unit: "kWh"
|
472
|
+
vat_id: normal
|
473
|
+
- start_date: "2024-01-01"
|
474
|
+
value: 0.01637
|
475
|
+
```
|
476
|
+
|
477
|
+
### Environment variable for Docker
|
478
|
+
|
479
|
+
In a Docker environment, the configurations files are instantiated by replacing the environment variables below in the template files:
|
480
|
+
|
481
|
+
| Environment variable | Description | Required | Default value |
|
482
|
+
| -------------------- | ----------------------------------------------------------------------------- | -------- | -------------- |
|
483
|
+
| GRDF_USERNAME | GrDF account user name | Yes | - |
|
484
|
+
| GRDF_PASSWORD | GrDF account password (avoid using special characters) | Yes | - |
|
485
|
+
| GRDF_PCE_IDENTIFIER | GrDF meter PCE identifier | Yes | - |
|
486
|
+
| GRDF_SCAN_INTERVAL | Period in minutes to refresh meter data (0 means one single refresh and stop) | No | 480 (8 hours) |
|
487
|
+
| GRDF_LAST_DAYS | Number of days of history data to retrieve | No | 1095 (3 years) |
|
488
|
+
| HOMEASSISTANT_HOST | Home Assistant instance host name | Yes | - |
|
489
|
+
| HOMEASSISTANT_PORT | Home Assistant instance port number | No | 8123 |
|
490
|
+
| HOMEASSISTANT_TOKEN | Home Assistant access token | Yes | - |
|
491
|
+
|
492
|
+
You can setup them directly in a docker-compose.yaml file (environment section) or from a Docker command line (-e option).
|
493
|
+
|
494
|
+
## Publish a new image on Docker Hub
|
495
|
+
|
496
|
+
1. List all local images
|
497
|
+
|
498
|
+
```sh
|
499
|
+
$ docker image ls
|
500
|
+
```
|
501
|
+
|
502
|
+
2. Build a new local image
|
503
|
+
|
504
|
+
```sh
|
505
|
+
$ docker compose -f docker/docker-compose.yaml build
|
506
|
+
```
|
507
|
+
|
508
|
+
3. Tag the new built image with the version number
|
509
|
+
|
510
|
+
```sh
|
511
|
+
$ docker image tag ssenart/gazpar2haws:latest ssenart/gazpar2haws:0.1.2
|
512
|
+
```
|
513
|
+
|
514
|
+
4. Login in Docker Hub
|
515
|
+
|
516
|
+
```sh
|
517
|
+
$ docker login
|
518
|
+
```
|
519
|
+
|
520
|
+
5. Push all the tagged local images to Docker Hub
|
521
|
+
|
522
|
+
```sh
|
523
|
+
$ docker push --all-tags ssenart/gazpar2haws
|
524
|
+
```
|
525
|
+
|
526
|
+
All the gazpar2haws images are available [here](https://hub.docker.com/repository/docker/ssenart/gazpar2haws/general).
|
527
|
+
|
528
|
+
## Contributing
|
529
|
+
|
530
|
+
Pull requests are welcome. For any change proposal, please open an issue first to discuss what you would like to change.
|
531
|
+
|
532
|
+
Please make sure to update tests as appropriate.
|
533
|
+
|
534
|
+
## License
|
535
|
+
|
536
|
+
[MIT](https://choosealicense.com/licenses/mit/)
|
537
|
+
|
538
|
+
## Project status
|
539
|
+
|
540
|
+
Gazpar2HAWS has been initiated for integration with [Home Assistant](https://www.home-assistant.io/) energy dashboard.
|
541
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
gazpar2haws/__init__.py,sha256=3MCDQdGGmT3FQMKaAB3mBJq7L75T_bJSdpDRjE-pado,58
|
2
|
+
gazpar2haws/__main__.py,sha256=KeMtuQAJP7LJigqfSX-RSdZI_yz-7vpoJwFNnqtscIw,3263
|
3
|
+
gazpar2haws/bridge.py,sha256=VEl22xt2Szgk_FVrxSvZNxp3T5Q2JXc9ulfrunHHkmo,3685
|
4
|
+
gazpar2haws/config_utils.py,sha256=yT2G-naMA2Vst6bQdm1bD2oVsPTU3Q_RuukCs-dZ6Ak,2280
|
5
|
+
gazpar2haws/configuration.py,sha256=24q8FUBMS1vpqU6RYAv5Au179HbiBk1CZIEMiBGuXq0,722
|
6
|
+
gazpar2haws/date_array.py,sha256=q3xTX-KS2KOtFSB042OJVerZFtS-Jw9Iin5RHKnobPs,10108
|
7
|
+
gazpar2haws/gazpar.py,sha256=iI1-Mzc1m92jO4sQyYCITux8KJc40lWXlCPw7vum3Lk,14249
|
8
|
+
gazpar2haws/haws.py,sha256=1ELdompdACNf5XkpjCN6Bdiw7stPfzar3x8OjoBmhxQ,7969
|
9
|
+
gazpar2haws/model.py,sha256=rn6gP8z5OVCQO3BZsExD68BaOExumiCv36wuPyOvS5M,7103
|
10
|
+
gazpar2haws/pricer.py,sha256=7xlLlPU6pXQcOnyaeoR_UEQOwuPwUG_V17FvPgSxzmM,22434
|
11
|
+
gazpar2haws/version.py,sha256=9Iq5Jm63Ev7QquCjhDqa9_KAgHdKl9FJHynq8M6JNrY,83
|
12
|
+
gazpar2haws-0.3.0.dist-info/LICENSE,sha256=ajApZPyhVx8AU9wN7DXeRGhoWFqY2ylBZUa5GRhTmok,1073
|
13
|
+
gazpar2haws-0.3.0.dist-info/METADATA,sha256=6LCUcBFC4I2swXfqfU48bCyvDUebnQVRWQv-Dt6sc6E,17405
|
14
|
+
gazpar2haws-0.3.0.dist-info/WHEEL,sha256=7dDg4QLnNKTvwIDR9Ac8jJaAmBC_owJrckbC0jjThyA,88
|
15
|
+
gazpar2haws-0.3.0.dist-info/RECORD,,
|