From f9103ecdc8a587183aed53c9b99e996dd46e663e Mon Sep 17 00:00:00 2001 From: Fisch Date: Sun, 1 Nov 2020 13:14:38 +0100 Subject: [PATCH] change outdoor sensoresp0 to less send sensitive light --- platformio.ini | 7 ++++--- src/main.cpp | 11 +++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/platformio.ini b/platformio.ini index 0e641cb..48610f0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -34,7 +34,8 @@ build_flags = -D dataBMP180_pressure_minchange=0.5 -D SENSOR_TCS34725 - -D dataTCS34725_lux_minchange=10 + -D dataTCS34725_lux_minchange=500 + -D dataTCS34725_lux_senddelaymax=1000*60*1 -D dataTCS34725_colortemp_minchange=100 -D SENSOR_HS1101 @@ -43,7 +44,7 @@ build_flags = -D SENSOR_ML8511 -D ML8511PIN=A0 - -D dataML8511_minchange=0.05 + -D dataML8511_minchange=0.2 -D SENSOR_ANEMOMETER -D ANEMOMETERPIN=D6 #Light Blue thicker cable (in distribution box) @@ -71,7 +72,7 @@ build_flags = -D SENSOR_DHT22 -D DHTPIN=D7 -D dataDHT22_temperature_minchange=0.2 - -D dataDHT22_humidity_minchange=1.0 + -D dataDHT22_humidity_minchange=2.0 -D SENSOR_BMP180 -D dataBMP180_temperature_minchange=0.2 diff --git a/src/main.cpp b/src/main.cpp index ff2c9e3..4d8a2b1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -358,6 +358,9 @@ void setup() { #ifdef dataTCS34725_lux_minchange dataTCS34725_lux.minchange=dataTCS34725_lux_minchange; #endif + #ifdef dataTCS34725_lux_senddelaymax + dataTCS34725_lux.senddelaymax=dataTCS34725_lux_senddelaymax; + #endif #ifdef dataTCS34725_colortemp_minchange dataTCS34725_colortemp.minchange=dataTCS34725_colortemp_minchange; #endif @@ -912,9 +915,13 @@ void loop_TCS34725_colortemp() Homie.getLogger() << "colortemp tcs " << ": " << value_colortemp << endl; if (tcs.lux>=TCS34725_MINLUXFORCT) { - sensorNode.setProperty("colortemp").send(String(value_colortemp)); + if (value_colortemp > 1) { + sensorNode.setProperty("colortemp").send(String(value_colortemp)); + }else{ + Homie.getLogger() << "didn't send tcs ct because value is too low" << endl; + } }else{ - Homie.getLogger() << "didn't send tcs because light too low: " << tcs.lux << "lux" << endl; + Homie.getLogger() << "didn't send tcs ct because light too low: " << tcs.lux << "lux" << endl; } d.lastsentvalue=value_colortemp;