From 70a4fbd800ddc6bca5784a8e5229d7d9009395cf Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 14 Feb 2024 11:22:41 +0100 Subject: [PATCH 1/2] Add command ``SetOption159 1`` to enable counting on both rising and falling edge (#20712) --- CHANGELOG.md | 3 ++- RELEASENOTES.md | 3 ++- tasmota/include/tasmota_types.h | 4 ++-- tasmota/tasmota_xsns_sensor/xsns_01_counter.ino | 8 ++++++-- tools/decode-status.py | 5 +++-- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e792c4df..b8d70f9ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,10 @@ All notable changes to this project will be documented in this file. ## [13.3.0.5] 20240214 ### Added - Internal support for persistent JSON settings using single file -- Command ``SetOption158`` to publish or suppress ModbusReceived MQTT messages (#20678) +- Command ``SetOption158 1`` to disable publish of ModbusReceived MQTT messages (#20678) - ESP32 Core3 support for SPI ethernet on DM9051, W5500 and KSZ8851 - Berry option to invert serial +- Command ``SetOption159 1`` to enable counting on both rising and falling edge (#20712) ### Breaking Changed - ESP32 LVGL library from v8.3.11 to v9.0.0, some small breaking changes in C, none in HASPmota (#20659) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 6fab9db0f..f8c5492bf 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -119,7 +119,8 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm ## Changelog v13.3.0.5 ### Added - Command ``TimedPower [,ON|OFF|TOGGLE|BLINK]`` executes ``Power [ON|OFF|TOGGLE|BLINK] `` and after executes ``Power [OFF|ON|TOGGLE|OFF]`` -- Command ``SetOption158`` to publish or suppress ModbusReceived MQTT messages [#20678](https://github.com/arendst/Tasmota/issues/20678) +- Command ``SetOption158 1`` to disable publish of ModbusReceived MQTT messages [#20678](https://github.com/arendst/Tasmota/issues/20678) +- Command ``SetOption159 1`` to enable counting on both rising and falling edge [#20712](https://github.com/arendst/Tasmota/issues/20712) - Display of active drivers using command ``status 4`` - GPIO Viewer to see realtime GPIO states using assets from `https://ota.tasmota.com/tasmota/gpioviewer/gpio_viewer_13_4_0/` v2.0.8 - Support for CST816S touch interface [#20213](https://github.com/arendst/Tasmota/issues/20213) diff --git a/tasmota/include/tasmota_types.h b/tasmota/include/tasmota_types.h index 1a37f6033..a415c847a 100755 --- a/tasmota/include/tasmota_types.h +++ b/tasmota/include/tasmota_types.h @@ -191,8 +191,8 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t zcfallingedge : 1; // bit 9 (v13.0.0.1) - SetOption155 - (ZCDimmer) Enable rare falling Edge dimmer instead of leading edge uint32_t sen5x_passive_mode : 1; // bit 10 (v13.1.0.1) - SetOption156 - (Sen5x) Run in passive mode when there is another I2C master (e.g. Ikea Vindstyrka), i.e. do not set up Sen5x sensor, higher polling interval uint32_t neopool_outputsensitive : 1; // bit 11 (v13.2.0.1) - SetOption157 - (NeoPool) Output sensitive data (1) - uint32_t mqtt_disable_modbus : 1; // bit 12 (v13.3.0.5) - SetOption158 - (MQTT) Disable publish ModbusReceived MQTT messages, you must use event trigger rules instead - uint32_t spare13 : 1; // bit 13 + uint32_t mqtt_disable_modbus : 1; // bit 12 (v13.3.0.5) - SetOption158 - (MQTT) Disable publish ModbusReceived MQTT messages (1), you must use event trigger rules instead + uint32_t counter_both_edges : 1; // bit 13 (v13.3.0.5) - SetOption159 - (Counter) Enable counting on both rising and falling edge (1) uint32_t spare14 : 1; // bit 14 uint32_t spare15 : 1; // bit 15 uint32_t spare16 : 1; // bit 16 diff --git a/tasmota/tasmota_xsns_sensor/xsns_01_counter.ino b/tasmota/tasmota_xsns_sensor/xsns_01_counter.ino index 245055c60..1483dd788 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_01_counter.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_01_counter.ino @@ -77,9 +77,13 @@ void CounterIsrArg(void *arg) { // restart PWM each second (german 50Hz has to up to 0.01% deviation) // restart initiated by setting Counter.startReSync = true; #ifdef USE_AC_ZERO_CROSS_DIMMER - if (index == 3) ACDimmerZeroCross(time); -#endif //USE_AC_ZERO_CROSS_DIMMER + if (index == 3) { ACDimmerZeroCross(time); } return; +#else + if (!Settings->flag6.counter_both_edges) { // SetOption159 - (Counter) Enable counting on both rising and falling edge (1) + return; + } +#endif //USE_AC_ZERO_CROSS_DIMMER } } diff --git a/tools/decode-status.py b/tools/decode-status.py index c6de2333d..980c00e64 100755 --- a/tools/decode-status.py +++ b/tools/decode-status.py @@ -213,8 +213,9 @@ a_setoption = [[ "(ZCDimmer) Enable rare falling Edge dimmer instead of leading edge", "(Sen5x) Run in passive mode when there is another I2C master (e.g. Ikea Vindstyrka), i.e. do not set up Sen5x sensor, higher polling interval", "(NeoPool) Output sensitive data (1)", - "(MQTT) Disable publish ModbusReceived MQTT messages, you must use event trigger rules instead", - "","","", + "(MQTT) Disable publish ModbusReceived MQTT messages (1), you must use event trigger rules instead", + "(Counter) Enable counting on both rising and falling edge (1)", + "","", "","","","", "","","","", "","","","", From f98c66fa8196ae15376c11b2f161d0a8858e8e41 Mon Sep 17 00:00:00 2001 From: Benjamin Nestler <101095581+benjaminnestler@users.noreply.github.com> Date: Wed, 14 Feb 2024 15:48:46 +0100 Subject: [PATCH 2/2] Show ARG_HINT as tooltip for Web UI configuration of Matter endpoints (#20723) * ADD: Show the argument hint(s) as tooltip of input box. * CHG: MATTER_ADD_ENDPOINT_HINTS_JS to change the tooltip relating to endpoint argument hint * CHG: Show the enpoint number in confirmation of deletion dialog. * CHG: Too reduce the number of used bytes for this JS * ADD: solidificated file --- .../berry_matter/src/be_matter_module.c | 1 + .../berry_matter/src/embedded/Matter_UI.be | 24 +- .../src/solidify/solidified_Matter_UI.h | 811 +++++++++--------- 3 files changed, 427 insertions(+), 409 deletions(-) diff --git a/lib/libesp32/berry_matter/src/be_matter_module.c b/lib/libesp32/berry_matter/src/be_matter_module.c index 693d090de..90176e59a 100644 --- a/lib/libesp32/berry_matter/src/be_matter_module.c +++ b/lib/libesp32/berry_matter/src/be_matter_module.c @@ -52,6 +52,7 @@ static const uint8_t MATTER_ADD_ENDPOINT_HINTS_JS[] = "function otm(arg_name,val){" "var s=eb(arg_name);" "s.placeholder=(val in hm)?hl[hm[val]]:\"\";" + "s.title=s.placeholder;" "};" ""; diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_UI.be b/lib/libesp32/berry_matter/src/embedded/Matter_UI.be index 5064bd3e8..9c1e082de 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_UI.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_UI.be @@ -329,8 +329,10 @@ class Matter_UI var cl = self.device.plugins_classes.find(typ) var arg = "" + var arg_hint = "" if cl != nil arg = cl.ui_conf_to_string(cl, conf) + arg_hint = cl.ARG_HINT end found = true @@ -338,11 +340,11 @@ class Matter_UI webserver.content_send(format("", ep, webserver.html_escape(conf.find('name', '')))) webserver.content_send(f"{self.plugin_name(conf.find('type', ''))}") - webserver.content_send(format("", - ep, webserver.html_escape(arg), cl ? webserver.html_escape(cl.ARG_HINT) : '')) - webserver.content_send(f"") i += 1 @@ -395,8 +397,10 @@ class Matter_UI var cl = self.device.plugins_classes.find(typ) var arg = "" + var arg_hint = "" if cl != nil arg = cl.ui_conf_to_string(cl, conf) + arg_hint = cl.ARG_HINT end found = true @@ -405,8 +409,8 @@ class Matter_UI ep, webserver.html_escape(conf.find('name', '')))) webserver.content_send(format("%s", self.plugin_name(conf.find('type', '')))) - webserver.content_send(format("", - ep, webserver.html_escape(arg))) + webserver.content_send(format("", + ep, webserver.html_escape(arg), webserver.html_escape(arg_hint))) webserver.content_send(f"