From: Emmanuel Lacour Date: Sun, 4 Dec 2022 11:04:27 +0000 (+0100) Subject: Add heater sensors X-Git-Url: http://git.home-dn.net/?p=manu%2Farduino-maison.git;a=commitdiff_plain;h=4c8b87c67b233c5b9690f3c0f5d0a16259738f84 Add heater sensors --- diff --git a/garage/garage.ino b/garage/garage.ino index 44f2c49..9a663f5 100644 --- a/garage/garage.ino +++ b/garage/garage.ino @@ -100,9 +100,29 @@ void loop() { Serial.println("DEBUG wifi connected, start temp measure"); sensors.requestTemperatures(); - float tempC = sensors.getTempCByIndex(0); + float tempC = sensors.getTempCByIndex(1); + float heater_out_tempC = sensors.getTempCByIndex(0); + float heater_in_tempC = sensors.getTempCByIndex(2); - if(tempC == DEVICE_DISCONNECTED_C) + if(tempC == DEVICE_DISCONNECTED_C) { + // Error + } else { + sendToInfluxDB("temperature,city="+city+",location=serre_semis", "value", String(tempC)); + } + + if(heater_out_tempC == DEVICE_DISCONNECTED_C) { + // Error + } else { + sendToInfluxDB("temperature,city="+city+",location=heater,direction=out", "value", String(heater_out_tempC)); + } + + if(heater_in_tempC == DEVICE_DISCONNECTED_C) { + // Error + } else { + sendToInfluxDB("temperature,city="+city+",location=heater,direction=in", "value", String(heater_in_tempC)); + } + + if(tempC == DEVICE_DISCONNECTED_C) { // Error } else { sendToInfluxDB("temperature,city="+city+",location=serre_semis", "value", String(tempC));