From 31909e187990136c1c1011e45b8a6679c6ca68bf Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sat, 24 Oct 2020 18:27:54 +0200 Subject: [PATCH 01/10] Adding driver for 24C512 This chip is present on the ZBBrige. --- lib/AT24C256/library.properties | 9 - .../Eeprom24C128_256.cpp | 0 .../Eeprom24C128_256.h | 0 lib/AT24C256_512/Eeprom24C512.cpp | 334 ++++++++++++++++++ lib/AT24C256_512/Eeprom24C512.h | 211 +++++++++++ lib/AT24C256_512/library.properties | 9 + 6 files changed, 554 insertions(+), 9 deletions(-) delete mode 100644 lib/AT24C256/library.properties rename lib/{AT24C256 => AT24C256_512}/Eeprom24C128_256.cpp (100%) rename lib/{AT24C256 => AT24C256_512}/Eeprom24C128_256.h (100%) create mode 100644 lib/AT24C256_512/Eeprom24C512.cpp create mode 100644 lib/AT24C256_512/Eeprom24C512.h create mode 100644 lib/AT24C256_512/library.properties diff --git a/lib/AT24C256/library.properties b/lib/AT24C256/library.properties deleted file mode 100644 index 648e89096..000000000 --- a/lib/AT24C256/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=EEPROM 24C128 -version= -author=Julien Le Sech -maintainer=Julien Le Sech - www.idreammicro.com -sentence=EEPROM 24C128 / 24C256 memory driver. -paragraph=EEPROM 24C128 / 24C256 memory driver. -category= -url= -architectures=* diff --git a/lib/AT24C256/Eeprom24C128_256.cpp b/lib/AT24C256_512/Eeprom24C128_256.cpp similarity index 100% rename from lib/AT24C256/Eeprom24C128_256.cpp rename to lib/AT24C256_512/Eeprom24C128_256.cpp diff --git a/lib/AT24C256/Eeprom24C128_256.h b/lib/AT24C256_512/Eeprom24C128_256.h similarity index 100% rename from lib/AT24C256/Eeprom24C128_256.h rename to lib/AT24C256_512/Eeprom24C128_256.h diff --git a/lib/AT24C256_512/Eeprom24C512.cpp b/lib/AT24C256_512/Eeprom24C512.cpp new file mode 100644 index 000000000..06aedd9cf --- /dev/null +++ b/lib/AT24C256_512/Eeprom24C512.cpp @@ -0,0 +1,334 @@ +/**************************************************************************//** + * \brief EEPROM 24C512 library for Arduino + * \author Copyright (C) 2012 Julien Le Sech - www.idreammicro.com + * \version 1.0 + * \date 20120218 + * + * This file is part of the EEPROM 24C512 library for Arduino. + * + * This library is free software: you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) any + * later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see http://www.gnu.org/licenses/ + ******************************************************************************/ + +/**************************************************************************//** + * \file Eeprom24C512.cpp + ******************************************************************************/ + +/****************************************************************************** + * Header file inclusions. + ******************************************************************************/ + +#include +#include + +#include + +/****************************************************************************** + * Private macro definitions. + ******************************************************************************/ + +/**************************************************************************//** + * \def EEPROM__PAGE_SIZE + * \brief Size of a page in EEPROM memory. + * This size is given by EEPROM memory datasheet. + ******************************************************************************/ +#define EEPROM__PAGE_SIZE 128 + +/**************************************************************************//** + * \def EEPROM__RD_BUFFER_SIZE + * \brief Size of input TWI buffer. + * This size is equal to BUFFER_LENGTH defined in Wire library (32 bytes). + ******************************************************************************/ +#define EEPROM__RD_BUFFER_SIZE BUFFER_LENGTH + +/**************************************************************************//** + * \def EEPROM__WR_BUFFER_SIZE + * \brief Size of output TWI buffer. + * This size is equal to BUFFER_LENGTH - 2 bytes reserved for address. + ******************************************************************************/ +#define EEPROM__WR_BUFFER_SIZE (BUFFER_LENGTH - 2) + +/****************************************************************************** + * Public method definitions. + ******************************************************************************/ + +/**************************************************************************//** + * \fn Eeprom24C512::Eeprom24C512(byte deviceAddress) + * + * \brief Constructor. + * + * \param deviceAddress EEPROM address on TWI bus. + ******************************************************************************/ +Eeprom24C512::Eeprom24C512 +( + byte deviceAddress +){ + m_deviceAddress = deviceAddress; +} + +/**************************************************************************//** + * \fn void Eeprom24C512::initialize() + * + * \brief Initialize library and TWI bus. + * + * If several devices are connected to TWI bus, this method mustn't be + * called. TWI bus must be initialized out of this library using + * Wire.begin() method. + ******************************************************************************/ +void +Eeprom24C512::initialize() +{ + Wire.begin(); +} + +/**************************************************************************//** + * \fn void Eeprom24C512::writeByte( + * word address, + * byte data) + * + * \brief Write a byte in EEPROM memory. + * + * \remarks A delay of 10 ms is required after write cycle. + * + * \param address Address. + * \param data Byte to write. + ******************************************************************************/ +void +Eeprom24C512::writeByte +( + word address, + byte data +){ + Wire.beginTransmission(m_deviceAddress); + Wire.write(address >> 8); + Wire.write(address & 0xFF); + Wire.write(data); + Wire.endTransmission(); +} + +/**************************************************************************//** + * \fn void Eeprom24C512::writeBytes( + * word address, + * word length, + * byte* p_data) + * + * \brief Write bytes in EEPROM memory. + * + * \param address Start address. + * \param length Number of bytes to write. + * \param[in] p_data Bytes to write. + ******************************************************************************/ +void +Eeprom24C512::writeBytes +( + word address, + word length, + byte* p_data +){ + // Write first page if not aligned. + byte notAlignedLength = 0; + byte pageOffset = address % EEPROM__PAGE_SIZE; + if (pageOffset > 0) + { + notAlignedLength = EEPROM__PAGE_SIZE - pageOffset; + if (length < notAlignedLength) + { + notAlignedLength = length; + } + writePage(address, notAlignedLength, p_data); + length -= notAlignedLength; + } + + if (length > 0) + { + address += notAlignedLength; + p_data += notAlignedLength; + + // Write complete and aligned pages. + word pageCount = length / EEPROM__PAGE_SIZE; + for (word i = 0; i < pageCount; i++) + { + writePage(address, EEPROM__PAGE_SIZE, p_data); + address += EEPROM__PAGE_SIZE; + p_data += EEPROM__PAGE_SIZE; + length -= EEPROM__PAGE_SIZE; + } + + if (length > 0) + { + // Write remaining uncomplete page. + writePage(address, length, p_data); + } + } +} + +/**************************************************************************//** + * \fn byte Eeprom24C512::readByte(word address) + * + * \brief Read a byte in EEPROM memory. + * + * \param address Address. + * + * \return Read byte. + ******************************************************************************/ +byte +Eeprom24C512::readByte +( + word address +){ + Wire.beginTransmission(m_deviceAddress); + Wire.write(address >> 8); + Wire.write(address & 0xFF); + Wire.endTransmission(); + Wire.requestFrom(m_deviceAddress, (byte)1); + byte data = 0; + if (Wire.available()) + { + data = Wire.read(); + } + return data; +} + +/**************************************************************************//** + * \fn void Eeprom24C512::readBytes( + * word address, + * word length, + * byte* p_data) + * + * \brief Read bytes in EEPROM memory. + * + * \param address Start address. + * \param length Number of bytes to read. + * \patam[in] p_data Byte array to fill with read bytes. + ******************************************************************************/ +void +Eeprom24C512::readBytes +( + word address, + word length, + byte* p_data +){ + word bufferCount = length / EEPROM__RD_BUFFER_SIZE; + for (word i = 0; i < bufferCount; i++) + { + word offset = i * EEPROM__RD_BUFFER_SIZE; + readBuffer(address + offset, EEPROM__RD_BUFFER_SIZE, p_data + offset); + } + + byte remainingBytes = length % EEPROM__RD_BUFFER_SIZE; + word offset = length - remainingBytes; + readBuffer(address + offset, remainingBytes, p_data + offset); +} + +/****************************************************************************** + * Private method definitions. + ******************************************************************************/ + +/**************************************************************************//** + * \fn void Eeprom24C512::writePage( + * word address, + * byte length, + * byte* p_data) + * + * \brief Write page in EEPROM memory. + * + * \param address Start address. + * \param length Number of bytes (EEPROM__PAGE_SIZE bytes max). + * \param[in] p_data Data. + ******************************************************************************/ +void +Eeprom24C512::writePage +( + word address, + byte length, + byte* p_data +){ + // Write complete buffers. + byte bufferCount = length / EEPROM__WR_BUFFER_SIZE; + for (byte i = 0; i < bufferCount; i++) + { + byte offset = i * EEPROM__WR_BUFFER_SIZE; + writeBuffer(address + offset, EEPROM__WR_BUFFER_SIZE, p_data + offset); + } + + // Write remaining bytes. + byte remainingBytes = length % EEPROM__WR_BUFFER_SIZE; + byte offset = length - remainingBytes; + writeBuffer(address + offset, remainingBytes, p_data + offset); +} + +/**************************************************************************//** + * \fn void Eeprom24C512::writeBuffer( + * word address, + * byte length, + * byte* p_data) + * + * \brief Write bytes into memory. + * + * \param address Start address. + * \param length Number of bytes (EEPROM__WR_BUFFER_SIZE bytes max). + * \param[in] p_data Data. + ******************************************************************************/ +void +Eeprom24C512::writeBuffer +( + word address, + byte length, + byte* p_data +){ + Wire.beginTransmission(m_deviceAddress); + Wire.write(address >> 8); + Wire.write(address & 0xFF); + for (byte i = 0; i < length; i++) + { + Wire.write(p_data[i]); + } + Wire.endTransmission(); + + // Write cycle time (tWR). See EEPROM memory datasheet for more details. + delay(10); +} + +/**************************************************************************//** + * \fn void Eeprom24C512::readBuffer( + * word address, + * byte length, + * byte* p_data) + * + * \brief Read bytes in memory. + * + * \param address Start address. + * \param length Number of bytes (EEPROM__RD_BUFFER_SIZE bytes max). + * \param[in] p_data Buffer to fill with read bytes. + ******************************************************************************/ +void +Eeprom24C512::readBuffer +( + word address, + byte length, + byte* p_data +){ + Wire.beginTransmission(m_deviceAddress); + Wire.write(address >> 8); + Wire.write(address & 0xFF); + Wire.endTransmission(); + Wire.requestFrom(m_deviceAddress, length); + for (byte i = 0; i < length; i++) + { + if (Wire.available()) + { + p_data[i] = Wire.read(); + } + } +} + diff --git a/lib/AT24C256_512/Eeprom24C512.h b/lib/AT24C256_512/Eeprom24C512.h new file mode 100644 index 000000000..bebacc883 --- /dev/null +++ b/lib/AT24C256_512/Eeprom24C512.h @@ -0,0 +1,211 @@ +/**************************************************************************//** + * \brief EEPROM 24C512 library for Arduino + * \author Copyright (C) 2012 Julien Le Sech - www.idreammicro.com + * \version 1.0 + * \date 20120203 + * + * This file is part of the EEPROM 24C512 library for Arduino. + * + * This library is free software: you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) any + * later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see http://www.gnu.org/licenses/ + ******************************************************************************/ + +/**************************************************************************//** + * \headerfile Eeprom24C512.h + ******************************************************************************/ + +#ifndef Eeprom24C512_h +#define Eeprom24C512_h + +/****************************************************************************** + * Header file inclusion. + ******************************************************************************/ + +#include + +/**************************************************************************//** + * \class Eeprom24C512 + * + * \brief EEPROM 24C512 memory driver. + * + * This driver is designed for 24C512 memory. + ******************************************************************************/ +class Eeprom24C512 +{ + public: + + /******************************************************************//** + * \fn Eeprom24C512(byte deviceAddress) + * + * \brief Constructor. + * + * \param deviceAddress EEPROM address on TWI bus. + **********************************************************************/ + Eeprom24C512 + ( + byte deviceAddress + ); + + /******************************************************************//** + * \fn void initialize() + * + * \brief Initialize library abnd TWI bus. + * + * If several devices are connected to TWI bus, this method mustn't be + * called. TWI bus must be initialized out of this library using + * Wire.begin() method. + **********************************************************************/ + void + initialize(); + + /******************************************************************//** + * \fn void writeByte( + * word address, + * byte data) + * + * \brief Write a byte in EEPROM memory. + * + * \remarks A delay of 10 ms is required after write cycle. + * + * \param address Address. + * \param data Byte to write. + **********************************************************************/ + void + writeByte + ( + word address, + byte data + ); + + /******************************************************************//** + * \fn void writeBytes( + * word address, + * word length, + * byte* p_data) + * + * \brief Write bytes in EEPROM memory. + * + * \param address Start address. + * \param length Number of bytes to write. + * \param[in] p_data Bytes to write. + **********************************************************************/ + void + writeBytes + ( + word address, + word length, + byte* p_data + ); + + /******************************************************************//** + * \fn byte readByte(word address) + * + * \brief Read a byte in EEPROM memory. + * + * \param address Address. + * + * \return Read byte. + **********************************************************************/ + byte + readByte + ( + word address + ); + + /******************************************************************//** + * \fn void readBytes( + * word address, + * word length, + * byte* p_data) + * + * \brief Read bytes in EEPROM memory. + * + * \param address Start address. + * \param length Number of bytes to read. + * \patam[in] p_data Byte array to fill with read bytes. + **********************************************************************/ + void + readBytes + ( + word address, + word length, + byte* p_buffer + ); + + private: + + byte m_deviceAddress; + + /******************************************************************//** + * \fn void writePage( + * word address, + * byte length, + * byte* p_data) + * + * \brief Write page in EEPROM memory. + * + * \param address Start address. + * \param length Number of bytes (64 bytes max). + * \param[in] p_data Data. + **********************************************************************/ + void + writePage + ( + word address, + byte length, + byte* p_data + ); + + /******************************************************************//** + * \fn void writeBuffer( + * word address, + * byte length, + * byte* p_data) + * + * \brief Write bytes into memory. + * + * \param address Start address. + * \param length Number of bytes (30 bytes max). + * \param[in] p_date Data. + **********************************************************************/ + void + writeBuffer + ( + word address, + byte length, + byte* p_data + ); + + /******************************************************************//** + * \fn void readBuffer( + * word address, + * byte length, + * byte* p_data) + * + * \brief Read bytes in memory. + * + * \param address Start address. + * \param length Number of bytes to read (32 bytes max). + * \param[in] p_data Buffer to fill with read bytes. + **********************************************************************/ + void + readBuffer + ( + word address, + byte length, + byte* p_data + ); +}; + +#endif // Eeprom24C512_h + diff --git a/lib/AT24C256_512/library.properties b/lib/AT24C256_512/library.properties new file mode 100644 index 000000000..b35717cfb --- /dev/null +++ b/lib/AT24C256_512/library.properties @@ -0,0 +1,9 @@ +name=EEPROM 24C128_256_521 +version= +author=Julien Le Sech +maintainer=Julien Le Sech - www.idreammicro.com +sentence=EEPROM 24C128 / 24C256 / 24C512 memory driver. +paragraph=EEPROM 24C128 / 24C256 / 24C512 memory driver. +category= +url= +architectures=* From c305b07cdab5c4459d65ac5f4946ca7a48e3cef3 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sat, 24 Oct 2020 19:19:29 +0200 Subject: [PATCH 02/10] Disable Wemo emulation for ZBBridge Saves 3KB of Flash --- tasmota/tasmota_configurations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/tasmota_configurations.h b/tasmota/tasmota_configurations.h index 37f6d107f..74aafa36e 100644 --- a/tasmota/tasmota_configurations.h +++ b/tasmota/tasmota_configurations.h @@ -445,7 +445,7 @@ //#undef USE_WEBSEND_RESPONSE // Disable command WebSend response message (+1k code) #define USE_EMULATION // Disable Wemo or Hue emulation #define USE_EMULATION_HUE // Disable Hue Bridge emulation for Alexa (+14k code, +2k mem common) -//#undef USE_EMULATION_WEMO // Disable Belkin WeMo emulation for Alexa (+6k code, +2k mem common) +#undef USE_EMULATION_WEMO // Disable Belkin WeMo emulation for Alexa (+6k code, +2k mem common) #undef USE_CUSTOM // Disable Custom features #undef USE_DISCOVERY // Disable Discovery services for both MQTT and web server //#undef USE_TIMERS // Disable support for up to 16 timers From 725db6e00522e5278c1ec44eb96476df546ea7ac Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sat, 24 Oct 2020 22:54:53 +0200 Subject: [PATCH 03/10] Solve warning for esptool --- platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/platformio.ini b/platformio.ini index a14faae3e..d31f9a455 100644 --- a/platformio.ini +++ b/platformio.ini @@ -149,5 +149,6 @@ build_flags = -DUSE_IR_REMOTE_FULL ; *** Esp8266 Tasmota modified Arduino core based on core 2.7.4 platform = espressif8266@2.6.2 platform_packages = framework-arduinoespressif8266@https://github.com/tasmota/Arduino/releases/download/2.7.4.5/esp8266-2.7.4.5.zip + platformio/tool-esptool @ 1.413.0 build_unflags = ${esp_defaults.build_unflags} build_flags = ${esp82xx_defaults.build_flags} From 9f91ca8d4f809a1ee5d10988486d6df428dc66d6 Mon Sep 17 00:00:00 2001 From: Christopher Tremblay Date: Sun, 25 Oct 2020 01:21:01 -0700 Subject: [PATCH 04/10] Add support for EZO CO2 sensor Adds support for CO2 sensor --- I2CDEVICES.md | 10 +++--- tasmota/my_user_config.h | 5 +++ tasmota/support_features.ino | 5 +-- tasmota/tasmota_configurations.h | 6 ++++ tasmota/xsns_78_ezo.ino | 4 +-- tasmota/xsns_78_ezoco2.ino | 57 ++++++++++++++++++++++++++++++++ tasmota/xsns_78_xezo.ino | 17 ++++++++-- 7 files changed, 93 insertions(+), 11 deletions(-) create mode 100644 tasmota/xsns_78_ezoco2.ino diff --git a/I2CDEVICES.md b/I2CDEVICES.md index 0ceec1c6c..c572f50a1 100644 --- a/I2CDEVICES.md +++ b/I2CDEVICES.md @@ -77,7 +77,9 @@ Index | Define | Driver | Device | Address(es) | Description 52 | USE_HP303B | xsns_73 | HP303B | 0x76 - 0x77 | Pressure and temperature sensor 53 | USE_MLX90640 | xdrv_84 | MLX90640 | 0x33 | IR array temperature sensor 54 | USE_VL53L1X | xsns_77 | VL53L1X | 0x29 | Time-of-flight (ToF) distance sensor - 55 | USE_EZOPH | xsns_78 | EZOPH | 0x61 - 0x70 | pH Sensor - 55 | USE_EZOORP | xsns_78 | EZOORP | 0x61 - 0x70 | ORP Sensor - 55 | USE_EZORTD | xsns_78 | EZORTD | 0x61 - 0x70 | Temperature Sensor - 55 | USE_EZOHUM | xsns_78 | EZORTD | 0x61 - 0x70 | Humidity Sensor + 55 | USE_EZOPH | xsns_78 | EZOPH | 0x61 - 0x70 | pH sensor + 55 | USE_EZOORP | xsns_78 | EZOORP | 0x61 - 0x70 | ORP sensor + 55 | USE_EZORTD | xsns_78 | EZORTD | 0x61 - 0x70 | Temperature sensor + 55 | USE_EZOHUM | xsns_78 | EZOHUM | 0x61 - 0x70 | Humidity sensor + 55 | USE_EZOEC | xsns_78 | EZOEC | 0x61 - 0x70 | Electric conductivity sensor + 55 | USE_EZOCO2 | xsns_78 | EZOCO2 | 0x61 - 0x70 | CO2 sensor diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index 50414dba7..aedd2024d 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -567,6 +567,11 @@ // #define USE_EZORTD // [I2cDriver55] Enable support for EZO's RTD sensor (+0k2 code) - Shared EZO code required for any EZO device (+1k2 code) // #define USE_EZOHUM // [I2cDriver55] Enable support for EZO's HUM sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) // #define USE_EZOEC // [I2cDriver55] Enable support for EZO's EC sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) +// #define USE_EZOCO2 // [I2cDriver55] Enable support for EZO's CO2 sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) + + #if defined(USE_EZOPH) || defined(USE_EZOORP) || defined(USE_EZORTD) || defined(USE_EZOHUM) || defined(USE_EZOEC) || defined(USE_EZOCO2) + #define USE_EZO + #endif // #define USE_DISPLAY // Add I2C Display Support (+2k code) #define USE_DISPLAY_MODES1TO5 // Enable display mode 1 to 5 in addition to mode 0 diff --git a/tasmota/support_features.ino b/tasmota/support_features.ino index 3ed654ebf..f4ee77603 100644 --- a/tasmota/support_features.ino +++ b/tasmota/support_features.ino @@ -642,8 +642,9 @@ void GetFeatures(void) #if defined(USE_I2C) && defined(USE_EZOEC) feature7 |= 0x00000008; // xsns_78_ezoec.ino #endif - -// feature7 |= 0x00000010; +#if defined(USE_I2C) && defined(USE_EZOCO2) + feature7 |= 0x00000010; +#endif // feature7 |= 0x00000020; // feature7 |= 0x00000040; // feature7 |= 0x00000080; diff --git a/tasmota/tasmota_configurations.h b/tasmota/tasmota_configurations.h index 358defe4e..2a9aeed50 100644 --- a/tasmota/tasmota_configurations.h +++ b/tasmota/tasmota_configurations.h @@ -132,6 +132,12 @@ //#define USE_EZORTD // [I2cDriver55] Enable support for EZO's RTD sensor (+0k2 code) - Shared EZO code required for any EZO device (+1k2 code) //#define USE_EZOHUM // [I2cDriver55] Enable support for EZO's HUM sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) //#define USE_EZOEC // [I2cDriver55] Enable support for EZO's EC sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) +//#define USE_EZOCO2 // [I2cDriver55] Enable support for EZO's CO2 sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) + + #if defined(USE_EZOPH) || defined(USE_EZOORP) || defined(USE_EZORTD) || defined(USE_EZOHUM) || defined(USE_EZOEC) \ + defined(USE_EZOCO2) + #define USE_EZO + #endif #define USE_MHZ19 // Add support for MH-Z19 CO2 sensor (+2k code) #define USE_SENSEAIR // Add support for SenseAir K30, K70 and S8 CO2 sensor (+2k3 code) diff --git a/tasmota/xsns_78_ezo.ino b/tasmota/xsns_78_ezo.ino index 1507a36c4..72d22cf6f 100644 --- a/tasmota/xsns_78_ezo.ino +++ b/tasmota/xsns_78_ezo.ino @@ -17,7 +17,7 @@ along with this program. If not, see . */ #ifdef USE_I2C -#if defined(USE_EZOPH) || defined(USE_EZOORP) || defined(USE_EZORTD) || defined(USE_EZOHUM) || defined(USE_EZOEC) +#if defined(USE_EZO) #define D_EZO_DELAY 300 // Minimum delay for any instruction #define D_EZO_MAX_BUF 40 // Maximum response @@ -106,5 +106,5 @@ protected: -#endif // USE_EZO* +#endif // USE_EZO #endif // USE_I2C diff --git a/tasmota/xsns_78_ezoco2.ino b/tasmota/xsns_78_ezoco2.ino new file mode 100644 index 000000000..df23a05cf --- /dev/null +++ b/tasmota/xsns_78_ezoco2.ino @@ -0,0 +1,57 @@ +/* + xsns_78_ezoco2.ino - EZO CO2 I2C CO2 sensor support for Tasmota + + Copyright (C) 2020 Christopher Tremblay + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifdef USE_I2C +#ifdef USE_EZOCO2 + +#define EZO_CO2_READ_LATENCY 900 + +struct EZOCO2 : public EZOStruct { + EZOCO2(uint32_t addr) : EZOStruct(addr), CO2(0) {} + + virtual void ProcessMeasurement(void) + { + char data[D_EZO_MAX_BUF]; + + EZOStruct::ProcessMeasurement(data, sizeof(data), EZO_CO2_READ_LATENCY); + + // sensor has a 10s warmup period + if (uptime >= 10) { + CO2 = atoi(data); + } + } + + virtual void Show(bool json, const char *name) + { + if (json) { + ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_CO2 "\":%d}" ), name, CO2); + } +#ifdef USE_WEBSERVER + else { + WSContentSend_PD(HTTP_SNS_CO2, name, CO2); +#endif // USE_WEBSERVER + } + } + +private: + uint16_t CO2; +}; + +#endif // USE_EZOCO2 +#endif // USE_I2C diff --git a/tasmota/xsns_78_xezo.ino b/tasmota/xsns_78_xezo.ino index 659d3efa3..2284410de 100644 --- a/tasmota/xsns_78_xezo.ino +++ b/tasmota/xsns_78_xezo.ino @@ -18,7 +18,7 @@ */ #ifdef USE_I2C -#if defined(USE_EZOPH) || defined(USE_EZOORP) || defined(USE_EZORTD) || defined(USE_EZOHUM) || defined(USE_EZOEC) +#if defined(USE_EZO) #define XSNS_78 78 #define XI2C_55 55 // See I2CDEVICES.md @@ -65,7 +65,7 @@ const char EZO_RTD_NAME[] PROGMEM = "RTD"; #endif //const char EZO_PMP_NAME[] PROGMEM = "PMP"; //const char EZO_FLO_NAME[] PROGMEM = "FLO"; -//const char EZO_CO2_NAME[] PROGMEM = "CO2"; +const char EZO_CO2_NAME[] PROGMEM = "pH"; //const char EZO_PRS_NAME[] PROGMEM = "PRS"; //const char EZO_O2_NAME[] PROGMEM = "O2"; #ifdef USE_EZOHUM @@ -104,7 +104,13 @@ const char *const EZOSupport[EZO_ADDR_n] PROGMEM = { EZO_EMPTY, EZO_EMPTY, + +#ifdef USE_EZOCO2 + EZO_CO2_NAME, +#else EZO_EMPTY, +#endif + EZO_EMPTY, EZO_EMPTY, EZO_EMPTY, @@ -265,6 +271,11 @@ private: sensor[count] = new EZORTD(addr); break; #endif +#ifdef USE_EZOCO2 + case EZO_CO2: + sensor[count] = new EZOCO2(addr); + break; +#endif #ifdef USE_EZOHUM case EZO_HUM: sensor[count] = new EZOHUM(addr); @@ -324,5 +335,5 @@ bool Xsns78(uint8_t function) return false; } -#endif // USE_EZO* +#endif // USE_EZO #endif // USE_I2C From ab7481d1154f26ff58796fb1c30133306c70eb29 Mon Sep 17 00:00:00 2001 From: Christopher Tremblay Date: Sun, 25 Oct 2020 01:28:27 -0700 Subject: [PATCH 05/10] Fix error in tasmota_configuration Fix compile error in my build --- tasmota/tasmota_configurations.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tasmota/tasmota_configurations.h b/tasmota/tasmota_configurations.h index a7b887792..3c48ad3f4 100644 --- a/tasmota/tasmota_configurations.h +++ b/tasmota/tasmota_configurations.h @@ -134,8 +134,7 @@ //#define USE_EZOEC // [I2cDriver55] Enable support for EZO's EC sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) //#define USE_EZOCO2 // [I2cDriver55] Enable support for EZO's CO2 sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) - #if defined(USE_EZOPH) || defined(USE_EZOORP) || defined(USE_EZORTD) || defined(USE_EZOHUM) || defined(USE_EZOEC) \ - defined(USE_EZOCO2) + #if defined(USE_EZOPH) || defined(USE_EZOORP) || defined(USE_EZORTD) || defined(USE_EZOHUM) || defined(USE_EZOEC) || defined(USE_EZOCO2) #define USE_EZO #endif From 5c02b81daadf9ed1b5413c659234a03241999b9e Mon Sep 17 00:00:00 2001 From: Christopher Tremblay Date: Sun, 25 Oct 2020 01:47:54 -0700 Subject: [PATCH 06/10] Remove debug code --- tasmota/xsns_78_xezo.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/xsns_78_xezo.ino b/tasmota/xsns_78_xezo.ino index 2284410de..beb8a2288 100644 --- a/tasmota/xsns_78_xezo.ino +++ b/tasmota/xsns_78_xezo.ino @@ -65,7 +65,7 @@ const char EZO_RTD_NAME[] PROGMEM = "RTD"; #endif //const char EZO_PMP_NAME[] PROGMEM = "PMP"; //const char EZO_FLO_NAME[] PROGMEM = "FLO"; -const char EZO_CO2_NAME[] PROGMEM = "pH"; +const char EZO_CO2_NAME[] PROGMEM = "CO2"; //const char EZO_PRS_NAME[] PROGMEM = "PRS"; //const char EZO_O2_NAME[] PROGMEM = "O2"; #ifdef USE_EZOHUM From 951783cd542a18ee86523311c7a5c32a1b254d70 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sun, 25 Oct 2020 11:48:38 +0100 Subject: [PATCH 07/10] Enable TLS in Tasmota-zbbridge --- platformio_tasmota_env.ini | 1 + tasmota/WiFiClientSecureLightBearSSL.cpp | 1 + tasmota/tasmota_configurations.h | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/platformio_tasmota_env.ini b/platformio_tasmota_env.ini index c28667685..1fe97de07 100644 --- a/platformio_tasmota_env.ini +++ b/platformio_tasmota_env.ini @@ -101,6 +101,7 @@ build_flags = ${common.build_flags} ${irremoteesp_full.build_flags} -DFIRMWARE_I [env:tasmota-zbbridge] build_flags = ${common.build_flags} -DFIRMWARE_ZBBRIDGE +board_build.f_cpu = 160000000L [env:tasmota-BG] build_flags = ${common.build_flags} -DMY_LANGUAGE=bg_BG diff --git a/tasmota/WiFiClientSecureLightBearSSL.cpp b/tasmota/WiFiClientSecureLightBearSSL.cpp index f0a6bcfbb..645509989 100755 --- a/tasmota/WiFiClientSecureLightBearSSL.cpp +++ b/tasmota/WiFiClientSecureLightBearSSL.cpp @@ -21,6 +21,7 @@ */ #include "my_user_config.h" +#include "tasmota_configurations.h" #if defined(ESP8266) && defined(USE_TLS) // #define DEBUG_TLS diff --git a/tasmota/tasmota_configurations.h b/tasmota/tasmota_configurations.h index 94adcdfc7..e0701b027 100644 --- a/tasmota/tasmota_configurations.h +++ b/tasmota/tasmota_configurations.h @@ -548,6 +548,14 @@ #undef DEBUG_THEO // Disable debug code #undef USE_DEBUG_DRIVER // Disable debug code +// -- MQTT - TLS - AWS IoT ------------------------ +#define USE_MQTT_TLS // Use TLS for MQTT connection (+34.5k code, +7.0k mem and +4.8k additional during connection handshake) + #define USE_MQTT_TLS_CA_CERT // Force full CA validation instead of fingerprints, slower, but simpler to use. (+2.2k code, +1.9k mem during connection handshake) + // This includes the LetsEncrypt CA in tasmota_ca.ino for verifying server certificates + #define USE_MQTT_TLS_FORCE_EC_CIPHER // Force Elliptic Curve cipher (higher security) required by some servers (automatically enabled with USE_MQTT_AWS_IOT) (+11.4k code, +0.4k mem) + #define USE_MQTT_AWS_IOT_LIGHT // Enable MQTT for AWS IoT in light mode, with user/password instead of private certificate +#define USE_TLS // flag indicates we need to include TLS code + #define USE_ZIGBEE #undef USE_ZIGBEE_ZNP #define USE_ZIGBEE_EZSP From b92b59b2b108343ca809d0815813d2cb1cf0ac13 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 25 Oct 2020 12:59:24 +0100 Subject: [PATCH 08/10] Add command ``SetOption113 1`` Add command ``SetOption113 1`` to set dimmer low on rotary dial after power off (#8263) --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + tasmota/settings.h | 2 +- tasmota/support_rotary.ino | 9 ++++++++- tools/decode-status.py | 5 +++-- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53bd16e86..b99347572 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. - Command ``NoDelay`` for immediate backlog command execution by Erik Montnemery (#9544) - Command ``SwitchMode 15`` sending only MQTT message on switch change (#9593) - Command ``ShutterChange`` to increment change position (#9594) +- Command ``SetOption113 1`` to set dimmer low on rotary dial after power off - Support for EZO Ph and ORP sensors by Christopher Tremblay (#9567) - Support for EZO RTD sensors by Christopher Tremblay (#9585) - Support for EZO HUM sensors by Christopher Tremblay (#9599) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 929e8259a..be34664ec 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -62,6 +62,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - Command ``NoDelay`` for immediate backlog command execution by Erik Montnemery (#9544) - Command ``SwitchMode 15`` sending only MQTT message on switch change (#9593) - Command ``ShutterChange`` to increment change position (#9594) +- Command ``SetOption113 1`` to set dimmer low on rotary dial after power off - Zigbee command ``ZbData`` for better support of device specific data - Optional support for Mitsubishi Electric HVAC by David Gwynne (#9237) - Optional support for Orno WE517-Modbus energy meter by Maxime Vincent (#9353) diff --git a/tasmota/settings.h b/tasmota/settings.h index 3b409b6bd..d75c40bcd 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -132,7 +132,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t zb_disable_autobind : 1; // bit 28 (v8.5.0.1) - SetOption110 - disable Zigbee auto-config when pairing new devices uint32_t buzzer_freq_mode : 1; // bit 29 (v8.5.0.1) - SetOption111 - Use frequency output for buzzer pin instead of on/off signal uint32_t zb_topic_fname : 1; // bit 30 (v8.5.0.1) - SetOption112 - Use friendly name in zigbee topic (use with SetOption89) - uint32_t spare31 : 1; // bit 31 + uint32_t rotary_poweron_dimlow : 1; // bit 31 (v9.0.0.2) - SetOption113 - Set dimmer low on rotary dial after power off }; } SysBitfield4; diff --git a/tasmota/support_rotary.ino b/tasmota/support_rotary.ino index e04c36faa..fca1a4dc2 100644 --- a/tasmota/support_rotary.ino +++ b/tasmota/support_rotary.ino @@ -198,7 +198,14 @@ void RotaryHandler(void) { } } } else { // Dimmer RGBCW or RGB only if second rotary - LightDimmerOffset(second_rotary ? 1 : 0, rotary_position * rotary_dimmer_increment[Rotary.model]); + uint32_t dimmer_index = second_rotary ? 1 : 0; + if (!Settings.flag4.rotary_poweron_dimlow || power) { // SetOption113 - On rotary dial after power off set dimmer low + LightDimmerOffset(dimmer_index, rotary_position * rotary_dimmer_increment[Rotary.model]); + } else { + if (rotary_position > 0) { // Only power on if rotary increase + LightDimmerOffset(dimmer_index, -LightGetDimmer(dimmer_index) +1); + } + } } } else { // Rotary2 if (button_pressed) { // Color Temperature diff --git a/tools/decode-status.py b/tools/decode-status.py index 6826f3afc..1bff40a71 100755 --- a/tools/decode-status.py +++ b/tools/decode-status.py @@ -165,7 +165,8 @@ a_setoption = [[ "Force gen1 Alexa mode", "Disable Zigbee auto-config when pairing new devices", "Use frequency output for buzzer pin instead of on/off signal", - "","" + "Use friendly name in zigbee topic (use with SetOption89)", + "Set dimmer low on rotary dial after power off" ],[ "","","","", "","","","", @@ -267,7 +268,7 @@ else: obj = json.load(fp) def StartDecode(): - print ("\n*** decode-status.py v20201024 by Theo Arends and Jacek Ziolkowski ***") + print ("\n*** decode-status.py v20201025 by Theo Arends and Jacek Ziolkowski ***") # print("Decoding\n{}".format(obj)) From 95d440f712dedc19910d428329d35021e5005428 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 25 Oct 2020 14:17:40 +0100 Subject: [PATCH 09/10] Update support_rotary.ino --- tasmota/support_rotary.ino | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasmota/support_rotary.ino b/tasmota/support_rotary.ino index fca1a4dc2..e91fcdd4b 100644 --- a/tasmota/support_rotary.ino +++ b/tasmota/support_rotary.ino @@ -36,6 +36,9 @@ #ifndef ROTARY_MAX_STEPS #define ROTARY_MAX_STEPS 10 // Rotary step boundary #endif +#ifndef ROTARY_START_DIM +#define ROTARY_START_DIM 1 // Minimal dimmer value after power on with SetOption113 1 +#endif #ifndef ROTARY_TIMEOUT #define ROTARY_TIMEOUT 2 // 2 * RotaryHandler() call which is usually 2 * 0.05 seconds #endif @@ -203,7 +206,7 @@ void RotaryHandler(void) { LightDimmerOffset(dimmer_index, rotary_position * rotary_dimmer_increment[Rotary.model]); } else { if (rotary_position > 0) { // Only power on if rotary increase - LightDimmerOffset(dimmer_index, -LightGetDimmer(dimmer_index) +1); + LightDimmerOffset(dimmer_index, -LightGetDimmer(dimmer_index) + ROTARY_START_DIM); } } } From a96218fc1cb0aa0dbc14e88e778a830f2be3c9a5 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 25 Oct 2020 14:46:13 +0100 Subject: [PATCH 10/10] v9.0.0.3 - Add TLS in binary tasmota-zbbridge (#9620) - Add support for EZO CO2 sensors by Christopher Tremblay (#9619) --- BUILDS.md | 1 + CHANGELOG.md | 7 ++++++- RELEASENOTES.md | 5 +++-- tasmota/my_user_config.h | 4 ---- tasmota/tasmota_configurations.h | 32 +++++++++++++------------------- tasmota/tasmota_version.h | 2 +- tasmota/xsns_78_ezo.ino | 6 +++++- 7 files changed, 29 insertions(+), 28 deletions(-) diff --git a/BUILDS.md b/BUILDS.md index 00be02c3d..e29ba5f5b 100644 --- a/BUILDS.md +++ b/BUILDS.md @@ -131,6 +131,7 @@ | USE_VEML7700 | - | - | - | - | - | - | - | | USE_MCP9808 | - | - | - | - | - | - | - | | USE_HP303B | - | - | - | - | - | - | - | +| USE_EZOCO2 | - | - | - | - | - | - | - | | USE_EZOEC | - | - | - | - | - | - | - | | USE_EZOHUM | - | - | - | - | - | - | - | | USE_EZOORP | - | - | - | - | - | - | - | diff --git a/CHANGELOG.md b/CHANGELOG.md index b99347572..6a8ef98d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,11 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - Development -## [9.0.0.2] +## [9.0.0.3] +### Added +- TLS in binary tasmota-zbbridge (#9620) + +## [9.0.0.2] - 20201025 ### Added - Support for Vietnamese language translations by Tâm.NT - Support for timers in case of no-sunset permanent day by cybermaus (#9543) @@ -15,6 +19,7 @@ All notable changes to this project will be documented in this file. - Support for EZO RTD sensors by Christopher Tremblay (#9585) - Support for EZO HUM sensors by Christopher Tremblay (#9599) - Support for EZO EC sensors by Christopher Tremblay (#9613) +- Support for EZO CO2 sensors by Christopher Tremblay (#9619) - On ZigbeeBridge support for glowing led when permit join is active (#9581) - Support for PWM Dimmer multi-press and ledmask (#9584) - Support for fixed output Hi or Lo GPIO selection diff --git a/RELEASENOTES.md b/RELEASENOTES.md index be34664ec..58c6117f2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -57,7 +57,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota [Complete list](BUILDS.md) of available feature and sensors. -## Changelog v9.0.0.2 +## Changelog v9.0.0.3 ### Added - Command ``NoDelay`` for immediate backlog command execution by Erik Montnemery (#9544) - Command ``SwitchMode 15`` sending only MQTT message on switch change (#9593) @@ -73,8 +73,9 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - Support for analog buttons indexed within standard button range - Support for Vietnamese language translations by Tâm.NT - Support for timers in case of no-sunset permanent day by cybermaus (#9543) -- Support for EZO EC, HUM, ORP, Ph and RTD sensors by Christopher Tremblay +- Support for EZO CO2, EC, HUM, ORP, Ph and RTD sensors by Christopher Tremblay - Support for fixed output Hi or Lo GPIO selection +- TLS in binary tasmota-zbbridge (#9620) - ESP32 support for Wireless-Tag WT32-ETH01 (#9496) - ESP32 MI32 Beacon support, RSSI at TELEPERIOD, refactoring (#9609) diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index aedd2024d..34b479e0e 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -569,10 +569,6 @@ // #define USE_EZOEC // [I2cDriver55] Enable support for EZO's EC sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) // #define USE_EZOCO2 // [I2cDriver55] Enable support for EZO's CO2 sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) - #if defined(USE_EZOPH) || defined(USE_EZOORP) || defined(USE_EZORTD) || defined(USE_EZOHUM) || defined(USE_EZOEC) || defined(USE_EZOCO2) - #define USE_EZO - #endif - // #define USE_DISPLAY // Add I2C Display Support (+2k code) #define USE_DISPLAY_MODES1TO5 // Enable display mode 1 to 5 in addition to mode 0 #define USE_DISPLAY_LCD // [DisplayModel 1] [I2cDriver3] Enable Lcd display (I2C addresses 0x27 and 0x3F) (+6k code) diff --git a/tasmota/tasmota_configurations.h b/tasmota/tasmota_configurations.h index cf59e8a1d..95fdcbea0 100644 --- a/tasmota/tasmota_configurations.h +++ b/tasmota/tasmota_configurations.h @@ -134,10 +134,6 @@ //#define USE_EZOEC // [I2cDriver55] Enable support for EZO's EC sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) //#define USE_EZOCO2 // [I2cDriver55] Enable support for EZO's CO2 sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) - #if defined(USE_EZOPH) || defined(USE_EZOORP) || defined(USE_EZORTD) || defined(USE_EZOHUM) || defined(USE_EZOEC) || defined(USE_EZOCO2) - #define USE_EZO - #endif - #define USE_MHZ19 // Add support for MH-Z19 CO2 sensor (+2k code) #define USE_SENSEAIR // Add support for SenseAir K30, K70 and S8 CO2 sensor (+2k3 code) #ifndef CO2_LOW @@ -443,14 +439,22 @@ #define SERIAL_LOG_LEVEL LOG_LEVEL_NONE // [SerialLog] (LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE) #undef USE_ARDUINO_OTA // Disable support for Arduino OTA -#define USE_DOMOTICZ // Disable Domoticz +#define USE_DOMOTICZ // Enable Domoticz #undef USE_HOME_ASSISTANT // Disable Home Assistant -#undef USE_MQTT_TLS // Disable TLS support won't work as the MQTTHost is not set + +// -- MQTT - TLS - AWS IoT ------------------------ +#define USE_MQTT_TLS // Use TLS for MQTT connection (+34.5k code, +7.0k mem and +4.8k additional during connection handshake) + #define USE_MQTT_TLS_CA_CERT // Force full CA validation instead of fingerprints, slower, but simpler to use. (+2.2k code, +1.9k mem during connection handshake) + // This includes the LetsEncrypt CA in tasmota_ca.ino for verifying server certificates + #define USE_MQTT_TLS_FORCE_EC_CIPHER // Force Elliptic Curve cipher (higher security) required by some servers (automatically enabled with USE_MQTT_AWS_IOT) (+11.4k code, +0.4k mem) + #define USE_MQTT_AWS_IOT_LIGHT // Enable MQTT for AWS IoT in light mode, with user/password instead of private certificate +#define USE_TLS // flag indicates we need to include TLS code + #undef USE_KNX // Disable KNX IP Protocol Support //#undef USE_WEBSERVER // Disable Webserver //#undef USE_WEBSEND_RESPONSE // Disable command WebSend response message (+1k code) -#define USE_EMULATION // Disable Wemo or Hue emulation -#define USE_EMULATION_HUE // Disable Hue Bridge emulation for Alexa (+14k code, +2k mem common) +#define USE_EMULATION // Enable Hue emulation +#define USE_EMULATION_HUE // Enable Hue Bridge emulation for Alexa (+14k code, +2k mem common) #undef USE_EMULATION_WEMO // Disable Belkin WeMo emulation for Alexa (+6k code, +2k mem common) #undef USE_CUSTOM // Disable Custom features #undef USE_DISCOVERY // Disable Discovery services for both MQTT and web server @@ -553,26 +557,16 @@ #undef DEBUG_THEO // Disable debug code #undef USE_DEBUG_DRIVER // Disable debug code -// -- MQTT - TLS - AWS IoT ------------------------ -#define USE_MQTT_TLS // Use TLS for MQTT connection (+34.5k code, +7.0k mem and +4.8k additional during connection handshake) - #define USE_MQTT_TLS_CA_CERT // Force full CA validation instead of fingerprints, slower, but simpler to use. (+2.2k code, +1.9k mem during connection handshake) - // This includes the LetsEncrypt CA in tasmota_ca.ino for verifying server certificates - #define USE_MQTT_TLS_FORCE_EC_CIPHER // Force Elliptic Curve cipher (higher security) required by some servers (automatically enabled with USE_MQTT_AWS_IOT) (+11.4k code, +0.4k mem) - #define USE_MQTT_AWS_IOT_LIGHT // Enable MQTT for AWS IoT in light mode, with user/password instead of private certificate -#define USE_TLS // flag indicates we need to include TLS code - #define USE_ZIGBEE #undef USE_ZIGBEE_ZNP #define USE_ZIGBEE_EZSP #define USE_TCP_BRIDGE - #define USE_ZIGBEE_CHANNEL 11 // Zigbee Channel (11-26) + #define USE_ZIGBEE_CHANNEL 11 // Zigbee Channel (11-26) #define USE_ZIGBEE_COALESCE_ATTR_TIMER 350 // timer to coalesce attribute values (in ms) - #endif // SONOFF_ZIGBEEBRIDGE ****************************************************************** - /*********************************************************************************************\ * [tasmota-lite.bin] * Provide an image without sensors diff --git a/tasmota/tasmota_version.h b/tasmota/tasmota_version.h index 1ab1e1de1..846e5579f 100644 --- a/tasmota/tasmota_version.h +++ b/tasmota/tasmota_version.h @@ -20,7 +20,7 @@ #ifndef _TASMOTA_VERSION_H_ #define _TASMOTA_VERSION_H_ -const uint32_t VERSION = 0x09000002; +const uint32_t VERSION = 0x09000003; // Lowest compatible version const uint32_t VERSION_COMPATIBLE = 0x07010006; diff --git a/tasmota/xsns_78_ezo.ino b/tasmota/xsns_78_ezo.ino index 72d22cf6f..783d86538 100644 --- a/tasmota/xsns_78_ezo.ino +++ b/tasmota/xsns_78_ezo.ino @@ -17,6 +17,10 @@ along with this program. If not, see . */ #ifdef USE_I2C + +#if defined(USE_EZOPH) || defined(USE_EZOORP) || defined(USE_EZORTD) || defined(USE_EZOHUM) || defined(USE_EZOEC) || defined(USE_EZOCO2) + #define USE_EZO +#endif #if defined(USE_EZO) #define D_EZO_DELAY 300 // Minimum delay for any instruction @@ -100,7 +104,7 @@ protected: } uint8_t valid; - uint8_t addr; + uint8_t addr; uint32_t lastRead; };