一键导入
influxdb-flux
Query and explore InfluxDB v2 using Flux, with secure credential handling and schema discovery for Home Assistant and IotaWatt data.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Query and explore InfluxDB v2 using Flux, with secure credential handling and schema discovery for Home Assistant and IotaWatt data.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Query and manage personal finances via the Actual Budget Node.js API. Use when the user asks about budget, spending, account balances, transactions, categories, rules, importing bank data, or any Actual Budget operation.
Interact with Google Workspace (Drive, Gmail, Calendar, Sheets, Docs, Tasks, Chat, Meet, Forms, Keep, Slides, People, Classroom) via the `gws` CLI. Use when the user asks about Google Drive files, sending/reading email, calendar events, spreadsheets, documents, tasks, contacts, chat, or any Google Workspace operation.
Control and query Home Assistant via its REST API. Use when the user asks about smart home devices, automations, entity states, climate control, lights, switches, sensors, scripts, scenes, or anything related to their Home Assistant instance.
Read, search, and send Telegram messages via a Telethon-based CLI. Use when the user asks about Telegram messages, chats, contacts, groups, channels, or wants to send/search/read Telegram content.
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
Use the official Logseq CLI and local HTTP API server to query, search, and append to the currently open Logseq graph. Use for Logseq pages, blocks, tasks, graph queries, and Pi Agent notes.
| name | influxdb-flux |
| description | Query and explore InfluxDB v2 using Flux, with secure credential handling and schema discovery for Home Assistant and IotaWatt data. |
Use this skill when the user asks to query, explore, or analyze data in InfluxDB v2 with Flux, especially for Home Assistant (homeassistant) and IotaWatt (iotawatt) buckets.
Always use environment variables first:
INFLUXDB_URLINFLUXDB_ORGINFLUXDB_TOKENIf one or more are missing, prompt the user for the missing values before running queries.
Security rules:
Defaults in this environment (use only if env vars are unset and user approves):
https://influx.petrovic.network71d6d270b25881e5homeassistant, iotawattAustralia/SydneyPrefer InfluxDB HTTP API calls if influx CLI is unavailable.
HTTP API query pattern:
curl -sS "$INFLUXDB_URL/api/v2/query?org=$INFLUXDB_ORG" \
-H "Authorization: Token $INFLUXDB_TOKEN" \
-H "Accept: application/csv" \
-H "Content-type: application/vnd.flux" \
--data-binary '<FLUX_QUERY>'
CLI pattern (if installed):
INFLUX_HOST="$INFLUXDB_URL" \
INFLUX_ORG="$INFLUXDB_ORG" \
influx query --token "$INFLUXDB_TOKEN" --file <query.flux>
INFLUXDB_URL, INFLUXDB_ORG, INFLUXDB_TOKEN).This section reflects discovered structure from your live instance and should be used to accelerate queries.
homeassistantiotawatthomeassistant bucketObserved measurement pattern:
kWh, W, kW, V, A, °C, %, hPa, AUD, AUD/kWh, Wh, VA, var, mm, km/h, UV index, etc.Observed tags for sampled measurements (kWh, °C):
domainentity_idfriendly_namesourceObserved field-key behavior:
_str variants._field == "value" for Home Assistant.iotawatt bucketObserved measurements:
AirConditionerBranchGridA_VGridB_VGridC_VGridImportKitchenLaundryLightsGPOPoolServerSolarA_PFSolarB_PFSolarC_PFSolarExportSolarGenerationTeslaObserved tag keys:
devicenameunitObserved field keys:
value (single canonical field)Observed unit tag values:
WattsWhVoltsPFInterpretation:
value and semantic context in tags.unit when mixing measurements to avoid unit-confused aggregations.When user asks arbitrary questions, run this flow first (per bucket):
import "influxdata/influxdb/schema"
schema.measurements(bucket: "homeassistant", start: -365d)
Repeat for iotawatt.
import "influxdata/influxdb/schema"
schema.tagKeys(
bucket: "homeassistant",
predicate: (r) => r._measurement == "<measurement>",
start: -365d,
)
import "influxdata/influxdb/schema"
schema.fieldKeys(
bucket: "homeassistant",
predicate: (r) => r._measurement == "<measurement>",
start: -365d,
)
from(bucket: "homeassistant")
|> range(start: -24h)
|> filter(fn: (r) => r._measurement == "<measurement>")
|> limit(n: 20)
import "influxdata/influxdb/schema"
schema.tagValues(
bucket: "homeassistant",
tag: "entity_id",
predicate: (r) => r._measurement == "<measurement>",
start: -365d,
)
kWh, W, °C).entity_id and/or friendly_name early._field choices before aggregation due to mixed field naming._field is usually value._measurement for circuit/channel selection.unit tag as a guardrail (Watts for power, Wh for energy, etc.).Use UTC for raw storage semantics, but apply Australia/Sydney for user-facing daily/hourly grouping and reporting periods where appropriate.
For daily windows, be explicit and note timezone assumptions in results.
range() tightly first, then widen as needed._measurement early.aggregateWindow() for rollups (e.g. 1m, 15m, 1h, 1d).createEmpty: false unless gaps are explicitly needed.When answering user questions:
start window (e.g. -365d).range() first.Assume two primary buckets exist:
homeassistantiotawattUse the known dataset shape above as a starting point, but verify with schema queries before making strict assumptions in user-facing analysis.