gazpar2haws 0.2.1__py3-none-any.whl → 0.3.0b15__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 +11 -18
- gazpar2haws/bridge.py +11 -29
- gazpar2haws/config_utils.py +4 -3
- gazpar2haws/configuration.py +28 -0
- gazpar2haws/date_array.py +236 -0
- gazpar2haws/gazpar.py +198 -138
- gazpar2haws/haws.py +10 -28
- gazpar2haws/model.py +234 -0
- gazpar2haws/pricer.py +571 -0
- {gazpar2haws-0.2.1.dist-info → gazpar2haws-0.3.0b15.dist-info}/METADATA +259 -1
- gazpar2haws-0.3.0b15.dist-info/RECORD +15 -0
- gazpar2haws-0.2.1.dist-info/RECORD +0 -11
- {gazpar2haws-0.2.1.dist-info → gazpar2haws-0.3.0b15.dist-info}/LICENSE +0 -0
- {gazpar2haws-0.2.1.dist-info → gazpar2haws-0.3.0b15.dist-info}/WHEEL +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: gazpar2haws
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3.0b15
|
4
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
5
|
License: MIT License
|
6
6
|
|
@@ -29,6 +29,8 @@ Classifier: Programming Language :: Python :: 3.9
|
|
29
29
|
Classifier: Programming Language :: Python :: 3.10
|
30
30
|
Classifier: Programming Language :: Python :: 3.11
|
31
31
|
Classifier: Programming Language :: Python :: 3.12
|
32
|
+
Requires-Dist: pydantic-extra-types (>=2.10.2,<3.0.0)
|
33
|
+
Requires-Dist: pydantic[email] (>=2.10.6,<3.0.0)
|
32
34
|
Requires-Dist: pygazpar (>=1.2.7)
|
33
35
|
Requires-Dist: pyyaml (>=6.0.2)
|
34
36
|
Requires-Dist: websockets (>=14.1)
|
@@ -216,6 +218,262 @@ The history is uploaded on the entities with names:
|
|
216
218
|
|
217
219
|
`${name}` is 'gazpar2haws' defined in the above configuration file. It can be replaced by any other name.
|
218
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
|
+
|
219
477
|
### Environment variable for Docker
|
220
478
|
|
221
479
|
In a Docker environment, the configurations files are instantiated by replacing the environment variables below in the template files:
|
@@ -0,0 +1,15 @@
|
|
1
|
+
gazpar2haws/__init__.py,sha256=3MCDQdGGmT3FQMKaAB3mBJq7L75T_bJSdpDRjE-pado,58
|
2
|
+
gazpar2haws/__main__.py,sha256=wD28dqa3weiz5cj9--hgLLN7FnW0eeA9ZmlIvriKXNk,3125
|
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=XQ8gwTl0w97ADjs6igdMZLxtPPrDWTLQzhhzTDVjC4M,8761
|
7
|
+
gazpar2haws/gazpar.py,sha256=o2YT9M1m7YRhuk7TBuUOOwf9ZElPASjTpUwRpHpDsss,12574
|
8
|
+
gazpar2haws/haws.py,sha256=1ELdompdACNf5XkpjCN6Bdiw7stPfzar3x8OjoBmhxQ,7969
|
9
|
+
gazpar2haws/model.py,sha256=-1yhLNNcEvEtW67GMVLZ4lcXw6Lk75kWvrdjoVgjKCw,7055
|
10
|
+
gazpar2haws/pricer.py,sha256=YhMfvAKSxQhE2JGgrkNOpqQZdTWjGZ_bUtNsYA0u2fs,21932
|
11
|
+
gazpar2haws/version.py,sha256=9Iq5Jm63Ev7QquCjhDqa9_KAgHdKl9FJHynq8M6JNrY,83
|
12
|
+
gazpar2haws-0.3.0b15.dist-info/LICENSE,sha256=ajApZPyhVx8AU9wN7DXeRGhoWFqY2ylBZUa5GRhTmok,1073
|
13
|
+
gazpar2haws-0.3.0b15.dist-info/METADATA,sha256=qtXzqYtd_Wl0p8TGEzYI1z7WsUbtlR6BVVOwq7a0NXs,17406
|
14
|
+
gazpar2haws-0.3.0b15.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
|
15
|
+
gazpar2haws-0.3.0b15.dist-info/RECORD,,
|
@@ -1,11 +0,0 @@
|
|
1
|
-
gazpar2haws/__init__.py,sha256=3MCDQdGGmT3FQMKaAB3mBJq7L75T_bJSdpDRjE-pado,58
|
2
|
-
gazpar2haws/__main__.py,sha256=KdhkowqJP6L8WTF9FNpTy4ZzDf1OPARm6mVtMclxGFk,3265
|
3
|
-
gazpar2haws/bridge.py,sha256=IDunENo7bQ9NDov76IEefAkMOen-6Wc_2NZcHGyk_XI,4601
|
4
|
-
gazpar2haws/config_utils.py,sha256=r8BvrA1r8huF-qjvQb0P1JYDLqzDleirLjOcj0xOyyU,2253
|
5
|
-
gazpar2haws/gazpar.py,sha256=29RfLxBaBCpoopOBpCX3xh681Ksm5pjZlLu9l3PqTAI,10321
|
6
|
-
gazpar2haws/haws.py,sha256=H--UWGECYq9JYlbU6IHLO2btaRXInwoVRZnHIXSA1ts,8169
|
7
|
-
gazpar2haws/version.py,sha256=9Iq5Jm63Ev7QquCjhDqa9_KAgHdKl9FJHynq8M6JNrY,83
|
8
|
-
gazpar2haws-0.2.1.dist-info/LICENSE,sha256=ajApZPyhVx8AU9wN7DXeRGhoWFqY2ylBZUa5GRhTmok,1073
|
9
|
-
gazpar2haws-0.2.1.dist-info/METADATA,sha256=Fbf6evtMKByRJCEWcE179YQHhmtsa4COSYluCIcGaKo,10050
|
10
|
-
gazpar2haws-0.2.1.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
|
11
|
-
gazpar2haws-0.2.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|