I have this sensor for reporting my InfluxDB database size:
- platform: influxdb
host: a0d7b954-influxdb
port: 8086
username: homeassistant
password: !secret influxdb_pssword
queries:
- name: InfluxDb DB Size
unit_of_measurement: MB
value_template: '{{ (value | float / 1024 /1024) | round(1) }}'
group_function: sum
measurement: '"monitor"."shard"'
database: _internal
where: 'time > now() - 10s'
field: diskBytes
Unfortunately when it is unavailable (once or twice a day) it reports 0
instead of unavailable
which makes graphing the minimum daily size in Grafana difficult.
Does anyone have a better approach?