From fa8643012dbb88f12bfea92ab8829b084bc8d34b Mon Sep 17 00:00:00 2001 From: hk2k2 <70974088+hk2k2@users.noreply.github.com> Date: Tue, 6 Jul 2021 00:07:09 +0200 Subject: [PATCH 1/4] Update xsns_35_tx20.ino Extended tx20.ino for supporting Technoline WS2300-15 Anemometer. This Model is very similar to TX20 - but use a slightly different Datagram. use it with #ifdef USE_WS2300_WIND_SENSOR -> choose only one of them (TX20 || TX23 || WS2300-15) Usage is the same as TX20/23, values are proofed with original Weather Station from Technoline. Sorry for my Code.. was try and error some hours to get it working with the #ifdef stuff.. Documentation Update follows soon.. --- tasmota/xsns_35_tx20.ino | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/tasmota/xsns_35_tx20.ino b/tasmota/xsns_35_tx20.ino index f1594c4c3..3e1cfd25b 100644 --- a/tasmota/xsns_35_tx20.ino +++ b/tasmota/xsns_35_tx20.ino @@ -17,7 +17,7 @@ along with this program. If not, see . */ -#if defined(USE_TX20_WIND_SENSOR) || defined(USE_TX23_WIND_SENSOR) +#if defined(USE_TX20_WIND_SENSOR) || defined(USE_TX23_WIND_SENSOR) || defined(USE_WS2300_WIND_SENSOR) /*********************************************************************************************\ * La Crosse TX20/TX23 Anemometer @@ -55,6 +55,16 @@ #warning **** use USE_TX20_WIND_SENSOR or USE_TX23_WIND_SENSOR but not both together, TX20 disabled **** #endif // USE_TX20_WIND_SENSOR && USE_TX23_WIND_SENSOR +#if defined(USE_WS2300_WIND_SENSOR) && defined(USE_TX23_WIND_SENSOR) +#undef USE_WS2300_WIND_SENSOR +#warning **** use USE_WS2300_WIND_SENSOR or USE_TX23_WIND_SENSOR but not both together, WS2300 disabled **** +#endif // USE_TX20_WIND_SENSOR && USE_TX23_WIND_SENSOR + +#if defined(USE_WS2300_WIND_SENSOR) && defined(USE_TX20_WIND_SENSOR) +#undef USE_WS2300_WIND_SENSOR +#warning **** use USE_WS2300_WIND_SENSOR or USE_TX20_WIND_SENSOR but not both together, WS2300 disabled **** +#endif // USE_TX20_WIND_SENSOR && USE_TX23_WIND_SENSOR + // #define USE_TX2X_WIND_SENSOR_NOSTATISTICS // suppress statistics (speed/dir avg/min/max/range) #define TX2X_BIT_TIME 1220 // microseconds #define TX2X_WEIGHT_AVG_SAMPLE 150 // seconds @@ -70,9 +80,14 @@ extern "C" { #ifdef USE_TX20_WIND_SENSOR #undef D_TX2x_NAME #define D_TX2x_NAME "TX20" -#else // USE_TX20_WIND_SENSOR +#endif +#ifdef USE_TX23_WIND_SENSOR // USE_TX23_WIND_SENSOR #undef D_TX2x_NAME #define D_TX2x_NAME "TX23" +#endif +#ifdef USE_WS2300_WIND_SENSOR // USE_WS2300_WIND_SENSOR +#undef D_TX2x_NAME +#define D_TX2x_NAME "WS2300-15" #endif // USE_TX20_WIND_SENSOR #ifdef USE_WEBSERVER @@ -236,7 +251,14 @@ void IRAM_ATTR TX2xStartRead(void) #ifdef USE_TX23_WIND_SENSOR if ((chk == tx2x_sd) && (0x1b==tx2x_sa) && (tx2x_sb==tx2x_se) && (tx2x_sc==tx2x_sf) && (tx2x_sc < 511)) { #else - if ((chk == tx2x_sd) && (tx2x_sb==tx2x_se) && (tx2x_sc==tx2x_sf) && (tx2x_sc < 511)) { + if + #ifdef USE_TX20_WIND_SENSOR + ((chk == tx2x_sd) && (tx2x_sb==tx2x_se) && (tx2x_sc==tx2x_sf) && (tx2x_sc < 511)) + #endif + #ifdef USE_WS2300_WIND_SENSOR + ((chk == tx2x_sd) && (tx2x_sc < 511)) + #endif + { #endif tx2x_last_available = TasmotaGlobal.uptime; // Wind speed spec: 0 to 180 km/h (0 to 50 m/s) @@ -590,4 +612,4 @@ bool Xsns35(uint8_t function) return result; } -#endif // USE_TX20_WIND_SENSOR || USE_TX23_WIND_SENSOR \ No newline at end of file +#endif // USE_TX20_WIND_SENSOR || USE_TX23_WIND_SENSOR From a268e11680118e29af82039cdc4e21c74b99dc80 Mon Sep 17 00:00:00 2001 From: hk2k2 <70974088+hk2k2@users.noreply.github.com> Date: Sun, 11 Jul 2021 16:44:56 +0200 Subject: [PATCH 2/4] Update support_features.ino --- tasmota/support_features.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/support_features.ino b/tasmota/support_features.ino index aff6030e3..661315c00 100644 --- a/tasmota/support_features.ino +++ b/tasmota/support_features.ino @@ -364,7 +364,7 @@ void ResponseAppendFeatures(void) #if defined(USE_ENERGY_SENSOR) && defined(USE_PZEM_DC) feature4 |= 0x00001000; // xnrg_06_pzem_dc.ino #endif -#if defined(USE_TX20_WIND_SENSOR) || defined(USE_TX23_WIND_SENSOR) +#if defined(USE_TX20_WIND_SENSOR) || defined(USE_TX23_WIND_SENSOR) || defined(USE_WS2300_WIND_SENSOR) feature4 |= 0x00002000; // xsns_35_tx20.ino #endif #if defined(USE_I2C) && defined(USE_MGC3130) From 11ffd24d7551a8f33e6465054ff471e0a3b55547 Mon Sep 17 00:00:00 2001 From: hk2k2 <70974088+hk2k2@users.noreply.github.com> Date: Sun, 11 Jul 2021 16:46:20 +0200 Subject: [PATCH 3/4] Update tasmota_template.h --- tasmota/tasmota_template.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index c7b901e26..d9beffa07 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -740,7 +740,7 @@ const uint16_t kGpioNiceList[] PROGMEM = { AGPIO(GPIO_PMS5003_TX), // Plantower PMS5003 Serial interface AGPIO(GPIO_PMS5003_RX), // Plantower PMS5003 Serial interface #endif -#if defined(USE_TX20_WIND_SENSOR) || defined(USE_TX23_WIND_SENSOR) +#if defined(USE_TX20_WIND_SENSOR) || defined(USE_TX23_WIND_SENSOR) || defined(USE_WS2300_WIND_SENSOR) AGPIO(GPIO_TX2X_TXD_BLACK), // TX20/TX23 Transmission Pin #endif #ifdef USE_WINDMETER