From a1edaa610fb33a5374b35d5e6443d223d6f8e7e2 Mon Sep 17 00:00:00 2001 From: roberbike Date: Wed, 18 Oct 2023 23:51:46 +0200 Subject: [PATCH] Added No2 sensor --- src/cloud_anaire.cpp | 3 +++ src/cloud_hass.cpp | 3 +++ src/cloud_influxdb.cpp | 1 + 3 files changed, 7 insertions(+) diff --git a/src/cloud_anaire.cpp b/src/cloud_anaire.cpp index 393ec96d..8bc8df9e 100644 --- a/src/cloud_anaire.cpp +++ b/src/cloud_anaire.cpp @@ -41,6 +41,9 @@ void anairePublish() { doc["geo"] = cfg.geo; doc["battery"] = String(battery.getCharge()); doc["VBat"] = String(battery.getVoltage()); + doc["co"] = String(sensors.getCO()); + doc["nh3"] = String(sensors.getNH3()); + doc["no2"] = String(sensors.getNO2()); size_t n = serializeJson(doc, buffer); diff --git a/src/cloud_hass.cpp b/src/cloud_hass.cpp index ca856202..a8cd9ddd 100644 --- a/src/cloud_hass.cpp +++ b/src/cloud_hass.cpp @@ -54,6 +54,9 @@ void hassPubSensorPayload() { doc["voltage"] = String(battery.getVoltage()); doc["cpm"] = String(sensors.getGeigerCPM()); doc["usvh"] = String(sensors.getGeigerMicroSievertHour()); + doc["co"] = String(sensors.getCO()); + doc["nh3"] = String(sensors.getNH3()); + doc["no2"] = String(sensors.getNO2()); size_t n = serializeJson(doc, buffer); diff --git a/src/cloud_influxdb.cpp b/src/cloud_influxdb.cpp index 6e3113f1..aafad3be 100644 --- a/src/cloud_influxdb.cpp +++ b/src/cloud_influxdb.cpp @@ -48,6 +48,7 @@ void influxDbParseFields() { sensor.addField("gas",sensors.getGas()); sensor.addField("nh3",sensors.getNH3()); sensor.addField("co",sensors.getCO()); + sensor.addField("no2",sensors.getNO2()); sensor.addField("alt",sensors.getAltitude()); sensor.addField("cpm",sensors.getGeigerCPM()); sensor.addField("usvh",sensors.getGeigerMicroSievertHour());