gazpar2haws 0.3.3__tar.gz → 0.4.0__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.
@@ -5,6 +5,47 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.4.0] - 2025-10-30
9
+
10
+ ### Added
11
+
12
+ - [#83](https://github.com/ssenart/gazpar2haws/issues/83): Composite price model with dual components - supports both quantity-based (€/kWh) and time-based (€/month) pricing
13
+ - [#83](https://github.com/ssenart/gazpar2haws/issues/83): Quantity-based transport pricing (€/kWh) support in addition to fixed time-based fees (€/year)
14
+ - [#83](https://github.com/ssenart/gazpar2haws/issues/83): Enhanced cost breakdown with separate Home Assistant entities for detailed cost analysis:
15
+ - `sensor.${name}_consumption_cost` - Consumption cost component
16
+ - `sensor.${name}_subscription_cost` - Subscription fees component
17
+ - `sensor.${name}_transport_cost` - Transport/delivery fees component
18
+ - `sensor.${name}_energy_taxes_cost` - Energy taxes component
19
+ - `sensor.${name}_total_cost` - Total of all cost components
20
+ - Unified pricing API with single `get_composite_price_array()` method and `CostBreakdown` output model
21
+ - Automatic sensor migration from v0.3.x `sensor.${name}_cost` to v0.4.0 `sensor.${name}_total_cost` with smart detection and data preservation
22
+ - Comprehensive [MIGRATIONS.md](MIGRATIONS.md) guide with step-by-step instructions, examples, and troubleshooting
23
+ - Entity names in Home Assistant now properly reflect the sensor type (e.g., "Gazpar2HAWS Energy", "Gazpar2HAWS Volume")
24
+
25
+ ### Changed
26
+
27
+ - **BREAKING**: Pricing configuration format changed. **See [MIGRATIONS.md](MIGRATIONS.md)** for migration instructions:
28
+ - `value` → `quantity_value` or `time_value`
29
+ - `value_unit` → `price_unit`
30
+ - `base_unit` → `quantity_unit` or `time_unit`
31
+ - `Pricer.compute()` now returns `CostBreakdown` object with 5 separate cost components instead of single value
32
+ - Cost statistics publishing expanded from 1 entity to 5 entities (consumption, subscription, transport, energy_taxes, total)
33
+
34
+ ### Fixed
35
+
36
+ - Fixed Home Assistant statistics metadata to include proper entity names instead of generic "gazpar2haws" - statistics now display as "Gazpar2HAWS Energy", "Gazpar2HAWS Volume", etc.
37
+
38
+ ### Migration
39
+
40
+ Users upgrading from v0.3.x must update their pricing configuration to the new format.
41
+
42
+ **See [MIGRATIONS.md](MIGRATIONS.md)** for complete migration guide including:
43
+ - Step-by-step configuration migration with 7 detailed examples
44
+ - Quick reference table for property mapping
45
+ - Automatic sensor migration (no user action required)
46
+ - Validation checklist
47
+ - Troubleshooting common issues
48
+
8
49
  ## [0.3.3] - 2025-07-22
9
50
 
10
51
  ### Changed
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: gazpar2haws
3
- Version: 0.3.3
3
+ Version: 0.4.0
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
 
@@ -23,6 +23,7 @@ License: MIT License
23
23
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
24
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
25
  SOFTWARE.
26
+ License-File: LICENSE
26
27
  Author: Stéphane Senart
27
28
  Requires-Python: >=3.10
28
29
  Classifier: Programming Language :: Python :: 3.10
@@ -48,6 +49,38 @@ It is a complement to the other available projects:
48
49
  - [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
50
  - [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
 
52
+ ## Documentation
53
+
54
+ ### User Documentation
55
+
56
+ - **[README.md](README.md)** (this file) - Complete installation, configuration, and usage guide
57
+ - **[FAQ.md](FAQ.md)** - Frequently Asked Questions based on GitHub issues and user feedback
58
+ - Common configuration issues
59
+ - Troubleshooting steps
60
+ - Migration guides
61
+ - All known issues and solutions
62
+ - **[CHANGELOG.md](CHANGELOG.md)** - Version history with all changes, fixes, and new features
63
+
64
+ ### Developer Documentation
65
+
66
+ - **[CLAUDE.md](CLAUDE.md)** - Developer guide for working with the codebase
67
+ - Architecture overview
68
+ - Development commands (setup, testing, linting)
69
+ - Key implementation details
70
+ - Testing guidelines
71
+ - **[TODO.md](TODO.md)** - Planned improvements and test coverage tasks
72
+ - Test coverage analysis
73
+ - Missing tests by priority
74
+ - Implementation schedule
75
+ - Known issues requiring tests
76
+
77
+ ### Quick Links
78
+
79
+ - 🐛 Found a bug? → Check [FAQ.md](FAQ.md) first, then open an [issue](https://github.com/ssenart/gazpar2haws/issues)
80
+ - 📝 Want to contribute? → Read [CLAUDE.md](CLAUDE.md) and [TODO.md](TODO.md)
81
+ - 🔄 Upgrading? → Check [CHANGELOG.md](CHANGELOG.md) for breaking changes
82
+ - ❓ Have a question? → See [FAQ.md](FAQ.md) or ask in [discussions](https://github.com/ssenart/gazpar2haws/discussions)
83
+
51
84
  ## Installation
52
85
 
53
86
  Gazpar2HAWS can be installed in many ways.
@@ -185,7 +218,7 @@ logging:
185
218
  grdf:
186
219
  scan_interval: 0 # Number of minutes between each data retrieval (0 means no scan: a single data retrieval at startup, then stops).
187
220
  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.
221
+ - name: gazpar2haws # Name of the device in home assistant. It will be used as the entity_id prefix: sensor.${name}_*.
189
222
  username: "!secret grdf.username"
190
223
  password: "!secret grdf.password"
191
224
  pce_identifier: "!secret grdf.pce_identifier"
@@ -215,6 +248,11 @@ The history is uploaded on the entities with names:
215
248
 
216
249
  - sensor.${name}\_volume: Volume history in m³.
217
250
  - sensor.${name}\_energy: Energy history in kWh.
251
+ - sensor.${name}\_consumption_cost: Cost from consumption (if pricing configured).
252
+ - sensor.${name}\_subscription_cost: Cost from subscription (if pricing configured).
253
+ - sensor.${name}\_transport_cost: Cost from transport (if pricing configured).
254
+ - sensor.${name}\_energy_taxes_cost: Cost from energy taxes (if pricing configured).
255
+ - sensor.${name}\_total_cost: Total cost (if pricing configured).
218
256
 
219
257
  `${name}` is 'gazpar2haws' defined in the above configuration file. It can be replaced by any other name.
220
258
 
@@ -226,10 +264,10 @@ The cost computation is based in gas prices defined in the configuration files.
226
264
 
227
265
  The section 'Pricing' is broken into 5 sub-sections:
228
266
  - 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.
267
+ - consumption_prices: Gas consumption prices, typically in €/kWh (quantity-based).
268
+ - subscription_prices: Fixed subscription prices, typically in €/month or €/year (time-based).
269
+ - transport_prices: Transport prices, either fixed (€/month or €/year) or based on consumption (€/kWh).
270
+ - energy_taxes: Energy taxes, typically in €/kWh (quantity-based).
233
271
 
234
272
  Below, many examples illustrates how to use pricing configuration for use cases from the simplest to the most complex.
235
273
 
@@ -251,14 +289,14 @@ cost[€] = quantity[kWh] * price[€/kWh]
251
289
  pricing:
252
290
  consumption_prices:
253
291
  - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
254
- value: 0.07790 # Default unit is €/kWh.
292
+ quantity_value: 0.07790 # Default unit is €/kWh.
255
293
  ```
256
294
 
257
295
  Example 2: A fixed consumption price in another unit
258
296
  ---
259
297
 
260
- *value_unit* is the price unit (default: €).
261
- *base_unit* is the denominator unit (default: kWh).
298
+ *price_unit* is the monetary unit (default: €).
299
+ *quantity_unit* is the energy unit (default: kWh).
262
300
 
263
301
  **Formula:**
264
302
  ```math
@@ -270,9 +308,9 @@ cost[€] = \frac{quantity[kWh] * price[¢/MWh] * converter\_factor[¢->€]} {c
270
308
  pricing:
271
309
  consumption_prices:
272
310
  - 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"
311
+ quantity_value: 7790.0 # Unit is now ¢/MWh.
312
+ price_unit: "¢"
313
+ quantity_unit: "MWh"
276
314
  ```
277
315
 
278
316
  Example 3: Multiple prices over time
@@ -282,9 +320,9 @@ Example 3: Multiple prices over time
282
320
  pricing:
283
321
  consumption_prices:
284
322
  - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
285
- value: 0.07790 # Default unit is €/kWh.
323
+ quantity_value: 0.07790 # Default unit is €/kWh.
286
324
  - start_date: "2024-01-01"
287
- value: 0.06888 # Default unit is €/kWh.
325
+ quantity_value: 0.06888 # Default unit is €/kWh.
288
326
  ```
289
327
 
290
328
  Price is 0.07790 before 2024-01-01.
@@ -305,7 +343,7 @@ pricing:
305
343
  value: 0.20 # It is the tax rate in [0, 1.0] <==> [0% - 100%].
306
344
  consumption_prices:
307
345
  - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
308
- value: 0.07790 # Default unit is €/kWh.
346
+ quantity_value: 0.07790 # Default unit is €/kWh.
309
347
  vat_id: "normal" # Reference to the vat rate that is applied for this period.
310
348
  ```
311
349
 
@@ -332,13 +370,13 @@ pricing:
332
370
  value: 0.0550
333
371
  consumption_prices:
334
372
  - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
335
- value: 0.07790 # Default unit is €/kWh.
373
+ quantity_value: 0.07790 # Default unit is €/kWh.
336
374
  vat_id: "normal" # Reference to the vat rate that is applied for this period.
337
375
  subscription_prices:
338
376
  - 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"
377
+ time_value: 19.83
378
+ price_unit: "€"
379
+ time_unit: "month"
342
380
  vat_id: "reduced"
343
381
  ```
344
382
 
@@ -348,7 +386,7 @@ cost[€] = quantity[kWh] * cons\_price[€/kWh] * (1 + vat[normal]) + sub\_pric
348
386
  ```
349
387
 
350
388
 
351
- Example 6: Transport price
389
+ Example 6: Transport price (fixed fee)
352
390
  ---
353
391
 
354
392
  A fixed yearly transport may be charged as well.
@@ -364,18 +402,48 @@ pricing:
364
402
  value: 0.0550
365
403
  consumption_prices:
366
404
  - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
367
- value: 0.07790 # Default unit is €/kWh.
405
+ quantity_value: 0.07790 # Default unit is €/kWh.
368
406
  vat_id: "normal" # Reference to the vat rate that is applied for this period.
369
407
  transport_prices:
370
408
  - 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"
409
+ time_value: 34.38
410
+ price_unit: "€"
411
+ time_unit: "year"
412
+ vat_id: reduced
413
+ ```
414
+ **Formula:**
415
+ ```math
416
+ cost[€] = quantity[kWh] * cons\_price[€/kWh] * (1 + vat[normal]) + trans\_price[€/year] * (1 + vat[reduced])
417
+ ```
418
+
419
+ Example 6bis: Transport price (based on consumption)
420
+ ---
421
+
422
+ Transport can also be charged per kWh consumed.
423
+
424
+ ```yaml
425
+ pricing:
426
+ vat:
427
+ - id: normal
428
+ start_date: "2023-06-01"
429
+ value: 0.20
430
+ - id: reduced
431
+ start_date: "2023-06-01"
432
+ value: 0.0550
433
+ consumption_prices:
434
+ - start_date: "2023-06-01"
435
+ quantity_value: 0.07790
436
+ vat_id: "normal"
437
+ transport_prices:
438
+ - start_date: "2023-06-01"
439
+ quantity_value: 0.00194 # €/kWh
440
+ price_unit: "€"
441
+ quantity_unit: "kWh"
374
442
  vat_id: reduced
375
443
  ```
376
444
  **Formula:**
377
445
  ```math
378
- cost[€] = quantity[kWh] * cons\_price[€/kWh] * (1 + vat[normal]) + trans\_price * (1 + vat[reduced])
446
+ cost[€] = quantity[kWh] * (cons\_price[€/kWh] * (1 + vat[normal]) + quantity[kWh] * trans\_price[€/kWh] * (1 + vat[reduced]))
379
447
  ```
380
448
 
381
449
  Example 7: Energy taxes
@@ -394,13 +462,13 @@ pricing:
394
462
  value: 0.0550
395
463
  consumption_prices:
396
464
  - start_date: "2023-06-01" # Date of the price. Format is "YYYY-MM-DD".
397
- value: 0.07790 # Default unit is €/kWh.
465
+ quantity_value: 0.07790 # Default unit is €/kWh.
398
466
  vat_id: "normal" # Reference to the vat rate that is applied for this period.
399
467
  energy_taxes:
400
468
  - 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"
469
+ quantity_value: 0.00837
470
+ price_unit: "€"
471
+ quantity_unit: "kWh"
404
472
  vat_id: normal
405
473
  ```
406
474
  **Formula:**
@@ -424,56 +492,97 @@ pricing:
424
492
  value: 0.20
425
493
  consumption_prices:
426
494
  - 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"
495
+ quantity_value: 0.07790
496
+ price_unit: "€"
497
+ quantity_unit: "kWh"
430
498
  vat_id: normal
431
499
  - start_date: "2023-07-01"
432
- value: 0.05392
500
+ quantity_value: 0.05392
433
501
  - start_date: "2023-08-01"
434
- value: 0.05568
502
+ quantity_value: 0.05568
435
503
  - start_date: "2023-09-01"
436
- value: 0.05412
504
+ quantity_value: 0.05412
437
505
  - start_date: "2023-10-01"
438
- value: 0.06333
506
+ quantity_value: 0.06333
439
507
  - start_date: "2023-11-01"
440
- value: 0.06716
508
+ quantity_value: 0.06716
441
509
  - start_date: "2023-12-01"
442
- value: 0.07235
510
+ quantity_value: 0.07235
443
511
  - start_date: "2024-01-01"
444
- value: 0.06888
512
+ quantity_value: 0.06888
445
513
  - start_date: "2024-02-01"
446
- value: 0.05972
514
+ quantity_value: 0.05972
447
515
  - start_date: "2024-03-01"
448
- value: 0.05506
516
+ quantity_value: 0.05506
449
517
  - start_date: "2024-04-01"
450
- value: 0.04842
518
+ quantity_value: 0.04842
451
519
  - start_date: "2025-01-01"
452
- value: 0.07807
520
+ quantity_value: 0.07807
453
521
  subscription_prices:
454
522
  - 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"
523
+ time_value: 19.83
524
+ price_unit: "€"
525
+ time_unit: "month"
458
526
  vat_id: reduced
459
527
  - start_date: "2023-07-01"
460
- value: 20.36
528
+ time_value: 20.36
461
529
  transport_prices:
462
530
  - 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"
531
+ time_value: 34.38
532
+ price_unit: "€"
533
+ time_unit: "year"
466
534
  vat_id: reduced
467
535
  energy_taxes:
468
536
  - 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"
537
+ quantity_value: 0.00837
538
+ price_unit: "€"
539
+ quantity_unit: "kWh"
472
540
  vat_id: normal
473
541
  - start_date: "2024-01-01"
474
- value: 0.01637
542
+ quantity_value: 0.01637
475
543
  ```
476
544
 
545
+ ## What's New in v0.4.0
546
+
547
+ ### Enhanced Cost Breakdown
548
+
549
+ Starting from version 0.4.0, Gazpar2HAWS provides detailed cost breakdowns in Home Assistant. In addition to the total cost, separate entities are published for each cost component:
550
+
551
+ - `sensor.${name}_consumption_cost`: Cost from gas consumption (quantity × consumption_price)
552
+ - `sensor.${name}_subscription_cost`: Cost from fixed subscription fees
553
+ - `sensor.${name}_transport_cost`: Cost from transport fees
554
+ - `sensor.${name}_energy_taxes_cost`: Cost from energy taxes
555
+ - `sensor.${name}_total_cost`: Total cost (sum of all components)
556
+
557
+ Where `${name}` is the device name configured in your `configuration.yaml` file (default: `gazpar2haws`).
558
+
559
+ This breakdown allows you to analyze which components contribute the most to your total gas bill over time.
560
+
561
+ ### Composite Price Model
562
+
563
+ The new pricing model supports **composite prices** where each price component can have:
564
+
565
+ 1. **Quantity component**: Variable cost based on consumption (e.g., €/kWh)
566
+ 2. **Time component**: Fixed cost based on time period (e.g., €/month)
567
+
568
+ This provides more flexibility to accurately model your energy provider's billing structure. For example:
569
+
570
+ - **Consumption prices**: Typically have only a quantity component (€/kWh)
571
+ - **Subscription prices**: Typically have only a time component (€/month)
572
+ - **Transport prices**: Can have either a quantity component (€/kWh) or a time component (€/year)
573
+ - **Energy taxes**: Typically have only a quantity component (€/kWh)
574
+
575
+ ### ⚠️ Migration Required from v0.3.x
576
+
577
+ **If you are upgrading from v0.3.x**, the pricing configuration format has changed. You must update your configuration file to the new format.
578
+
579
+ **See [MIGRATIONS.md](MIGRATIONS.md) for detailed step-by-step migration instructions** including:
580
+ - Complete before/after examples for each price type
581
+ - Migration checklist
582
+ - Common issues and troubleshooting
583
+
584
+ If you're a new user or already on v0.4.0, you can skip this section.
585
+
477
586
  ### Environment variable for Docker
478
587
 
479
588
  In a Docker environment, the configurations files are instantiated by replacing the environment variables below in the template files:
@@ -493,33 +602,67 @@ You can setup them directly in a docker-compose.yaml file (environment section)
493
602
 
494
603
  ## FAQ
495
604
 
496
- - *Is it an official GrDF application ?*
605
+ For a comprehensive list of frequently asked questions, see **[FAQ.md](FAQ.md)** which includes:
606
+
607
+ - 📖 **General questions** - What is Gazpar2HAWS, differences from other solutions
608
+ - ⚙️ **Configuration issues** - PCE identifier, reset parameter, environment variables
609
+ - 📊 **Data & statistics** - Missing data, date issues, historical retrieval
610
+ - 💰 **Cost calculation** - Pricing configuration, v0.4.0 migration, new entities
611
+ - 🏠 **Home Assistant integration** - Entity setup, Energy Dashboard, HassIO issues
612
+ - 🐳 **Docker & Add-on** - Installation, logs, version issues
613
+ - 🔧 **Troubleshooting** - Common errors, log messages, bug reporting
614
+ - 🔄 **Migration & upgrades** - Version upgrade guides, breaking changes
615
+
616
+ ### Quick Answers
497
617
 
498
- No, absolutely not. It was made by reverse engineering GrDF website without any guarantee of long-term operation. Indeed, any modification made to their website risks breaking it.
618
+ **Is it an official GrDF application?**
499
619
 
500
- - *I'm confused. What are the differences between [PyGazpar](https://github.com/ssenart/PyGazpar), [home-assistant-gazpar](https://github.com/ssenart/home-assistant-gazpar), [lovelace-gazpar-card](https://github.com/ssenart/lovelace-gazpar-card), [Gazpar2MQTT](https://github.com/ssenart/gazpar2mqtt), [Gazpar2HAWS](https://github.com/ssenart/gazpar2haws) ?*
620
+ No, absolutely not. It was made by reverse engineering GrDF website without any guarantee of long-term operation. Indeed, any modification made to their website risks breaking it.
501
621
 
502
- - [PyGazpar](https://github.com/ssenart/PyGazpar) is the low-level Python library used to query GrDF data. It was written for use by other Python programs.
503
- - [home-assistant-gazpar](https://github.com/ssenart/home-assistant-gazpar) is the first program using PyGazpar. This is a Home Assistant integration which makes it possible to provide an energy sensor. Coupled with the Recorder integration, it is capable of building a history (called statistics in HA) and displaying it using the Energy Dashboard. It is also compatible with the [lovelace-gazpar-card](https://github.com/ssenart/lovelace-gazpar-card).
504
- - [lovelace-gazpar-card](https://github.com/ssenart/lovelace-gazpar-card) is a HA card which nicely displays historical data in the form of tables or bar graphs. It is also compatible with [Gazpar2MQTT](https://github.com/ssenart/gazpar2mqtt).
505
- - [Gazpar2MQTT](https://github.com/ssenart/gazpar2mqtt) offers exactly the same functionality as [home-assistant-gazpar](https://github.com/ssenart/home-assistant-gazpar) but runs outside of HA as a standalone application, in a Docker container or in an HA add-on.
506
- - [Gazpar2HAWS](https://github.com/ssenart/gazpar2haws) replaces the use of home-assistant-gazpar/Gazpar2MQTT with the HA Recorder integration to create a data history (for Energy dashboard integration). The disadvantage of the latter solution is the non-alignment of the actual reading date and its publication date. Reading values ​​are made available for 2 to 5 days (and sometimes longer). [Gazpar2HAWS](https://github.com/ssenart/gazpar2haws) timestamps the reading value exactly to the observation dates without any offset. In addition, [Gazpar2HAWS](https://github.com/ssenart/gazpar2haws) is able to reconstruct the complete history of your data up to 3 years in the past, which is very practical in the event of data loss. Finally, it provides ways to calculate and publish energy costs.
622
+ **What are the differences between PyGazpar, home-assistant-gazpar, Gazpar2MQTT, and Gazpar2HAWS?**
507
623
 
508
- - *My PCE ID has a leading zero (e.g. "0123456789") and the application fails with an error indicating that the PCE number is unknown. I can see in the log file that it uses "123456789" without the leading zero. What happened ?*
624
+ - **[PyGazpar](https://github.com/ssenart/PyGazpar)** - Low-level Python library used to query GrDF data
625
+ - **[home-assistant-gazpar](https://github.com/ssenart/home-assistant-gazpar)** - Home Assistant integration providing energy sensor with Recorder/Energy Dashboard support
626
+ - **[Gazpar2MQTT](https://github.com/ssenart/gazpar2mqtt)** - Standalone application that publishes data via MQTT (reduces coupling with HA)
627
+ - **[Gazpar2HAWS](https://github.com/ssenart/gazpar2haws)** - Uses HA Recorder integration directly, timestamps readings to exact observation dates, reconstructs 3-year history, calculates detailed costs
509
628
 
510
- The cause is in your configuration file (grdf.devices[].pce_identifier) ​​where you configured your PCE identifier and you did not quote it. Your PCE number is then interpreted as a number instead of a string.
629
+ **My PCE ID has a leading zero (e.g. "0123456789") but it's being truncated. Why?**
630
+
631
+ The PCE identifier must be quoted in your YAML configuration. Without quotes, it's interpreted as a number and loses the leading zero.
632
+
633
+ ```yaml
634
+ # ✓ Correct
635
+ pce_identifier: "0123456789"
636
+
637
+ # ✗ Wrong - loses leading zero
638
+ pce_identifier: 0123456789
639
+ ```
640
+
641
+ See [FAQ.md](FAQ.md) for more questions and detailed answers.
511
642
 
512
643
  ## Troubleshooting
513
644
 
645
+ For comprehensive troubleshooting guidance, see **[FAQ.md](FAQ.md#troubleshooting)** which includes:
646
+
647
+ - Common log messages and their meanings
648
+ - Step-by-step debugging procedures
649
+ - Solutions to known issues from GitHub
650
+ - Error handling guides
651
+
652
+ ### Quick Troubleshooting Steps
653
+
514
654
  Sometimes, for any reason, the application does not work as expected. No entities is created in HA, some error messages are displayed, nothing happens...
515
655
 
516
- In this situation, the most valuable tool for troubleshooting what is happening is the log file.
656
+ **In this situation:**
517
657
 
518
- Take a look at it, try to find a clue that might help solve the problem. Sorry, the log file can sometimes appear cryptic.
658
+ 1. **Check the log file** - This is the most valuable troubleshooting tool
659
+ 2. **Enable debug logging** - Set `logging.level: debug` in your configuration
660
+ 3. **Verify configuration syntax** - Use a YAML validator
661
+ 4. **Check [FAQ.md](FAQ.md)** - Many common issues are already documented
519
662
 
520
663
  If your configuration is correct, you may have spotted a bug.
521
664
 
522
- In this case, capture a Github issue [here](https://github.com/ssenart/gazpar2haws/issues) with the following information:
665
+ In this case, capture a GitHub issue [here](https://github.com/ssenart/gazpar2haws/issues) with the following information:
523
666
  1. What kind of setup do you use ? Standalone application, Docker container or HA addon.
524
667
  2. Is this a first installation or a version upgrade ? If upgrading version, what was the previous version and did it work well ?
525
668
  3. Describe as precisely as possible what is happening.
@@ -527,7 +670,7 @@ In this case, capture a Github issue [here](https://github.com/ssenart/gazpar2ha
527
670
 
528
671
  The first log lines should be similar to:
529
672
  ```log
530
- 2025-02-17 02:01:17,626 INFO [__main__] Starting Gazpar2HAWS version 0.3.0
673
+ 2025-02-17 02:01:17,626 INFO [__main__] Starting Gazpar2HAWS version 0.4.0
531
674
  2025-02-17 02:01:17,627 INFO [__main__] Running on Python version: 3.12.9 (main, Feb 7 2025, 01:03:02) [GCC 12.2.0]
532
675
  ```
533
676
 
@@ -577,9 +720,28 @@ All the gazpar2haws images are available [here](https://hub.docker.com/repositor
577
720
 
578
721
  ## Contributing
579
722
 
580
- Pull requests are welcome. For any change proposal, please open an issue first to discuss what you would like to change.
723
+ Pull requests are welcome! For any change proposal, please open an issue first to discuss what you would like to change.
724
+
725
+ ### Before Contributing
726
+
727
+ 1. **Read [CLAUDE.md](CLAUDE.md)** - Developer guide with:
728
+ - Architecture overview
729
+ - Development commands (setup, testing, linting)
730
+ - Code structure and patterns
731
+ - Testing guidelines
732
+
733
+ 2. **Check [TODO.md](TODO.md)** - For planned improvements and test coverage gaps
734
+
735
+ 3. **Review [CHANGELOG.md](CHANGELOG.md)** - To understand recent changes and version history
736
+
737
+ ### Contribution Guidelines
581
738
 
582
- Please make sure to update tests as appropriate.
739
+ - Write tests for new features (see [TODO.md](TODO.md) for test coverage goals)
740
+ - Follow existing code style and patterns
741
+ - Update documentation (README.md, FAQ.md) as appropriate
742
+ - Add entries to CHANGELOG.md for your changes
743
+ - Ensure all tests pass: `poetry run pytest`
744
+ - Run linters: `poetry run pylint gazpar2haws`
583
745
 
584
746
  ## License
585
747