homebridge-viessmann-vicare 2.0.73 → 2.0.74

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.
package/README.md CHANGED
@@ -27,6 +27,8 @@ A comprehensive Homebridge plugin for Viessmann heating systems with **full cont
27
27
  - **🎯 Installation filtering**: Show only specific installations or filter by name
28
28
  - **🎛️ Easy configuration**: Full support for Homebridge Config UI X with all parameters exposed
29
29
  - **🎯 Native integration**: Complete compatibility with Apple Home app and Siri controls
30
+ - **🔋 Energy system monitoring** *(beta)*: PV production, battery storage, grid feed-in/draw, wallbox — logs to CSV and MySQL
31
+ - **🌡️ TRV / Room Sensor discovery** *(beta)*: Auto-discovers ViCare Smart Climate thermostatic radiator valves and room sensors, logs temperature history
30
32
 
31
33
  ## 🌍 Localization & Custom Names
32
34
 
@@ -202,22 +204,29 @@ npm install -g homebridge-viessmann-vicare
202
204
  Starting from v2.0.25 the plugin automatically records historical data at every refresh cycle (~15 min).
203
205
 
204
206
  ### What is recorded
205
- | Data | Source | Available in |
206
- |---|---|---|
207
- | Burner state + modulation % | Boiler | Eve app, CSV, HTML report |
208
- | Room temperature + setpoint | HC0 | Eve app, CSV, HTML report |
209
- | DHW temperature + setpoint | ACS | Eve app, CSV, HTML report |
210
- | Active program (normal/reduced/comfort) | HC0 | CSV, HTML report |
211
- | Burner starts + hours (lifetime) | Boiler | CSV, HTML report |
212
- | Outside temperature | Boiler | CSV, HTML report |
213
- | Outside humidity (if sensor present) | Boiler | CSV, HTML report |
214
- | Flow temperature / supply temp (HC0) | HC0 | CSV, HTML report |
215
- | Gas consumption heating (m³/day) | Boiler | CSV, HTML report |
216
- | Gas consumption DHW/ACS (m³/day) | Boiler | CSV, HTML report |
217
- | PV production (W) + daily yield (kWh) | Energy | CSV, HTML report |
218
- | Battery level (%) + charge/discharge (W) | Energy | CSV, HTML report |
219
- | Grid feed-in / draw (W) | Energy | CSV, HTML report |
220
- | Wallbox charging state + power (W) | Energy | CSV, HTML report |
207
+ | Data | Source | CSV | MySQL DB | HTML report |
208
+ |---|---|---|---|---|
209
+ | Burner state + modulation % | Boiler | | | |
210
+ | Room temperature + setpoint | HC | | | |
211
+ | DHW temperature + setpoint | ACS | | | |
212
+ | Active program (normal/reduced/comfort) | HC | | | ✅ |
213
+ | Burner starts + hours (lifetime + daily delta) | Boiler | | | ✅ |
214
+ | Outside temperature + humidity | Boiler | | | ✅ |
215
+ | Flow temperature (HC supply) | HC | | | ✅ |
216
+ | Gas consumption heating + DHW (m³/day, m³/month) | Boiler | | | ✅ |
217
+ | Heat production heating + DHW (kWh/day, kWh/month) | Boiler | | | ✅ |
218
+ | PV production (W) + daily yield (kWh) | Energy | | | ✅ |
219
+ | Battery level (%) + charge/discharge (W) | Energy | | | ✅ |
220
+ | Grid feed-in / draw (W) | Energy | | | ✅ |
221
+ | Wallbox charging state + power (W) | Energy | | | ✅ |
222
+ | Room sensor temperature (TRV / ViCare Smart Climate) | RoomSensor *(beta)* | | | |
223
+ | Boiler water temperature | Boiler | — | ✅ | — |
224
+ | HC operating mode + program temperatures (°C) | HC | — | ✅ | — |
225
+ | Heating curve slope + shift | HC | — | ✅ | — |
226
+ | Holiday mode + extended heating active | HC | — | ✅ | — |
227
+ | DHW mode (comfort/eco/off) | ACS | — | ✅ | — |
228
+ | DHW circulation pump state | ACS | — | ✅ | — |
229
+ | Installation ID + gateway serial | All | — | ✅ | — |
221
230
 
222
231
  ---
223
232
 
@@ -250,12 +259,48 @@ Data accumulates over time — after a few hours you will see the first trends.
250
259
 
251
260
  Every refresh appends a row to:
252
261
  ```
253
- /var/lib/homebridge/viessmann-history.csv
262
+ /var/lib/homebridge/viessmann-history-<installationId>.csv
263
+ ```
264
+
265
+ 35 columns including temperatures, gas consumption, heat production, burner stats, PV/battery/wallbox. Open directly in **Excel** or **Google Sheets** for custom analysis. Use `viessmann-report-server.js` to generate a full HTML report.
266
+
267
+ > CSV logging is enabled by default. Disable it with `logging.csv.enabled: false` in plugin config (only if using MySQL exclusively).
268
+
269
+ ---
270
+
271
+ ### 🗄️ MySQL / MariaDB (optional, v2.0.74+)
272
+
273
+ Write history to a local MySQL or MariaDB database for direct Grafana integration. The DB schema adds **13 extra columns** not present in the CSV (`boiler_water_temp`, `hc_slope/shift`, `holiday_mode_active`, `dhw_circulation_pump`, etc.).
274
+
275
+ **Step 1 — Install mysql2** (one time):
276
+ ```bash
277
+ sudo npm install --prefix /usr/local mysql2
278
+ ```
279
+
280
+ **Step 2 — Create DB user** (example):
281
+ ```sql
282
+ CREATE USER 'viessmann_rw'@'localhost' IDENTIFIED BY 'your_password';
283
+ GRANT SELECT, INSERT ON homebridge.viessmann_history TO 'viessmann_rw'@'localhost';
254
284
  ```
