iotawatt-clickhouse
An IoTaWatt to ClickHouse exporter
472
An IoTaWatt to ClickHouse exporter
Python requirements are listed in requirements.txt.
Application and database configuration
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
LOG_LEVEL | str | No | INFO | Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL) |
FETCH_INTERVAL | int | No | 60 | Interval (in seconds) between fetching data from devices, >= 5 seconds |
CLICKHOUSE_URL | str | Yes | ClickHouse URL | |
CLICKHOUSE_USERNAME | str | Yes | ClickHouse login username | |
CLICKHOUSE_PASSWORD | str | Yes | ClickHouse login password | |
CLICKHOUSE_DATABASE | str | Yes | ClickHouse database name | |
CLICKHOUSE_TABLE | str | No | iotawatt | ClickHouse modem stats table name |
CLICKHOUSE_QUEUE_LIMIT | int | No | 1000 | Max number of data waiting to be inserted to ClickHouse (minimum 25) |
IoTaWatt device and channel configuration
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | IoTaWatt device name |
ip | string | Yes | IoTaWatt device IP or DNS name |
fetch_interval | int | No | Interval (in seconds) between fetching data from the device (overrides FETCH_INTERVAL environment variable), >= 5 seconds |
auto_discover_channels | boolean | Yes | Auto-discover available input/output channels. channels is ignored if true |
channels | array | No | List of channels to export. Required if auto_discover_channels is false |
channels array)| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Human-readable channel name |
id | string | Yes | Channel name on the IoTaWatt (NOT the channel number) |
type | string | Yes | Channel type: vt (voltage transformer) or ct (current transformer) |
auto_discover_channels to true in the device will cause channels to be ignoredEnvironment Variables
LOG_LEVEL=INFO
CLICKHOUSE_URL=http://10.0.0.1:8123
CLICKHOUSE_USERNAME=exporter
CLICKHOUSE_PASSWORD=hunter2
CLICKHOUSE_DATABASE=metrics
CLICKHOUSE_TABLE=iotawatt
CLICKHOUSE_QUEUE_LIMIT=5000
devices.json
[
{
"name": "IotaWatt 1",
"ip": "192.168.1.5",
"auto_discover_channels": true
},
{
"name": "IotaWatt 2",
"ip": "iotawatt2.local",
"auto_discover_channels": false,
"channels": [
{
"name": "Input 1",
"id": "Input_0",
"type": "vt"
},
{
"name": "Living Room Receptacles",
"id": "LivingRmRecept",
"type": "ct"
}
]
},
{
"name": "IotaWatt 3",
"ip": "192.168.1.6",
"auto_discover_channels": false,
"channels": [
{
"name": "Input 1",
"id": "Input_0",
"type": "vt"
},
{
"name": "Input 2",
"id": "Input_1",
"type": "vt"
},
{
"name": "Input 3",
"id": "Input_2",
"type": "vt"
},
{
"name": "Living Room Receptacles",
"id": "LivingRmRecept",
"type": "ct"
},
{
"name": "EV Charger",
"id": "EVCharger",
"type": "ct"
},
]
}
]
Content type
Image
Digest
sha256:6fab615bc…
Size
28.3 MB
Last updated
5 months ago
docker pull rafaelwastaken/iotawatt-clickhouse