Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions custom_components/dirigera_platform/base_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
UnitOfTemperature,
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONCENTRATION_PARTS_PER_MILLION,
LIGHT_LUX,
LIGHT_LUX
)

from dirigera import Hub
Expand Down Expand Up @@ -497,12 +497,11 @@ class ikea_alpstuga_co2(ikea_base_device_sensor, SensorEntity):
def __init__(self, device: ikea_vindstyrka_device) -> None:
logger.debug("ikea_alpstuga_co2 ctor...")
super().__init__(
device,
id_suffix="CO2",
device,
id_suffix="CO2",
name="CO2",
device_class=SensorDeviceClass.CO2,
native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION,
state_class="measurement")
native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To enable long-term statistics for this sensor, and allow the use of the Statistics or Statistics graph cards, can you add this property?

state_class=SensorStateClass.MEASUREMENT

(Just realized this problem is present for a bunch of other IKEA environment sensors as well -- currently the statistics card only shows the temperature sensor but not humidity etc).

@property
def native_value(self) -> int:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/dirigera_platform/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dirigera==1.2.1
dirigera==1.2.6
2 changes: 2 additions & 0 deletions custom_components/dirigera_platform/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ async def add_environment_sensors(async_add_entities, env_devices):
env_sensors.append(ikea_vindstyrka_pm25(env_device, WhichPM25.MIN))
if getattr(env_device,"voc_index", None) is not None:
env_sensors.append(ikea_vindstyrka_voc_index(env_device))
if getattr(env_device,"current_c_o2") is not None:
env_sensors.append(ikea_alpstuga_co2(env_device))
if getattr(env_device,"current_c_o2", None) is not None:
env_sensors.append(ikea_alpstuga_co2(env_device))

Expand Down