255
285
 
256
- Columns: `timestamp, accessory, burner_active, modulation, room_temp, target_temp, outside_temp, dhw_temp, dhw_target, program, mode, burner_starts, burner_hours`
286
+ **Step 3 Enable in plugin config**:
287
+ ```json
288
+ "logging": {
289
+ "csv": { "enabled": true },
290
+ "mysql": {
291
+ "enabled": true,
292
+ "host": "localhost",
293
+ "port": 3306,
294
+ "database": "homebridge",
295
+ "user": "viessmann_rw",
296
+ "password": "your_password",
297
+ "table": "viessmann_history",
298
+ "autoCreateTable": true
299
+ }
300
+ }
301
+ ```
257
302
 
258
- Open directly in **Excel** or **Google Sheets** for custom analysis.
303
+ **Step 4 Restart Homebridge.** The table is created automatically. Existing CSV history is imported in the background on first run.
259
304
 
260
305
  ---
261
306
 
@@ -1033,6 +1078,25 @@ For issues and questions:
1033
1078
 
1034
1079
  ## 📈 Changelog
1035
1080
 
1081
+ ### [2.0.74] - 2026-06-23
1082
+ - feat: optional MySQL/MariaDB history logging (`logging.mysql.*` config section) — direct Grafana integration without import scripts
1083
+ - feat: 13 extra DB-only columns: `boiler_water_temp`, `hc_operating_mode`, `hc_comfort/normal/reduced_temp`, `hc_slope/shift`, `holiday_mode_active`, `extended_heating_active`, `dhw_mode`, `dhw_circulation_pump`, `installation_id`, `gateway_serial`
1084
+ - feat: table auto-created on first run; existing CSV imported automatically in background
1085
+ - feat: `logging.csv.enabled` flag (default `true`) — CSV can now be disabled if using MySQL exclusively
1086
+ - chore: `mysql2 ^3.11.0` added as `optionalDependencies`
1087
+
1088
+ ### [2.0.73] - 2026-06-23
1089
+ - fix: report server timeout default corrected from 300 s to 600 s; max raised from 1800 s to 3600 s
1090
+ - fix: `platform.ts` timeout fallback corrected from 300 s to 600 s
1091
+
1092
+ ### [2.0.72] - 2026-06-23
1093
+ - fix: `readApiStatus` function missing from report server — caused crash on every `GET /` request (`ReferenceError: readApiStatus is not defined`)
1094
+ - chore: axios updated to `^1.17.0`
1095
+
1096
+ ### [2.0.71] - 2026-05-30
1097
+ - feat: API usage dashboard card in report server UI (daily usage bar, health score, rate limit status)
1098
+ - feat: `writeApiStatusFile` writes `viessmann-api-status.json` after each update cycle
1099
+
1036
1100
  ### [2.0.70] - 2026-05-29
1037
1101
  - feat: TRV / Room Sensor discovery mode (`features.enableRoomSensorDiscovery`) — scans all gateway devices, logs every API feature path+value tagged `[RoomDiscovery]`, creates a provisional HomeKit `TemperatureSensor` for each device with a temperature reading
1038
1102
  - feat: report generation timeout now configurable (`reportServerTimeout`, default 300 s, range 60–1800 s) — exposed in Homebridge Config UI X
package/SETUP-GUIDE.md CHANGED
@@ -1,8 +1,8 @@
1
- # Complete Setup Guide - v2.0.73
1
+ # Complete Setup Guide - v2.0.74
2
2
 
3
3
  ## Overview
4
4
 
5
- This guide will walk you through setting up the Viessmann ViCare plugin v2.0.73 for Homebridge, including all the advanced features like intelligent caching, rate limiting protection, comprehensive configuration options, **complete localization support with custom names**, **CSV history logging**, **HTML diagnostic reports**, **energy system monitoring** (PV, battery, wallbox), and **heating schedule awareness** with visual bands in the HTML report, and **heat pump (Wärmepumpe) support** with automatic device detection.
5
+ This guide will walk you through setting up the Viessmann ViCare plugin v2.0.74 for Homebridge, including all the advanced features like intelligent caching, rate limiting protection, comprehensive configuration options, **complete localization support with custom names**, **CSV history logging**, **HTML diagnostic reports**, **energy system monitoring** (PV, battery, wallbox), and **heating schedule awareness** with visual bands in the HTML report, and **heat pump (Wärmepumpe) support** with automatic device detection.
6
6
 
7
7
  ## Prerequisites
8
8
 
@@ -277,25 +277,29 @@ After successful authentication:
277
277
 
