diff --git a/BUILDS.md b/BUILDS.md index 18d0ab9ad..700407907 100644 --- a/BUILDS.md +++ b/BUILDS.md @@ -77,6 +77,7 @@ | USE_MAX31855 | - | - | - | - | x | - | - | | USE_MAX31865 | - | - | - | - | - | - | - | | USE_THERMOSTAT | - | - | - | - | - | - | - | +| USE_LMT01 | - | - | - | - | x | - | - | | | | | | | | | | | Feature or Sensor | minimal | lite | tasmota | knx | sensors | ir | display | Remarks | USE_I2C | - | - | x | x | x | - | x | diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 235d6de6d..193cc1ca9 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -84,3 +84,4 @@ The following binary downloads have been compiled with ESP8266/Arduino library c - Add support for Energy sensor (Denky) for French Smart Metering meter provided by global Energy Providers, need a adaptater. See dedicated full [blog](http://hallard.me/category/tinfo/) about French teleinformation stuff - Add Library to be used for decoding Teleinfo (French Metering Smart Meter) - Add basic support for ESP32 ethernet adding commands ``Wifi 0/1`` and ``Ethernet 0/1`` both default ON +- Add support for single wire LMT01 temperature Sensor by justifiably (#8713) diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index 23dd2be10..846088f6a 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -4,8 +4,8 @@ - Add command ``Module2`` to configure fallback module on fast reboot (#8464) - Add support for Energy sensor (Denky) for French Smart Metering meter provided by global Energy Providers, need a adaptater. See dedicated full [blog](http://hallard.me/category/tinfo/) about French teleinformation stuff -- Add Library to be used for decoding Teleinfo (French Metering Smart Meter) - +- Add library to be used for decoding Teleinfo (French Metering Smart Meter) +- Add support for single wire LMT01 temperature Sensor by justifiably (#8713) ### 8.3.1.5 20200616 diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index 42cf596bd..b5b0e7cb0 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -635,7 +635,7 @@ #define MAX31865_PTD_RES 100 // Nominal PTD resistance at 0°C (100Ω for a PT100, 1000Ω for a PT1000, YMMV!) #define MAX31865_REF_RES 430 // Reference resistor (Usually 430Ω for a PT100, 4300Ω for a PT1000) #define MAX31865_PTD_BIAS 0 // To calibrate your not-so-good PTD -//#define USE_LMT01 // Add support for TI LMT01 temperature sensor, count pulses on single GPIO (+0k5 code) +//#define USE_LMT01 // Add support for TI LMT01 temperature sensor, count pulses on single GPIO (+0k5 code) // -- IR Remote features - all protocols from IRremoteESP8266 -------------------------- // IR Full Protocols mode is activated through platform.io only. diff --git a/tasmota/support_features.ino b/tasmota/support_features.ino index 5e582b0f9..248de8e84 100644 --- a/tasmota/support_features.ino +++ b/tasmota/support_features.ino @@ -587,8 +587,9 @@ void GetFeatures(void) #ifdef USE_TELEINFO feature6 |= 0x00040000; // xnrg_15_teleinfo.ino #endif - -// feature6 |= 0x00080000; +#ifdef USE_LMT01 + feature6 |= 0x00080000; // xsns_74_lmt01.ino +#endif // feature6 |= 0x00100000; // feature6 |= 0x00200000; diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index 30a3d9d90..7f65163f7 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -452,6 +452,9 @@ const uint8_t kGpioNiceList[] PROGMEM = { GPIO_DSB, // Single wire DS18B20 or DS18S20 GPIO_DSB_OUT, // Pseudo Single wire DS18B20 or DS18S20 #endif +#ifdef USE_LMT01 // LMT01, count pulses on GPIO + GPIO_LMT01, +#endif // Light #ifdef USE_LIGHT @@ -698,9 +701,6 @@ const uint8_t kGpioNiceList[] PROGMEM = { GPIO_TELEINFO_RX, GPIO_TELEINFO_ENABLE, #endif -#ifdef USE_LMT01 // LMT01, count pulses on GPIO - GPIO_LMT01, -#endif }; /********************************************************************************************/ diff --git a/tasmota/tasmota_template_ESP32.h b/tasmota/tasmota_template_ESP32.h index 9a67d6d02..50686c741 100644 --- a/tasmota/tasmota_template_ESP32.h +++ b/tasmota/tasmota_template_ESP32.h @@ -133,7 +133,7 @@ enum UserSelectablePins { GPIO_ETH_PHY_POWER, GPIO_ETH_PHY_MDC, GPIO_ETH_PHY_MDIO, // Ethernet GPIO_TELEINFO_RX, // Teleinfo telemetry data receive pin GPIO_TELEINFO_ENABLE, // Teleinfo Enable Receive Pin - GPIO_LMT01, // LMT01 input counting pin + GPIO_LMT01, // LMT01 input counting pin GPIO_SENSOR_END }; enum ProgramSelectablePins { @@ -226,7 +226,8 @@ const char kSensorNames[] PROGMEM = D_SENSOR_BL0940_RX "|" D_SENSOR_TCP_TXD "|" D_SENSOR_TCP_RXD "|" D_SENSOR_ETH_PHY_POWER "|" D_SENSOR_ETH_PHY_MDC "|" D_SENSOR_ETH_PHY_MDIO "|" - D_SENSOR_TELEINFO_RX "|" D_SENSOR_TELEINFO_ENABLE + D_SENSOR_TELEINFO_RX "|" D_SENSOR_TELEINFO_ENABLE "|" + D_SENSOR_LMT01_PULSE ; const char kSensorNamesFixed[] PROGMEM = @@ -294,6 +295,9 @@ const uint16_t kGpioNiceList[] PROGMEM = { AGPIO(GPIO_DSB), // Single wire DS18B20 or DS18S20 AGPIO(GPIO_DSB_OUT), // Pseudo Single wire DS18B20 or DS18S20 #endif +#ifdef USE_LMT01 + AGPIO(GPIO_LMT01), // LMT01, count pulses on GPIO +#endif // Light #ifdef USE_LIGHT diff --git a/tasmota/xsns_74_lmt01.ino b/tasmota/xsns_74_lmt01.ino index 1b3f363c9..8bd23ca4a 100644 --- a/tasmota/xsns_74_lmt01.ino +++ b/tasmota/xsns_74_lmt01.ino @@ -1,5 +1,5 @@ /* - xns_74_lmt01.ino + xns_74_lmt01.ino - Support for single wire LMT01 Temperature Sensor Copyright (C) 2020 Theo Arends, Justifiably @@ -20,13 +20,12 @@ #ifdef USE_LMT01 /*********************************************************************************************\ * LMT01 - 0.5°C Accurate 2-Pin Digital Output Temperature Sensor With Pulse Count Interface - * + * * Uses fragments of public domain code LMT01_Example.ino released by Texas Instruments, July 10th 2017. * See https://training.ti.com/how-interface-lmt01-temperature-sensor-arduino - * \*********************************************************************************************/ -#define XSNS_74 74 +#define XSNS_74 74 #define LMT01_TIMEOUT 200 // ms timeout for a reading cycle @@ -88,14 +87,12 @@ int LMT01_getPulses(void) { return -1; } - void LMT01_Show(bool Json) { char temp[33]; dtostrfd(lmt01_temperature, Settings.flag2.temperature_resolution, temp); if (Json) { - ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_TEMPERATURE "\":%s}"), \ - "LMT01", temp); + ResponseAppend_P(JSON_SNS_TEMP, "LMT01", temp); #ifdef USE_DOMOTICZ if (0 == tele_period) { DomoticzSensor(DZ_TEMP, temp); @@ -113,7 +110,6 @@ void LMT01_Show(bool Json) { } } - /*********************************************************************************************\ * Interface \*********************************************************************************************/ diff --git a/tools/decode-status.py b/tools/decode-status.py index bdd679be5..cdceced48 100755 --- a/tools/decode-status.py +++ b/tools/decode-status.py @@ -206,7 +206,7 @@ a_features = [[ "USE_IAQ","USE_DISPLAY_SEVENSEG","USE_AS3935","USE_PING", "USE_WINDMETER","USE_OPENTHERM","USE_THERMOSTAT","USE_VEML6075", "USE_VEML7700","USE_MCP9808","USE_BL0940","USE_TELEGRAM", - "USE_HP303B","USE_TCP_BRIDGE","USE_TELEINFO","", + "USE_HP303B","USE_TCP_BRIDGE","USE_TELEINFO","USE_LMT01", "","","","", "","","","", "","","USE_ETHERNET","USE_WEBCAM" @@ -243,7 +243,7 @@ else: obj = json.load(fp) def StartDecode(): - print ("\n*** decode-status.py v20200611 by Theo Arends and Jacek Ziolkowski ***") + print ("\n*** decode-status.py v20200617 by Theo Arends and Jacek Ziolkowski ***") # print("Decoding\n{}".format(obj))