ualex73 / monitor_docker

Monitor Docker containers from Home Assistant
Apache License 2.0
301 stars 37 forks source link

Add state_class to sensor entities #132

Closed khase closed 6 months ago

khase commented 1 year 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 10 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 6 months ago

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

jokkling commented 6 months ago

Great job. Thank you!

IngmarStein commented 1 week ago

Was this only done for container metrics, but not Docker metrics? I still see the following with 1.19:

Bildschirmfoto 2024-11-11 um 17 12 37

I would have expected a time series chart like for memory consumption.