From d80e3a928d72faa3cafea505638cae1a7ab507a6 Mon Sep 17 00:00:00 2001 From: ascillato Date: Tue, 12 Jun 2018 14:46:52 -0300 Subject: [PATCH] KNX: Support for DS18S20 Temperature sensor --- sonoff/xsns_05_ds18b20.ino | 5 +++++ sonoff/xsns_05_ds18x20.ino | 5 +++++ sonoff/xsns_05_ds18x20_legacy.ino | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/sonoff/xsns_05_ds18b20.ino b/sonoff/xsns_05_ds18b20.ino index 753fafeca..dabaf25d4 100644 --- a/sonoff/xsns_05_ds18b20.ino +++ b/sonoff/xsns_05_ds18b20.ino @@ -199,6 +199,11 @@ void Ds18b20Show(boolean json) #ifdef USE_DOMOTICZ if (0 == tele_period) DomoticzSensor(DZ_TEMP, temperature); #endif // USE_DOMOTICZ +#ifdef USE_KNX + if (0 == tele_period) { + KnxSensor(KNX_TEMPERATURE, t); + } +#endif // USE_KNX #ifdef USE_WEBSERVER } else { snprintf_P(mqtt_data, sizeof(mqtt_data), HTTP_SNS_TEMP, mqtt_data, "DS18B20", temperature, TempUnit()); diff --git a/sonoff/xsns_05_ds18x20.ino b/sonoff/xsns_05_ds18x20.ino index b99c71298..292191b18 100644 --- a/sonoff/xsns_05_ds18x20.ino +++ b/sonoff/xsns_05_ds18x20.ino @@ -385,6 +385,11 @@ void Ds18x20Show(boolean json) domoticz_flag = false; } #endif // USE_DOMOTICZ +#ifdef USE_KNX + if ((0 == tele_period) && (0 == i)) { + KnxSensor(KNX_TEMPERATURE, t); + } +#endif // USE_KNX #ifdef USE_WEBSERVER } else { snprintf_P(mqtt_data, sizeof(mqtt_data), HTTP_SNS_TEMP, mqtt_data, (1 == ds18x20_sensors) ? ds18x20_types : stemp, temperature, TempUnit()); diff --git a/sonoff/xsns_05_ds18x20_legacy.ino b/sonoff/xsns_05_ds18x20_legacy.ino index 885ce7540..156312104 100644 --- a/sonoff/xsns_05_ds18x20_legacy.ino +++ b/sonoff/xsns_05_ds18x20_legacy.ino @@ -192,6 +192,11 @@ void Ds18x20Show(boolean json) DomoticzSensor(DZ_TEMP, temperature); } #endif // USE_DOMOTICZ +#ifdef USE_KNX + if ((0 == tele_period) && (1 == dsxflg)) { + KnxSensor(KNX_TEMPERATURE, t); + } +#endif // USE_KNX #ifdef USE_WEBSERVER } else { snprintf_P(stemp, sizeof(stemp), PSTR("%s-%d"), ds18x20_types, i +1);