Some progress.
This works in the influx container:
du -s /data/influxdb/data/homeassistant
It gives me a nice machine readable number of KB (no unit as occurs with the human readable -h option).
According to portainer the container name is
addon_a0d7b954_influxdb
However running this from the CLI
bash docker exec addon_a0d7b954_influxdb du -s /data/influxdb/data/homeassistant
Gives me a bunch of command not found errors. So it was more than a bit doubtful that this would work:
- platform: command_line
name: InfluxDB Size Test
command: "bash docker exec addon_a0d7b954_influxdb du -s /data/influxdb/data/homeassistant"
unit_of_measurement: "MB"
value_template: '{{ value / 1024 }}'
And as expected, it does not.
Command failed: bash docker exec addon_a0d7b954_influxdb du -s /data/influxdb/data/homeassistant