diff --git a/RELEASENOTES.md b/RELEASENOTES.md index ddb4bc8b2..5e5e3e549 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -70,6 +70,8 @@ The following binary downloads have been compiled with ESP8266/Arduino library c - Add command ``SetOption94 0/1`` to select MAX31855 or MAX6675 thermocouple support (#8616) - Add command ``SetOption97 0/1`` to switch between Tuya serial speeds 9600 bps (0) or 115200 bps (1) - Add command ``SetOption98 0/1`` to provide rotary rule triggers (1) instead of controlling light (0) +- Add command ``SetOption99 0/1`` to enable zero cross detection on PWM dimmer +- Add command ``SetOption100 0/1`` to remove ``ZbReceived`` value from ``{"ZbReceived":{xxx:yyy}}`` JSON message - Add command ``Module2`` to configure fallback module on fast reboot (#8464) - Add commands ``LedPwmOn 0..255``, ``LedPwmOff 0..255`` and ``LedPwmMode1 0/1`` to control led brightness by George (#8491) - Add ESP32 ethernet commands ``EthType 0/1``, ``EthAddress 0..31`` and ``EthClockMode 0..3`` diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index b67609a80..7dbad0a37 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -4,12 +4,14 @@ - Remove Arduino ESP8266 Core support for versions before 2.7.1 - Change to limited support of Arduino IDE as an increasing amount of features cannot be compiled with Arduino IDE +- Add command ``SetOption100 0/1`` to remove ``ZbReceived`` value from ``{"ZbReceived":{xxx:yyy}}`` JSON message ### 8.3.1.6 20200617 - Add command ``Module2`` to configure fallback module on fast reboot (#8464) - Add command ``SetOption97 0/1`` to switch between Tuya serial speeds 9600 bps (0) or 115200 bps (1) - Add command ``SetOption98 0/1`` to provide rotary rule triggers (1) instead of controlling light (0) +- Add command ``SetOption99 0/1`` to enable zero cross detection on PWM dimmer - 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 support for single wire LMT01 temperature Sensor by justifiably (#8713) diff --git a/tasmota/settings.h b/tasmota/settings.h index cc0fd9bf3..9d4466028 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -118,8 +118,8 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t network_ethernet : 1; // bit 14 (v8.3.1.3) - CMND_ETHERNET uint32_t tuyamcu_baudrate : 1; // bit 15 (v8.3.1.6) - SetOption97 - Set Baud rate for TuyaMCU serial communication (0 = 9600 or 1 = 115200) uint32_t rotary_uses_rules : 1; // bit 16 (v8.3.1.6) - SetOption98 - Use rules instead of light control - uint32_t zerocross_dimmer : 1; // bit 17 (v8.3.1.4) = SetOption99 - Enable zerocross dimmer on PWM DIMMER - uint32_t spare18 : 1; + uint32_t zerocross_dimmer : 1; // bit 17 (v8.3.1.4) - SetOption99 - Enable zerocross dimmer on PWM DIMMER + uint32_t remove_zbreceived : 1; // bit 18 (v8.3.1.7) - SetOption100 - Remove ZbReceived form JSON message uint32_t spare19 : 1; uint32_t spare20 : 1; uint32_t spare21 : 1; diff --git a/tasmota/xdrv_23_zigbee_2_devices.ino b/tasmota/xdrv_23_zigbee_2_devices.ino index d570c4560..abcf6440c 100644 --- a/tasmota/xdrv_23_zigbee_2_devices.ino +++ b/tasmota/xdrv_23_zigbee_2_devices.ino @@ -102,7 +102,7 @@ typedef struct Z_Deferred { uint16_t groupaddr; // group address (if needed) uint16_t cluster; // cluster to use for the timer uint8_t endpoint; // endpoint to use for timer - uint8_t category; // which category of deferred is it + uint8_t category; // which category of deferred is it uint32_t value; // any raw value to use for the timer Z_DeviceTimer func; // function to call when timer occurs } Z_Deferred; @@ -213,7 +213,7 @@ public: private: std::vector _devices = {}; std::vector _deferred = {}; // list of deferred calls - uint32_t _saveTimer = 0; + uint32_t _saveTimer = 0; uint8_t _seqNumber = 0; // global seqNumber if device is unknown template < typename T> @@ -738,7 +738,7 @@ bool Z_Devices::getHueState(uint16_t shortaddr, void Z_Devices::resetTimersForDevice(uint16_t shortaddr, uint16_t groupaddr, uint8_t category) { // iterate the list of deferred, and remove any linked to the shortaddr for (auto it = _deferred.begin(); it != _deferred.end(); it++) { - // Notice that the iterator is decremented after it is passed + // Notice that the iterator is decremented after it is passed // to erase() but before erase() is executed // see https://www.techiedelight.com/remove-elements-vector-inside-loop-cpp/ if ((it->shortaddr == shortaddr) && (it->groupaddr == groupaddr)) { @@ -937,9 +937,17 @@ void Z_Devices::jsonPublishFlush(uint16_t shortaddr) { zigbee_devices.jsonClear(shortaddr); if (use_fname) { - Response_P(PSTR("{\"" D_JSON_ZIGBEE_RECEIVED "\":{\"%s\":%s}}"), fname, msg.c_str()); + if (Settings.flag4.remove_zbreceived) { + Response_P(PSTR("{\"%s\":%s}"), fname, msg.c_str()); + } else { + Response_P(PSTR("{\"" D_JSON_ZIGBEE_RECEIVED "\":{\"%s\":%s}}"), fname, msg.c_str()); + } } else { - Response_P(PSTR("{\"" D_JSON_ZIGBEE_RECEIVED "\":{\"0x%04X\":%s}}"), shortaddr, msg.c_str()); + if (Settings.flag4.remove_zbreceived) { + Response_P(PSTR("{\"0x%04X\":%s}"), shortaddr, msg.c_str()); + } else { + Response_P(PSTR("{\"" D_JSON_ZIGBEE_RECEIVED "\":{\"0x%04X\":%s}}"), shortaddr, msg.c_str()); + } } if (Settings.flag4.zigbee_distinct_topics) { char subtopic[16];