* Add BLE timeout and eQ3 TRV enhancements
- Add a configurable BLE connection timeout and default it to 15 seconds (`BLEConnTimeout`)
- Improve eQ3 device detection
- Harden eQ3 advertising parsing
- Request and report TRV firmware version
- Add an option to disable the use of aliases in eQ3 MQTT topics (`TRVAliasAsTopic`)
* Comment MAC prefix
* Add localized eQ3 TRV status labels
This PR adds missing translation strings for eQ3 TRV status indicators and updates the BLE driver to use localized labels instead of hardcoded text.
* Strikethrough key
- Update EQ3-TRV driver to handle encrypted custom firmware advertisement by using `MIDecryptPayload` from `xsns_62_esp32_mi_ble`
- Enhance and lean WebUI generation
- Rework of the eQ-3 TRV device view to show a compact status row
- Use shared signal-strength indicator styling and remove duplicate CSS from Zigbee and MI BLE pages.
- Extend the MQTT payload with `BattVolt` field
- Fix regression from PR #25024, which accidentally broke the layout and rendering of the WiFi configuration page,
- The WiFi status line now includes richer tooltip text with SSID, RSSI, and AP details.
* Fix MI32 battery polling and period handling
- Add a dedicated hourly battery polling cycle for BLE devices, independent of the normal `MI32Period` / `TelePeriod` interval. This extends the battery life of the BLE devices, especially the LYWSD02MMC.
- Avoid redundant active reads for LYWSD02/03 sensors.
- `lastTime` is updated whenever temperature, humidity, or battery data is received.
- `MI32Period 1` correctly resets internal counters and trigger an immediate active polling cycle.
- `MI32Period 0` now correctly disables the active polling.
- Add device type to the title.
* Fix pollSeconds
* Multiline tooltip formatting
Split tooltip in two lines.
Adjust tooltip CSS to allow manual line breaks on mobile devices.
* Optimize tooltip position
* Update HTTP_HEAD_STYLE_TOOLTIP.h
* [EQ3-TRV] Next part of code refactoring
- Update command description
- Correct and optimize filter and identification logic (Alias, Name, MAC address)
- Optimize logic for mode in result
- Correct and optimize logic for hassmode in result
- Add `Mode` to UI incl. enhancement of language files
- Tighten types (use bool/uint8_t)
- Harden some input validations
- Many other simplifications and improvements
* ValvePos, device identification
- Rename DutyCycle to ValvePos
- Simplify identification logic
- Make BLE remark smaller
* [EQ3-TRV] More code refactoring
Here is the next major refactoring of the EQ3/TRV ESP32 BLE driver.
Below are the key highlights, alongside many other changes:
* **Optimize data presentation:** Hide sensor data in the Web UI if it is too old.
* **Minimize RAM footprint:** Sort `eq3_device_t` structure members to eliminate compiler memory padding.
* **Robust subcommand queue:** Rework command queue handling utilizing C++ container types to completely prevent memory leaks and minimize heap fragmentation.
* **Streamline device discovery:** Rework `Add device` logic to improve search performance and adapt to an index-free approach.
* **Decouple timeout handling:** Move slot cleanup into the cyclic `EQ3EverySecond` task for deterministic background execution.
* **Smart poll scheduling:** Rewrite polling routines to distribute requests evenly over `EQ3Period` while preventing Bluetooth stack congestion.
* **Unify command syntax:** Change CLI/MQTT commands from `TRV <CMD>` to `TRV<CMD>`.
* **Improve type safety:** Introduce strongly-typed `enum` definitions for driver operation results.
* **Modern C++ practices:** Replace legacy index-based arrays with range-based for loops (*for-each*) when possible.
* Uppercase TRV
* Simplify prefix matching
Large refactor of the EQ3/TRV ESP32 BLE driver. The primary goal was to replace `strcmp`-based logic in TRV subcommand handling with an index-driven approach.
Additional improvements included:
* Optimizing ESP32 memory management using `constexpr` and removing obsolete `PSTR` and `PROGMEM` statements
* Adjusting variable types for better efficiency
* Improving overall code readability
* Enabling safer, compile-time constants
These changes reduce binary size, flash usage, RAM footprint, and CPU overhead.
Functional behavior remains entirely unchanged.
* [EQ3-TRV] Update parsing and logging
Here are a lot of optimizations for parsing the command data. They make it smaller and saver.
Some adjustments of the log logic.
Cleaning up code in common.
* Fix MAC in Log
* Adapt `BLEDebug` to common command syntax
Adapt `BLEDebug` to common command syntax:
- `BLEDebug` - show debug logging status
- `BLEDebug 0` - turn off
- `BLEDebug 1` - turn on
A bit code cleanup without functional changes.
* More cleanup
* Implement per-level BLE logging
Replace the single BLEDebugMode flag with a BLELogLevel[] array and route BLE logging through per-level checks. Added a fast path in AddLog to skip loglevel==0. Updated the BLEDebug command to set and show per-level log values, and replaced conditional BLEDebugMode checks across BLE driver and MI/EQ3 modules with AddLog(BLELogLevel[...]) calls. Miscellaneous whitespace/help text tweaks included.
Clear the BLERunningScan flag when starting a new BLE operation to ensure proper state management. This prevents the scanning state from persisting incorrectly across operations.
* [Zigbee] Use `WebColor` for map visualization
The color theme is now also used for the Zigbee map visualization.
* Fix compile error
* Update xdrv_23_zigbee_7_5_map.ino
* [Zigbee] Several code optimizations (no functional changes)
- Added SPACE between light color and value regarding to other value presentations
- Removed the 'json' parameter from ZigbeeShow, as it is not used
- Simplified code
* Review
* Optimize Zigbee button <style>
Simplifies and unifies code to save space
* [Zigbee] Fix negative tuya values
* Update xdrv_23_zigbee_A_impl.ino
- Added SPACE between light color and value regarding to other value presentations
- Removed the 'json' parameter from ZigbeeShow, as it is not used
* Revert code optimizations
* get32IBigEndian
- Changed RSSI display format to 'xx% (-yy dBm)' in EQ3 TRV and MI BLE sensor WebUI
- Show BLE data in WebUI only when BLE is enabled
- Disable BLE when device is in boot loop
* Tweaks at timer setting page
* Sort all language files
* Rename D_TIME to D_TIME_OF_DAY
Improve the meaning of `D_TIME` -> `D_TIME_OF_DAY`
* Update xdrv_09_timers.ino
* Update xdrv_09_timers.ino
' ' -> ' '
* Update xdrv_09_timers.ino
Use same compressed and uncompressed code of HTTP_FORM_TIMER4
* Update xdrv_09_timers.ino
* Optimize WiFi strength indicator
- Simplify `WifiGetRssiAsQuality`
- Make WiFi strength indicator in web status line color independent
- Correct count of visible bars in strength indicator
- Save flash space (64 bytes; with WiFi status line 80 bytes)
- Highlight connected SSID/AP in settings with compiler option `USE_HIGHLIGHT_CONNECTED_AP` (needs additional 256 bytes)
* Change format of RSSI display
* Update web UI styles and HTML syntax
Merged HTTP_HEAD_STYLE2 into HTTP_HEAD_STYLE1 and removed redundant style files. Updated button and form HTML across web UI to use consistent markup. Adjusted various style and separator elements for improved HTML5 compliance and consistency.
* Fix WiFi config page
* Fix typo
* Revert merging HTTP_HEAD_STYLE
Revert merging `HTTP_HEAD_STYLE1.h` and `HTTP_HEAD_STYLE2.h`
- Fix handling, when using hardware sensor for EnergytTotal (SO72)
- Fix restore values, when device is off over midnight and power supply is unstable while powering on at the next day
* [Shutter] Fix html table syntax
The html code for the slider was placed in a `<table>` but not fenced with `<tr>` / `<td>` tags. So the browser placed it "randomly" outside of the table.
* [Shutter] revert date
The separator (request) flag has to be cleared before starting the output of sensors/drivers to ignore previous outputs. So there will no seperator in front of the list. This only appeared, when `WebTime` is off.
* Multilingual fixes
Some fixes for a better user experience matching every language.
* Revert frag mem
Solved problem with regional decimal conversion in language file.
As the label of the upload button is concatenated at runtime, this does not match in all languages. To solve this, there is now a full label text for `Start upgrade` and `Start restore`.
* [WebUI] WiFi Information
Structured and more infos on WebUI Information page
* [WebUI] WiFi Info multiple lines
Divide one long line into multiple short lines
* [DS18x20] Enhance use of aliases
`defineDS18x20_USE_ID_AS_NAME`:
Always show part of the address, even for one sensor
`#define DS18x20_USE_ID_ALIAS`:
The command `DS18Alias` can now be use with alphanumeric aliases, which replace the sensor name
* [DS18x20] change to calloc()