diff --git a/homeassistant/components/landisgyr_heat_meter/const.py b/homeassistant/components/landisgyr_heat_meter/const.py index 55a6c65892c..57a8f9d9be4 100644 --- a/homeassistant/components/landisgyr_heat_meter/const.py +++ b/homeassistant/components/landisgyr_heat_meter/const.py @@ -44,6 +44,14 @@ HEAT_METER_SENSOR_TYPES = ( native_unit_of_measurement=ENERGY_MEGA_WATT_HOUR, entity_category=EntityCategory.DIAGNOSTIC, ), + # Diagnostic entity for debugging, this will match the value in GJ of previous year indicated on the meter's display + SensorEntityDescription( + key="heat_previous_year_gj", + icon="mdi:fire", + name="Heat previous year GJ", + native_unit_of_measurement="GJ", + entity_category=EntityCategory.DIAGNOSTIC, + ), SensorEntityDescription( key="volume_previous_year_m3", icon="mdi:fire", diff --git a/tests/components/landisgyr_heat_meter/test_sensor.py b/tests/components/landisgyr_heat_meter/test_sensor.py index 505efb446b8..1a068093d0e 100644 --- a/tests/components/landisgyr_heat_meter/test_sensor.py +++ b/tests/components/landisgyr_heat_meter/test_sensor.py @@ -76,7 +76,7 @@ async def test_create_sensors(mock_heat_meter, hass): await hass.async_block_till_done() # check if 26 attributes have been created - assert len(hass.states.async_all()) == 26 + assert len(hass.states.async_all()) == 27 entity_reg = entity_registry.async_get(hass) state = hass.states.get("sensor.heat_meter_heat_usage")