Skip to content
This repository was archived by the owner on Apr 12, 2026. It is now read-only.

Commit 79a37af

Browse files
Ubuntuclaude
authored andcommitted
feat(sensor): add operating hours as core sensors (enabled by default)
Compressor, heat pump total, heating circuit, and hot water operating hours are standard values every WP owner needs. Now enabled by default instead of hidden in 1367 disabled entities. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cb66975 commit 79a37af

1 file changed

Lines changed: 47 additions & 1 deletion

File tree

  • custom_components/luxtronik2_modbus_proxy

custom_components/luxtronik2_modbus_proxy/sensor.py

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,52 @@ class LuxtronikSensorEntityDescription(SensorEntityDescription):
226226
lux_index=257,
227227
value_fn=_lux_calcs.calculations[257].from_heatpump, # D-04, D-17
228228
),
229+
# Operating hours — enabled by default, every WP owner needs these.
230+
# Luxtronik stores seconds; from_heatpump() converts to hours (float).
231+
# Calculation index 56: Compressor 1 operating hours (ID_WEB_Zaehler_BetrZeitVD1)
232+
LuxtronikSensorEntityDescription(
233+
key="operating_hours_compressor",
234+
name="Luxtronik Compressor Operating Hours",
235+
icon="mdi:timer-cog",
236+
native_unit_of_measurement="h",
237+
state_class=SensorStateClass.TOTAL_INCREASING,
238+
data_source="calculations",
239+
lux_index=56,
240+
value_fn=_lux_calcs.calculations[56].from_heatpump,
241+
),
242+
# Calculation index 63: Total heat pump operating hours (ID_WEB_Zaehler_BetrZeitWP)
243+
LuxtronikSensorEntityDescription(
244+
key="operating_hours_heatpump",
245+
name="Luxtronik Heat Pump Operating Hours",
246+
icon="mdi:timer",
247+
native_unit_of_measurement="h",
248+
state_class=SensorStateClass.TOTAL_INCREASING,
249+
data_source="calculations",
250+
lux_index=63,
251+
value_fn=_lux_calcs.calculations[63].from_heatpump,
252+
),
253+
# Calculation index 64: Heating circuit operating hours (ID_WEB_Zaehler_BetrZeitHz)
254+
LuxtronikSensorEntityDescription(
255+
key="operating_hours_heating",
256+
name="Luxtronik Heating Operating Hours",
257+
icon="mdi:radiator",
258+
native_unit_of_measurement="h",
259+
state_class=SensorStateClass.TOTAL_INCREASING,
260+
data_source="calculations",
261+
lux_index=64,
262+
value_fn=_lux_calcs.calculations[64].from_heatpump,
263+
),
264+
# Calculation index 65: Hot water operating hours (ID_WEB_Zaehler_BetrZeitBW)
265+
LuxtronikSensorEntityDescription(
266+
key="operating_hours_hot_water",
267+
name="Luxtronik Hot Water Operating Hours",
268+
icon="mdi:water-boiler",
269+
native_unit_of_measurement="h",
270+
state_class=SensorStateClass.TOTAL_INCREASING,
271+
data_source="calculations",
272+
lux_index=65,
273+
value_fn=_lux_calcs.calculations[65].from_heatpump,
274+
),
229275
)
230276

231277
# ---------------------------------------------------------------------------
@@ -234,7 +280,7 @@ class LuxtronikSensorEntityDescription(SensorEntityDescription):
234280
# These 10 indices are already covered by CORE_SENSOR_DESCRIPTIONS above.
235281
# ---------------------------------------------------------------------------
236282

237-
_CORE_CALC_INDICES: frozenset[int] = frozenset({10, 11, 15, 17, 19, 20, 39, 44, 80, 257})
283+
_CORE_CALC_INDICES: frozenset[int] = frozenset({10, 11, 15, 17, 19, 20, 39, 44, 56, 63, 64, 65, 80, 257})
238284

239285

240286
def _build_extra_calc_descriptions() -> tuple[LuxtronikSensorEntityDescription, ...]:

0 commit comments

Comments
 (0)