From 4c8b87c67b233c5b9690f3c0f5d0a16259738f84 Mon Sep 17 00:00:00 2001 From: Emmanuel Lacour Date: Sun, 4 Dec 2022 12:04:27 +0100 Subject: [PATCH] Add heater sensors --- garage/garage.ino | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) 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)); -- 2.11.0