278
278
  ---
279
279
 
280
- ### 7. 📊 CSV History Logging & HTML Reports
280
+ ### 7. 📊 History Logging, CSV & MySQL
281
281
 
282
- Starting from v2.0.26, the plugin automatically logs heating data to a CSV file and includes a standalone HTML report generator.
282
+ Starting from v2.0.26, the plugin automatically logs heating data to a CSV file and includes a standalone HTML report generator. Starting from v2.0.74, it can also write directly to a **MySQL/MariaDB** database for Grafana integration.
283
283
 
284
284
  #### **What is logged (every ~15 minutes)**
285
285
 
286
- | Column | Source | Description |
287
- |---|---|---|
288
- | `burner_active`, `modulation` | Boiler | Burner state and modulation % |
289
- | `outside_temp`, `outside_humidity` | Boiler | Outdoor sensors (if available) |
290
- | `gas_heating_day_m3`, `gas_dhw_day_m3` | Boiler | Daily gas consumption in m³ |
291
- | `burner_starts`, `burner_hours` | Boiler | Lifetime statistics |
292
- | `room_temp`, `target_temp` | HC0 | Room temperature and setpoint |
293
- | `flow_temp` | HC0 | Supply/flow temperature |
294
- | `program`, `mode` | HC0 | Active heating program and mode |
295
- | `dhw_temp`, `dhw_target` | ACS | DHW temperature and setpoint |
296
- | `pv_production_w`, `pv_daily_kwh` | Energy | PV production (if available) |
297
- | `battery_level`, `battery_charging_w` | Energy | Battery state (if available) |
298
- | `wallbox_charging`, `wallbox_power_w` | Energy | Wallbox state (if available) |
286
+ | Column | Source | CSV | MySQL |
287
+ |---|---|---|---|
288
+ | `burner_active`, `modulation` | Boiler | | |
289
+ | `outside_temp`, `outside_humidity` | Boiler | | |
290
+ | `gas_heating_day_m3`, `gas_dhw_day_m3` | Boiler | | |
291
+ | `burner_starts/hours`, `burner_starts/hours_today` | Boiler | | |
292
+ | `heat_heating/dhw_day/month_kwh` | Boiler | | |
293
+ | `room_temp`, `target_temp`, `flow_temp` | HC | | |
294
+ | `program`, `mode` | HC | | |
295
+ | `dhw_temp`, `dhw_target` | ACS | | |
296
+ | `pv_*`, `battery_*`, `wallbox_*`, `grid_*` | Energy | | |
297
+ | `boiler_water_temp` | Boiler | | |
298
+ | `hc_operating_mode`, `hc_comfort/normal/reduced_temp` | HC | | |
299
+ | `hc_slope`, `hc_shift` | HC | — | ✅ |
300
+ | `holiday_mode_active`, `extended_heating_active` | HC | — | ✅ |
301
+ | `dhw_mode`, `dhw_circulation_pump` | ACS | — | ✅ |
302
+ | `installation_id`, `gateway_serial` | All | — | ✅ |
299
303
 
300
304
  CSV files location: `/var/lib/homebridge/viessmann-history-<installationId>.csv` (one file per installation)
301
305
 
@@ -311,6 +315,37 @@ CSV files location: `/var/lib/homebridge/viessmann-history-<installationId>.csv`
311
315
  > sed -i '1s/.*/timestamp,accessory,burner_active,modulation,room_temp,target_temp,outside_temp,outside_humidity,dhw_temp,dhw_target,program,mode,burner_starts,burner_hours,flow_temp,gas_heating_day_m3,gas_dhw_day_m3,pv_production_w,pv_daily_kwh,battery_level,battery_charging_w,battery_discharging_w,grid_feedin_w,grid_draw_w,wallbox_charging,wallbox_power_w/' /var/lib/homebridge/viessmann-history-YOUR_INSTALLATION_ID.csv
