Add support for single wire LMT01

Add support for single wire LMT01 temperature Sensor by justifiably (#8713)
This commit is contained in:
Theo Arends 2020-06-17 17:22:41 +02:00
parent ec7bad1c5e
commit 934526244f
9 changed files with 23 additions and 20 deletions

View File

@ -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 |

View File

@ -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)

View File

@ -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

View File

@ -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.

View File

@ -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;

View File

@ -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
};
/********************************************************************************************/

View File

@ -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

View File

@ -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
\*********************************************************************************************/

View File

@ -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))