summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-10-06 19:17:39 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-10-06 19:17:39 +0200
commit992770b4e0220f9b391c7f45294c41ed320919a4 (patch)
treec34ba4c339185eb29ed8f5a0d8f25f4b222ff0a8 /README.md
parent6b94484c088e030cb63557af292fe0429e21f591 (diff)
Make MQTT integration optionalmain
Diffstat (limited to 'README.md')
-rw-r--r--README.md16
1 files changed, 6 insertions, 10 deletions
diff --git a/README.md b/README.md
index 4fa8b73..a1c2485 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,8 @@ Most practical applications (such as the example in init.lua) also need the
following modules.
* gpio
-* mqtt
+* http (for InfluxDB integration)
+* mqtt (for HomeAssistant / MQTT integration)
* node
* softuart
* tmr
@@ -102,23 +103,18 @@ If desired, **sds011.lua** can be used to configure the SDS011 sensor.
## Application Example
-**init.lua** is an example application with HomeAssistant integration.
-To use it, you need to create a **config.lua** file with WiFI and MQTT settings:
+**init.lua** is an example application with optional HomeAssistant and InfluxDB integration.
+To use it, you need to create a **config.lua** file with WiFI and MQTT/InfluxDB settings:
```lua
station_cfg = {ssid = "...", pwd = "..."}
mqtt_host = "..."
-```
-
-Optionally, it can also publish readings to InfluxDB.
-To do so, configure URL and attribute:
-
-```lua
influx_url = "..."
influx_attr = "..."
```
-Readings will be published as `sds011[influx_attr] pm2_5_ugm3=%d.%01d,pm10_ugm3=%d.%01d`.
+Both `mqtt_host` and `influx_url` are optional, though it does not make much sense to specify neither.
+InfluxDB readings will be published as `sds011[influx_attr] pm2_5_ugm3=%d.%01d,pm10_ugm3=%d.%01d`.
So, unless `influx_attr = ''`, it must start with a comma, e.g. `influx_attr = ',device=' .. device_id`.
## Images