312
316
  > ```
313
317
 
318
+ #### **MySQL / MariaDB logging (v2.0.74+)**
319
+
320
+ Optional. Writes every row directly to a local database — ideal for **Grafana** dashboards.
321
+
322
+ **Step 1 — Install mysql2** (one time):
323
+ ```bash
324
+ sudo npm install --prefix /usr/local mysql2
325
+ ```
326
+
327
+ **Step 2 — Enable in plugin config**:
328
+ ```json
329
+ "logging": {
330
+ "csv": { "enabled": true },
331
+ "mysql": {
332
+ "enabled": true,
333
+ "host": "localhost",
334
+ "port": 3306,
335
+ "database": "homebridge",
336
+ "user": "viessmann_rw",
337
+ "password": "your_password",
338
+ "table": "viessmann_history",
339
+ "autoCreateTable": true
340
+ }
341
+ }
342
+ ```
343
+
344
+ **Step 3 — Restart Homebridge.** The table `viessmann_history` is created automatically. Existing CSV history is imported in the background on first run.
345
+
346
+ > `logging.csv.enabled` defaults to `true` — CSV and MySQL can run in parallel. Set `csv.enabled: false` only if you want MySQL exclusively. If both are disabled, Homebridge logs a warning at startup.
347
+
348
+
314
349
  #### **Heating schedule file (v2.0.31+)**
315
350
 
316
351
  Starting from v2.0.31, the plugin automatically saves the weekly heating schedule to a JSON file after every API refresh:
@@ -714,7 +749,18 @@ These accessories are created **only if your installation has the corresponding
714
749
  - **Wallbox / EV Charger**: `[Installation] Energy Wallbox` — Switch + Outlet service
715
750
  - **Electric DHW Heater**: `[Installation] Energy DHW Heater` — HeaterCooler service
716
751
 
717
- All energy data is also logged to the CSV history file and included in the HTML report.
752
+ All energy data (PV production, battery level, charge/discharge, grid, wallbox) is logged to CSV and MySQL at every refresh cycle. Battery level is also recorded in FakeGato (Eve app graphs).
753
+
754
+ > ⚠️ **Beta**: Energy accessory support and history logging are functional but depend on Viessmann API path variants that differ across VitoCharge generations. Enable `debug: true` and share logs if data appears missing.
755
+
756
+ ### 🌡️ TRV / Room Sensor Accessories *(beta)*
757
+
758
+ Enable with `features.enableRoomSensorDiscovery: true` in plugin config. The plugin scans all non-main gateway devices and creates a `TemperatureSensor` accessory for each device with a temperature reading (ViCare Smart Climate TRVs, zone sensors, etc.).
759
+
760
+ Temperature history is logged to CSV (`room-<deviceId>` column) and MySQL on every refresh cycle.
761
+
762
+ > ⚠️ **Beta**: Feature paths for TRV models vary by device generation. If temperature shows 0 or is missing, check Homebridge logs for `[RoomDiscovery]` lines and open a GitHub issue with the output.
763
+
718
764
 
719
765
  ### 🔥 Boiler Accessories
720
766
  - **Main Boiler Control**: `[Installation Prefix] [Custom Boiler Name]` - HeaterCooler service for temperature and mode control
@@ -1228,6 +1274,14 @@ sudo systemctl restart homebridge
1228
1274
 
1229
1275
  ## Changelog
1230
1276
 
1277
+ ### v2.0.74 (2026-06-23)
1278
+ - feat: optional MySQL/MariaDB history logging (`logging.mysql.*` config section)
1279
+ - feat: `DbRow` extends CSV schema with 13 extra DB-only columns: `installation_id`, `gateway_serial`, `boiler_water_temp`, `hc_operating_mode`, `hc_comfort_temp/normal/reduced`, `hc_slope/shift`, `holiday_mode_active`, `extended_heating_active`, `dhw_mode`, `dhw_circulation_pump`
1280
+ - feat: table auto-created on first run; existing CSV imported automatically in background
1281
+ - feat: `logging.csv.enabled` flag (default `true`) — CSV can now be disabled if using MySQL exclusively
1282
+ - warn: if both CSV and MySQL disabled, Homebridge logs a clear warning
1283
+ - chore: `mysql2 ^3.11.0` added as `optionalDependencies`
1284
+
1231
1285
  ### v2.0.73 (2026-06-23)
1232
1286
  - fix: report server timeout default was 300 s instead of 600 s; clamp raised to 3600 s max (was 1800 s)
1233
1287
  - fix: platform.ts timeout fallback corrected from 300 s to 600 s
@@ -524,6 +524,79 @@
524
524
  "minimum": 120,
525
525
  "maximum": 3600,
526
526
  "description": "Maximum time in seconds for report generation. RPi 3 benchmark: ~365s for 90 days / ~1460s for 365 days. Default: 600s. Range: 120–3600s."
527
+ },
528
+ "logging": {
529
+ "title": "📊 History Logging",
530
+ "type": "object",
531
+ "properties": {
532
+ "csv": {
533
+ "title": "CSV Logging",
534
+ "type": "object",
535
+ "properties": {
536
+ "enabled": {
537
+ "title": "Enable CSV history file",
538
+ "type": "boolean",
539
+ "default": true,
540
+ "description": "Write history to CSV file (viessmann-history-<installationId>.csv). Enabled by default — disable only if using MySQL exclusively."
541
+ }
542
+ }
543
+ },
544
+ "mysql": {
545
+ "title": "MySQL / MariaDB Logging",
546
+ "type": "object",
547
+ "properties": {
548
+ "enabled": {
549
+ "title": "Enable MySQL/MariaDB logging",
550
+ "type": "boolean",
551
+ "default": false,
552
+ "description": "Write history to MySQL or MariaDB. Requires: sudo npm install --prefix /usr/local mysql2"
553
+ },
554
+ "host": {
555
+ "title": "Host",
556
+ "type": "string",
557
+ "default": "localhost",
558
+ "description": "MySQL/MariaDB hostname or IP."
559
+ },
560
+ "port": {
561
+ "title": "Port",
562
+ "type": "integer",
563
+ "default": 3306,
564
+ "minimum": 1024,
565
+ "maximum": 65535,
566
+ "description": "MySQL/MariaDB port (default: 3306)."
567
+ },
568
+ "database": {
569
+ "title": "Database",
570
+ "type": "string",
571
+ "default": "homebridge",
572
+ "description": "Database name."
573
+ },
574
+ "user": {
575
+ "title": "User",
576
+ "type": "string",
577
+ "default": "viessmann_rw",
578
+ "description": "MySQL user with INSERT privilege on the table."
579
+ },
580
+ "password": {
581
+ "title": "Password",
582
+ "type": "string",
583
+ "description": "MySQL password."
584
+ },
585
+ "table": {
586
+ "title": "Table",
587
+ "type": "string",
588
+ "default": "viessmann_history",
589
+ "description": "Table name. Will be created automatically if autoCreateTable is enabled."
590
+ },
591
+ "autoCreateTable": {
592
+ "title": "Auto-create table",
593
+ "type": "boolean",
594
+ "default": true,
595
+ "description": "CREATE TABLE IF NOT EXISTS on first run, then import existing CSV history automatically."
596
+ }
597
+ }
598
+ }
599
+ }
527
600
  }
528
601
  },
529
602
  "required": [
@@ -1 +1 @@
1
- {"version":3,"file":"boiler-accessory.d.ts","sourceRoot":"","sources":["../../src/accessories/boiler-accessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE7E,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,eAAe,EAA2B,MAAM,aAAa,CAAC;AAEnI,qBAAa,wBAAwB;IA+DjC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAlEzB,OAAO,CAAC,mBAAmB,CAAU;IACrC,OAAO,CAAC,kBAAkB,CAAU;IACpC,OAAO,CAAC,iBAAiB,CAAC,CAAU;IACpC,OAAO,CAAC,aAAa,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YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;QACxC,mBAAmB,EAAE,MAAM,CAAC;QAC5B,sBAAsB,EAAE,MAAM,CAAC;QAC/B,qBAAqB,EAAE,MAAM,CAAC;QAC9B,wBAAwB,EAAE,MAAM,CAAC;QACjC,kBAAkB,EAAE,MAAM,CAAC;QAC3B,aAAa,EAAE,MAAM,CAAC;QACtB,YAAY,EAAE,MAAM,CAAC;KACtB;CAsBF"}
@@ -82,7 +82,7 @@ class ViessmannBoilerAccessory {
82
82
  // Set update handler for platform to call
83
83
  this.accessory.context.updateHandler = this.handleUpdate.bind(this);
84
84
  // Initialize history logger (FakeGato + CSV)
85
- this.historyLogger = new history_logger_1.ViessmannHistoryLogger(platform, accessory, 'energy', 'Boiler', installation?.id);
85
+ this.historyLogger = new history_logger_1.ViessmannHistoryLogger(platform, accessory, 'energy', 'Boiler', installation?.id, gateway?.serial);
86
86
  // Initialize capabilities and setup characteristics
87
87
  this.initializeCapabilities();
88
88
  }
@@ -712,7 +712,7 @@ class ViessmannBoilerAccessory {
712
712
  if (this.historyLogger) {
713
713
  const startsToday = this.states.BurnerStarts - this.dailyRef.startsRef;
714
714
  const hoursToday = this.states.BurnerHours - this.dailyRef.hoursRef;
715
- this.historyLogger.appendCsvRow({
715
+ this.historyLogger.appendRow({
716
716
  timestamp: new Date().toISOString(),
717
717
  accessory: 'boiler',
718
718
  event_type: newBurnerState ? 'burner_on' : 'burner_off',
@@ -723,6 +723,7 @@ class ViessmannBoilerAccessory {
723
723
  burner_hours: this.states.BurnerHours,
724
724
  burner_starts_today: startsToday >= 0 ? startsToday : undefined,
725
725
  burner_hours_today: hoursToday >= 0 ? hoursToday : undefined,
726
+ boiler_water_temp: this.states.CurrentTemperature,
726
727
  });
727
728
  }
728
729
  }
@@ -965,7 +966,7 @@ class ViessmannBoilerAccessory {
965
966
  this.historyLogger.addEnergyEntry({ power: this.states.Modulation });
966
967
  const startsToday = this.states.BurnerStarts - this.dailyRef.startsRef;
967
968
  const hoursToday = this.states.BurnerHours - this.dailyRef.hoursRef;
968
- this.historyLogger.appendCsvRow({
969
+ this.historyLogger.appendRow({
969
970
  timestamp: new Date().toISOString(),
970
971
  accessory: 'boiler',
971
972
  event_type: 'snapshot',
@@ -985,6 +986,7 @@ class ViessmannBoilerAccessory {
985
986
  heat_dhw_day_kwh: this.states.HeatProductionDhwToday || undefined,
986
987
  heat_heating_month_kwh: this.states.HeatProductionHeatingThisMonth || undefined,
987
988
  heat_dhw_month_kwh: this.states.HeatProductionDhwThisMonth || undefined,
989
+ boiler_water_temp: this.states.CurrentTemperature,
988
990
  });
989
991
  }
990
992
  }
@@ -17,6 +17,7 @@ export declare class ViessmannDHWAccessory {
17
17
  private currentMode;
18
18
  private _updatingCharacteristics;
19
19
  private historyLogger?;
20
+ private dhwCirculationPump;
20
21
  private pendingModeUntil;
21
22
  private pendingTempUntil;
22
23
  private pendingExpectedMode;
@@ -1 +1 @@
1
- {"version":3,"file":"dhw-accessory.d.ts","sourceRoot":"","sources":["../../src/accessories/dhw-accessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE7E,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,eAAe,EAA2B,MAAM,aAAa,CAAC;AAGnI,qBAAa,qBAAqB;IAoC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAvCzB,OAAO,CAAC,mBAAmB,CAAU;IACrC,OAAO,CAAC,kBAAkB,CAAU;IACpC,OAAO,CAAC,cAAc,CAAC,CAAU;IACjC,OAAO,CAA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AAO,CAAC,mBAAmB,CAAC;IAIrD,8BAA8B,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAK9D,8BAA8B,CAAC,KAAK,EAAE,mBAAmB;IA6D/D,OAAO,CAAC,2BAA2B;YAuFrB,YAAY;YAcZ,kBAAkB;IAiHzB,2BAA2B,CAAC,YAAY,EAAE,GAAG,GAAG,IAAI;IA2DpD,kBAAkB,IAAI;QAC3B,cAAc,EAAE,MAAM,EAAE,CAAC;QACzB,0BAA0B,EAAE,OAAO,CAAC;QACpC,gBAAgB,EAAE;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC;QAC/C,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,EAAE,OAAO,CAAC;QACxB,UAAU,EAAE,OAAO,CAAC;QACpB,UAAU,EAAE,OAAO,CAAC;KACrB;IAaM,YAAY,IAAI;QACrB,QAAQ,EAAE,OAAO,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,kBAAkB,EAAE,OAAO,CAAC;QAC5B,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB;IAgBY,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IA+B9C,OAAO,CAAC,8BAA8B;IAwBzB,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IA4BxC,OAAO,IAAI,IAAI;CASvB"}
@@ -25,6 +25,7 @@ class ViessmannDHWAccessory {
25
25
  // warnings. While this flag is true, all setXxxMode() calls are ignored.
26
26
  _updatingCharacteristics = false;
27
27
  historyLogger;
28
+ dhwCirculationPump;
28
29
  pendingModeUntil = 0;
29
30
  pendingTempUntil = 0;
30
31
  pendingExpectedMode = undefined;
@@ -59,7 +60,7 @@ class ViessmannDHWAccessory {
59
60
  // Set update handler for platform to call
60
61
  this.accessory.context.updateHandler = this.handleUpdate.bind(this);
61
62
  // Initialize history logger (FakeGato + CSV)
62
- this.historyLogger = new history_logger_1.ViessmannHistoryLogger(platform, accessory, 'thermo', 'ACS', installation?.id);
63
+ this.historyLogger = new history_logger_1.ViessmannHistoryLogger(platform, accessory, 'thermo', 'ACS', installation?.id, gateway?.serial);
63
64
  // Initialize capabilities and setup characteristics
64
65
  this.initializeCapabilities();
65
66
  }
@@ -726,19 +727,26 @@ class ViessmannDHWAccessory {
726
727
  else {
727
728
  this.platform.log.debug(`🚿 ACS state unchanged: ${summary}`);
728
729
  }
729
- // 📊 History logging — FakeGato thermo + CSV
730
+ // 📊 History logging — FakeGato thermo + CSV/MySQL
730
731
  if (this.historyLogger) {
732
+ // Read circulation pump state (feature may not exist on all installations)
733
+ const pumpFeature = features.find(f => f.feature === 'heating.dhw.pumps.circulation');
734
+ if (pumpFeature?.isEnabled) {
735
+ this.dhwCirculationPump = pumpFeature.properties?.status?.value === 'on';
736
+ }
731
737
  this.historyLogger.addThermoEntry({
732
738
  currentTemp: this.states.CurrentTemperature,
733
739
  setTemp: this.states.HeatingThresholdTemperature,
734
740
  });
735
- this.historyLogger.appendCsvRow({
741
+ this.historyLogger.appendRow({
736
742
  timestamp: new Date().toISOString(),
737
743
  accessory: 'dhw',
738
744
  event_type: 'snapshot',
739
745
  dhw_temp: this.states.CurrentTemperature,
740
746
  dhw_target: this.states.HeatingThresholdTemperature,
741
747
  mode: this.currentMode,
748
+ dhw_mode: this.currentMode,
749
+ dhw_circulation_pump: this.dhwCirculationPump,
742
750
  });
743
751
  }
744
752
  }
@@ -39,6 +39,7 @@ export declare class ViessmannEnergyAccessory {
39
39
  private hasBattery;
40
40
  private hasWallbox;
41
41
  private hasElectricDHW;
42
+ private historyLogger?;
42
43
  private hpPaths;
43
44
  private states;
44
45
  constructor(platform: ViessmannPlatform, accessory: PlatformAccessory, installation: ViessmannInstallation, gateway: ViessmannGateway, device: ViessmannDevice);
@@ -1 +1 @@
1
- {"version":3,"file":"energy-accessory.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C,kBAAkB,CAAC,CAAU;IAIrC,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,cAAc,CAAU;IAGhC,OAAO,CAAC,aAAa,CAAC,CAAyB;IAI/C,OAAO,CAAC,OAAO,CAOb;IAGF,OAAO,CAAC,MAAM,CAwCZ;gBAGiB,QAAQ,EAAE,iBAAiB,EAC3B,SAAS,EAAE,iBAAiB,EAC5B,YAAY,EAAE,qBAAqB,EACnC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,eAAe;IAyB1C,OAAO,CAAC,gBAAgB;YAUV,sBAAsB;IAuBpC,OAAO,CAAC,cAAc;IAoCtB,OAAO,CAAC,kBAAkB;IA6D1B;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAqD5B,OAAO,CAAC,aAAa;IAoBrB,OAAO,CAAC,qBAAqB;IAwF7B,OAAO,CAAC,eAAe;IAkCvB,OAAO,CAAC,oBAAoB;IAgE5B,OAAO,CAAC,oBAAoB;IAwC5B,OAAO,CAAC,uBAAuB;IAwDlB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;YAa5B,kBAAkB;YAkClB,cAAc;YAiJd,mBAAmB;YA4LnB,kBAAkB;YAmBlB,oBAAoB;YAmBpB,yBAAyB;CAgBxC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ViessmannEnergyAccessory = void 0;
4
+ const history_logger_1 = require("./history-logger");
4
5
  /**
5
6
  * ViessmannEnergyAccessory
6
7
  *
@@ -47,6 +48,8 @@ class ViessmannEnergyAccessory {
47
48
  hasBattery = false;
48
49
  hasWallbox = false;
49
50
  hasElectricDHW = false;
51
+ // ── History logger ────────────────────────────────────────────────────────
52
+ historyLogger;
50
53
  // ── Known heat pump feature path variants (populated at runtime) ──────────
51
54
  // We try several known paths; whichever resolves first is stored here.
52
55
  hpPaths = {
@@ -110,6 +113,8 @@ class ViessmannEnergyAccessory {
110
113
  .setCharacteristic(this.platform.Characteristic.FirmwareRevision, '1.0.0');
111
114
  // Register update handler
112
115
  this.accessory.context.updateHandler = this.handleUpdate.bind(this);
116
+ // History logging (CSV + optional MySQL)
117
+ this.historyLogger = new history_logger_1.ViessmannHistoryLogger(platform, accessory, 'energy', 'Energy', installation.id, gateway.serial);
113
118
  this.initializeCapabilities();
114
119
  }
115
120
  // ── Device type helpers ───────────────────────────────────────────────────
@@ -499,6 +504,26 @@ class ViessmannEnergyAccessory {
499
504
  else {
500
505
  await this.updateEnergyDevices(features, get, tag);
501
506
  }
507
+ // 📊 History logging — CSV + MySQL snapshot
508
+ if (this.historyLogger) {
509
+ this.historyLogger.addEnergyEntry({
510
+ power: this.states.batteryLevelPercent, // Battery % as FakeGato energy proxy
511
+ });
512
+ this.historyLogger.appendRow({
513
+ timestamp: new Date().toISOString(),
514
+ accessory: 'energy',
515
+ event_type: 'snapshot',
516
+ pv_production_w: this.states.pvProductionW || undefined,
517
+ pv_daily_kwh: this.states.pvDailyYieldKwh || undefined,
518
+ battery_level: this.states.batteryLevelPercent || undefined,
519
+ battery_charging_w: this.states.batteryChargingW || undefined,
520
+ battery_discharging_w: this.states.batteryDischargingW || undefined,
521
+ grid_feedin_w: this.states.gridFeedInW || undefined,
522
+ grid_draw_w: this.states.gridDrawW || undefined,
523
+ wallbox_charging: this.states.wallboxChargingActive,
524
+ wallbox_power_w: this.states.wallboxChargingPowerW || undefined,
525
+ });
526
+ }
502
527
  }
503
528
  // ── Heat pump update ───────────────────────────────────────────────────────
504
529
  async updateHeatPump(features, get, tag) {
@@ -37,6 +37,8 @@ export declare class ViessmannHeatingCircuitAccessory {
37
37
  private states;
38
38
  private programTemperatures;
39
39
  private historyLogger?;
40
+ private curveSlope;
41
+ private curveShift;
40
42
  private heatingSchedule;
41
43
  private scheduleRefreshTimer;
42
44
  constructor(platform: ViessmannPlatform, accessory: PlatformAccessory, installation: ViessmannInstallation, gateway: ViessmannGateway, device: ViessmannDevice, circuitNumber: number);
@@ -1 +1 @@
1
- {"version":3,"file":"heating-circuit-accessory.d.ts","sourceRoot":"","sources":["../../src/accessories/heating-circuit-accessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE7E,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,eAAe,EAA2B,MAAM,aAAa,CAAC;AAInI,qBAAa,gCAAgC;IAuEzC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IA3EhC,OAAO,CAAC,mBAAmB,CAAU;IACrC,OAAO,CAAC,kBAAkB,CAAU;IAGpC,OAAO,CAAC,cAAc,CAAC,CAAU;IACjC,OAAO,CAAC,oBAAoB,CAAC,CAAU;IACvC,OAAO,CAAC,sBAAsB,CAAC,CAAU;IAGzC,OAAO,CAAC,cAAc,CAAC,CAAU;IACjC,OAAO,CAAC,cAAc,CAAC,CAAU;IACjC,OAAO,CAAC,cAAc,CAAC,CAAU;IAEjC,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,iBAAiB,CAAgB;IACzC,OAAO,CAAC,wBAAwB,CAAgB;IAChD,OAAO,CAAC,0BAA0B,CAAS;IAC3C,OAAO,CAAC,sBAAsB,CAAuB;IACrD,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,cAAc,CAAY;IAElC,OAAO,CAAC,oBAAoB,CAAa;IAIzC,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC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CAAC,mCAAmC;IA0B3C,OAAO,CAAC,+BAA+B;YA2BzB,iBAAiB;YAgBjB,gBAAgB;YAgBhB,iBAAiB;YAgBjB,wBAAwB;IAyDtC,OAAO,CAAC,gCAAgC;IAyBlC,SAAS,CAAC,KAAK,EAAE,mBAAmB;IAgBpC,0BAA0B,CAAC,KAAK,EAAE,mBAAmB;YAa7C,cAAc;YAgEd,oBAAoB;YA6DpB,sBAAsB;YAwItB,6BAA6B;YAsH7B,qBAAqB;IAsBnC,OAAO,CAAC,4BAA4B;IAyCpC,OAAO,CAAC,2BAA2B;IAMnC;;OAEG;YACW,oCAAoC;IAiDlD;;OAEG;YACW,6BAA6B;IAyB3C;;OAEG;YACW,+BAA+B;IAsB7C;;OAEG;IACH,OAAO,CAAC,+BAA+B;YAsBzB,OAAO;IA8CrB,OAAO,CAAC,wBAAwB;IAa1B,qBAAqB,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAIrD,8BAA8B,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAI9D,8BAA8B,CAAC,KAAK,EAAE,mBAAmB;IAyD/D,OAAO,CAAC,kBAAkB;IA4BpB,0BAA0B,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAKhE,OAAO,CAAC,2BAA2B;IA6FnC,OAAO,CAAC,2BAA2B;YA8DrB,YAAY;YAYZ,kBAAkB;CA4RjC"}
@@ -64,6 +64,8 @@ class ViessmannHeatingCircuitAccessory {
64
64
  comfort: 19,
65
65
  };
66
66
  historyLogger;
67
+ curveSlope;
68
+ curveShift;
67
69
  // 🗓️ Schedule-aware refresh
68
70
  heatingSchedule = {};
69
71
  scheduleRefreshTimer = null;
@@ -88,7 +90,7 @@ class ViessmannHeatingCircuitAccessory {
88
90
  // Set update handler for platform to call
89
91
  this.accessory.context.updateHandler = this.handleUpdate.bind(this);
90
92
  // Initialize history logger (FakeGato + CSV)
91
- this.historyLogger = new history_logger_1.ViessmannHistoryLogger(platform, accessory, 'thermo', `HC${circuitNumber}`, installation?.id);
93
+ this.historyLogger = new history_logger_1.ViessmannHistoryLogger(platform, accessory, 'thermo', `HC${circuitNumber}`, installation?.id, gateway?.serial);
92
94
  // Initialize capabilities and setup characteristics
93
95
  this.initializeCapabilities();
94
96
  }
@@ -1594,13 +1596,19 @@ class ViessmannHeatingCircuitAccessory {
1594
1596
  catch (_) { /* non-critical */ }
1595
1597
  }
1596
1598
  this.scheduleNextProgramBoundary();
1597
- // 📊 History logging — FakeGato thermo + CSV
1599
+ // 📊 History logging — FakeGato thermo + CSV/MySQL
1598
1600
  if (this.historyLogger) {
1601
+ // Read heating curve slope/shift (model-dependent — may be absent)
1602
+ const curveFeature = features.find(f => f.feature === `heating.circuits.${this.circuitNumber}.heating.curve`);
1603
+ if (curveFeature?.isEnabled) {
1604
+ this.curveSlope = curveFeature.properties?.slope?.value;
1605
+ this.curveShift = curveFeature.properties?.shift?.value;
1606
+ }
1599
1607
  this.historyLogger.addThermoEntry({
1600
1608
  currentTemp: this.states.CurrentTemperature,
1601
1609
  setTemp: this.states.HeatingThresholdTemperature,
1602
1610
  });
1603
- this.historyLogger.appendCsvRow({
1611
+ this.historyLogger.appendRow({
1604
1612
  timestamp: new Date().toISOString(),
1605
1613
  accessory: `hc${this.circuitNumber}`,
1606
1614
  event_type: 'snapshot',
@@ -1609,6 +1617,14 @@ class ViessmannHeatingCircuitAccessory {
1609
1617
  flow_temp: this.states.FlowTemperature,
1610
1618
  program: this.currentProgram,
1611
1619
  mode: this.currentMode,
1620
+ hc_operating_mode: this.currentMode,
1621
+ hc_comfort_temp: this.programTemperatures.comfort,
1622
+ hc_normal_temp: this.programTemperatures.normal,
1623
+ hc_reduced_temp: this.programTemperatures.reduced,
1624
+ hc_slope: this.curveSlope,
1625
+ hc_shift: this.curveShift,
1626
+ holiday_mode_active: this.states.HolidayActive,
1627
+ extended_heating_active: this.states.ExtendedHeatingActive,
1612
1628
  });
1613
1629
  }
1614
1630
  }