Skip to content

Commit

Permalink
Add support for single wire LMT01
Browse files Browse the repository at this point in the history
Add support for single wire LMT01 temperature Sensor by justifiably (#8713)
  • Loading branch information
arendst committed Jun 17, 2020
1 parent ec7bad1 commit 9345262
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 20 deletions.
1 change: 1 addition & 0 deletions BUILDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions tasmota/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tasmota/my_user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions tasmota/support_features.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions tasmota/tasmota_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
};

/********************************************************************************************/
Expand Down
8 changes: 6 additions & 2 deletions tasmota/tasmota_template_ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand Down
12 changes: 4 additions & 8 deletions tasmota/xsns_74_lmt01.ino
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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);
Expand All @@ -113,7 +110,6 @@ void LMT01_Show(bool Json) {
}
}


/*********************************************************************************************\
* Interface
\*********************************************************************************************/
Expand Down
4 changes: 2 additions & 2 deletions tools/decode-status.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"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"
Expand Down Expand Up @@ -243,7 +243,7 @@
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))

Expand Down

0 comments on commit 9345262

Please sign in to comment.