Sanderhuisman / home-assistant-custom-components

🏡 Custom components for Home-Assistant
https://www.home-assistant.io/
Apache License 2.0
33 stars 12 forks source link

Remove not relevant attributes from sensor (saves a lot of storage) #3

Closed ualex73 closed 5 years ago

ualex73 commented 5 years ago

Currently every sensor has Created, Online CPU, Started At, etc ... This is nice, but it causes also a lot of data overhead when stored in the record/influxdb. An influxdb record for the cpu usage looks like:

%,domain=sensor,entity_id=docker_appdaemon_cpu_use Created=20181216111533.04,Created_str="2018-12-16T11:15:33.039313+01:00",Online_CPUs=2,Started_at=20190112154737.97,Started_at_str="2019-01-12 15:47:37.969371+00:00",attribution_str="Data provided by Docker",friendly_name_str="Docker appdaemon CPU use",icon_str="mdi:chip",value=0.28 1548511255488423936

It is best to add as minimal attributes as possible.

Sanderhuisman commented 5 years ago

Hi Alexander,

I wasn't aware of all the attributes being stored in InfluxDB, I will reduce them during the week, You can disable them yourself in the sensor/docker_monitor.py by deleting lines 186-199 in the master release (you will find them by self._attributes)

ualex73 commented 5 years ago

Thanks 👍I believe they are also stored in the recorder/history of Home-Assistant, only that's more work for me to get a nice example.

Sanderhuisman commented 5 years ago

I reduced the amount of attributes in the master branch.