pilotak / homeassistant-attributes

Breaks out specified attribute from other entities to a sensor
Apache License 2.0
101 stars 11 forks source link

Support state_class so it can be used with Long-term Statistics #44

Open danielskowronski opened 9 months ago

danielskowronski commented 9 months ago

As per https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics the state_class seems to be a requirement for exposed attributes to be covered by long-term statistics. This allows them to be rendered in Statistics graph card so it looks like Grafana without Grafana.

It should be fairly easy to pass this additional field to newly created entities.

pilotak commented 9 months ago

Happy to accept PR

hmakmur commented 6 months ago

Until there is a code change, you can easily fix this by adding entry in your customize.yaml. This is how i fixed all those other sensors that lack certain attributes I need. Example:

sensor.freezer_downstairs:
  state_class: measurement
sensor.pingdrivewaycam_round_trip_time_avg:
  state_class: measurement
sensor.motion_battery:
  state_class: measurement