So I finally got Openwrt(collectd) → Telegraf → Influxdb v2 working so now I am trying to pull this data over to HA.
This is my flux query for “Uptime” on router…
queries_flux:
- name: "Openwrt Uptime"
range_start: "-1h"
#unit_of_measurement:
#value_template: "{{ (value|float / 100.0)|round(2) }}"
query: >
filter(fn: (r) => r["_measurement"] == "uptime_value")
|> filter(fn: (r) => r["_field"] == "value")
|> filter(fn: (r) => r["bucket"] == "collectd")
|> filter(fn: (r) => r["host"] == "OpenWrt")
|> filter(fn: (r) => r["type"] == "uptime")
|> last(column: "_value")
|> keep(columns: ["_value"])
How do I convert the value it pulls in to actual days/hours/min/sec?