projects
/
manu
/
arduino-maison.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4c8b87c
)
Use sensors adresses
author
Emmanuel Lacour
<elacour@easter-eggs.com>
Sun, 4 Dec 2022 13:48:03 +0000
(14:48 +0100)
committer
Emmanuel Lacour
<elacour@easter-eggs.com>
Sun, 4 Dec 2022 13:48:03 +0000
(14:48 +0100)
garage/garage.ino
patch
|
blob
|
history
diff --git
a/garage/garage.ino
b/garage/garage.ino
index
9a663f5
..
9fba061
100644
(file)
--- a/
garage/garage.ino
+++ b/
garage/garage.ino
@@
-27,6
+27,10
@@
WiFiUDP Udp;
// GPIO where the DS18B20 is connected to
const int oneWireBus = 19;
// Setup a oneWire instance to communicate with any OneWire devices
// GPIO where the DS18B20 is connected to
const int oneWireBus = 19;
// Setup a oneWire instance to communicate with any OneWire devices
+// ROM = 28 31 A7 1D 13 21 1 F6 ROM = 28 15 8E 4B 13 21 1 46
+DeviceAddress sensor_heater_out = {0x28, 0x31, 0xA7, 0x1D, 0x13, 0x21, 0x01, 0xF6};
+DeviceAddress sensor_serre = {0x28, 0x15, 0x8E, 0x4B, 0x13, 0x21, 0x01, 0x46};
+//DeviceAddress sensor_heater_in = {0x28, 0x31, 0xA7, 0x1D, 0x13, 0x21, 0x01, 0xF6};
OneWire oneWire(oneWireBus);
// Pass our oneWire reference to Dallas Temperature sensor
DallasTemperature sensors(&oneWire);
OneWire oneWire(oneWireBus);
// Pass our oneWire reference to Dallas Temperature sensor
DallasTemperature sensors(&oneWire);
@@
-100,14
+104,14
@@
void loop() {
Serial.println("DEBUG wifi connected, start temp measure");
sensors.requestTemperatures();
Serial.println("DEBUG wifi connected, start temp measure");
sensors.requestTemperatures();
- float
tempC = sensors.getTempCByIndex(1
);
- float heater_out_tempC = sensors.getTempC
ByIndex(0
);
-
float heater_in_tempC = sensors.getTempCByIndex(2
);
+ float
serre_tempC = sensors.getTempC(sensor_serre
);
+ float heater_out_tempC = sensors.getTempC
(sensor_heater_out
);
+
// float heater_in_tempC = sensors.getTempC(sensor_heater_in
);
- if(tempC == DEVICE_DISCONNECTED_C) {
+ if(
serre_
tempC == DEVICE_DISCONNECTED_C) {
// Error
} else {
// Error
} else {
- sendToInfluxDB("temperature,city="+city+",location=serre_semis", "value", String(tempC));
+ sendToInfluxDB("temperature,city="+city+",location=serre_semis", "value", String(
serre_
tempC));
}
if(heater_out_tempC == DEVICE_DISCONNECTED_C) {
}
if(heater_out_tempC == DEVICE_DISCONNECTED_C) {
@@
-116,17
+120,11
@@
void loop() {
sendToInfluxDB("temperature,city="+city+",location=heater,direction=out", "value", String(heater_out_tempC));
}
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));
- }
+ //if(heater_in_tempC == DEVICE_DISCONNECTED_C) {
+ // // Error
+ //} else {
+ // sendToInfluxDB("temperature,city="+city+",location=heater,direction=in", "value", String(heater_in_tempC));
+ //}
sendToInfluxDB("teleinfo,city="+city+",location="+location, "SINSTS", tinfo_SINSTS);
sendToInfluxDB("teleinfo,city="+city+",location="+location, "SINSTS1", tinfo_SINSTS1);
sendToInfluxDB("teleinfo,city="+city+",location="+location, "SINSTS", tinfo_SINSTS);
sendToInfluxDB("teleinfo,city="+city+",location="+location, "SINSTS1", tinfo_SINSTS1);