ualex73 / monitor_docker

Monitor Docker containers from Home Assistant
Apache License 2.0
267 stars 34 forks source link

Add state_class to sensor entities #132

Closed khase closed 1 month ago

khase commented 9 months ago

Hi,

would it be possible to add a state_class to the sensor entities? This change would enable the usage of the statistics cards.

Currently i add the fields using the customization.yaml

The default state_class would be measurement to tell homeassistant to gather the metric values (min/max/average). For the total uplaod and download sensors i set the state_class to total_increasing which enables the usage of the changed metric.

Further documentation can be found here: https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics.

Thank you for your work :+1:

jokkling commented 5 months ago

This would be awesome. If the only change it takes to use the statistics card is this, then I would ditch Grafana and only use HA for monitor my Docker environment.

ualex73 commented 1 month ago

This has been added in v1.15, so I will close this ticket.

jokkling commented 1 month ago

Great job. Thank you!