diff --git a/platformio.ini b/platformio.ini index 42c56ea0..0090b10d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -32,23 +32,24 @@ lib_deps = bblanchon/ArduinoJson @ 6.19.4 chrisjoyce911/esp32FOTA @ 0.1.6 ; hpsaturn/CanAirIO Air Quality Sensors Library @ 0.5.4 - adafruit/Adafruit Unified Sensor @ 1.1.5 - adafruit/Adafruit BME280 Library @ 2.2.2 - adafruit/Adafruit BMP280 Library @ 2.6.2 - adafruit/Adafruit BME680 Library @ 2.0.2 - adafruit/Adafruit BusIO @ 1.11.6 - adafruit/Adafruit SHT31 Library @ 2.1.0 - robtillaart/AM232X @ 0.4.1 - enjoyneering/AHT10 @ 1.1.0 - paulvha/sps30 @ 1.4.12 - wifwaf/MH-Z19 @ 1.5.3 - sparkfun/SparkFun SCD30 Arduino Library @ 1.0.17 - sensirion/Sensirion Core @ 0.5.3 - sensirion/Sensirion I2C SCD4x @ 0.3.1 - https://github.com/hpsaturn/DHT_nonblocking.git - https://github.com/paulvha/SN-GCJA5.git - https://github.com/jcomas/S8_UART.git - https://github.com/jcomas/CM1106_UART.git + https://github.com/iw2lsi/canairio_sensorlib.git + ; adafruit/Adafruit Unified Sensor @ 1.1.5 + ; adafruit/Adafruit BME280 Library @ 2.2.2 + ; adafruit/Adafruit BMP280 Library @ 2.6.2 + ; adafruit/Adafruit BME680 Library @ 2.0.2 + ; adafruit/Adafruit BusIO @ 1.11.6 + ; adafruit/Adafruit SHT31 Library @ 2.1.0 + ; robtillaart/AM232X @ 0.4.1 + ; enjoyneering/AHT10 @ 1.1.0 + ; paulvha/sps30 @ 1.4.12 + ; wifwaf/MH-Z19 @ 1.5.3 + ; sparkfun/SparkFun SCD30 Arduino Library @ 1.0.17 + ; sensirion/Sensirion Core @ 0.5.3 + ; sensirion/Sensirion I2C SCD4x @ 0.3.1 + ; https://github.com/hpsaturn/DHT_nonblocking.git + ; https://github.com/paulvha/SN-GCJA5.git + ; https://github.com/jcomas/S8_UART.git + ; https://github.com/jcomas/CM1106_UART.git https://github.com/256dpi/arduino-mqtt.git https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino.git diff --git a/src/cloud_hass.cpp b/src/cloud_hass.cpp index 26afa440..e4920e6d 100644 --- a/src/cloud_hass.cpp +++ b/src/cloud_hass.cpp @@ -53,6 +53,11 @@ void hassPubSensorPayload() { doc["battery"] = String(battery.getCharge()); doc["voltage"] = String(battery.getVoltage()); +#ifdef CAJOE_GEIGER + doc["geiger_cpm"] = String(sensors.getGeigerCPM()); + doc["geiger_usvh"] = String(sensors.getGeigerMicroSievertHour()); +#endif + size_t n = serializeJson(doc, buffer); if (clientHass.publish(getStateTopic().c_str(), buffer, n)) { @@ -96,6 +101,11 @@ bool hassRegisterSensors() { hassConfigured = publishDiscoveryPayload("pressure", "pressure", "hPa"); hassConfigured = publishDiscoveryPayload("battery", "battery", "%"); +#ifdef CAJOE_GEIGER // WARNING! I'm not sure about this fields! + hassConfigured = publishDiscoveryPayload("geiger_cpm", "geiger_cpm", "cpm"); + hassConfigured = publishDiscoveryPayload("geiger_usvh", "geiger_usvh", "uSv/h"); +#endif + if (hassConfigured) Serial.printf("-->[MQTT] Hass device registered\t: %s\n",getHostId().c_str()); else Serial.printf("[E][MQTT] Hass not configured yet\t: device: %s\n",getHostId().c_str());