Commit Graph
21471 Commits
Author SHA1 Message Date
s-hadingerandGitHub 944ad6de4b Zigbee multiple fixes (#24806) 2026-05-30 16:50:50 +02:00
Theo Arends 7edbc4b3d8 Add comments to dali 2026-05-30 16:42:40 +02:00
s-hadingerandGitHub 580b952dfd Artnet check datalen does not exceed payload length (#24805) 2026-05-30 16:41:20 +02:00
l-jonasandGitHub 6a142725c9 dali: allow using TM_DALI_SEND_TWICE for 3 byte frames (#24803)
This helps configuring input devices as they need frames of three bytes
length and need the command twice. Just calling DaliSend twice is not
enough for this due to the delay.
2026-05-30 16:30:33 +02:00
Theo Arends 46d0bd3425 Fix sensirion SEN6X intermittend detection 2026-05-30 15:59:02 +02:00
Theo Arends 1e815fc9e0 Update change logs 2026-05-30 15:23:28 +02:00
s-hadingerandGitHub eda9102237 Fix various bugs (#24802)
* Fix various bugs

* More fixes
2026-05-30 08:22:15 +02:00
s-hadingerandGitHub 44b5c49f86 Berry write(value:int | s:string) -> nil internal argument parsing (#24800) 2026-05-29 23:19:34 +02:00
s-hadingerandGitHub bd890c0ade Add missing break (#24801) 2026-05-29 16:06:37 +02:00
Theo Arends 5bb17bd275 Pre-populate decompressed rule cach (#24799) 2026-05-29 14:12:31 +02:00
s-hadingerandGitHub d3d33b452f Trigger events to Berry when 'USE_RULES' is not enabled (#24796)
* Trigger events to Berry when 'USE_RULES' is not enabled

* replace long with int32_t

* Fix SystemEventsSetNewPower signature
2026-05-29 13:41:31 +02:00
s-hadingerandGitHub a2032b7ec1 Fix Crash when MQTT-TLS when tcp connection failed (#24798) 2026-05-28 22:37:35 +02:00
7873a9f284 Matter Zigbee bridge: route per-endpoint friendly names to correct endpoint (#24709)
* Matter Zigbee bridge: route per-endpoint friendly names to correct endpoint

The Matter to Zigbee bridge mapped each Matter endpoint to a Zigbee
shortaddr only, losing endpoint information. For multi-endpoint
devices (e.g. 2-channel on/off relays), every Matter command routed
to Zigbee endpoint 1 and incoming reports updated all Matter plugins
targeting that device.

Changes in Matter_z_Zigbee.be:

* New "<device>:<N>" explicit syntax for per-endpoint targeting,
  e.g. zigbee_device:"my_device:2" routes Matter to Zigbee endpoint 2.

* Per-endpoint friendly name auto-resolution as a fallback: when no
  explicit ":N" is given and the config string is a non-hex name,
  the mapper queries ZbName once at first resolve and walks the
  response to find the source endpoint. Preserves the existing
  Tasmota convention of per-endpoint friendly names set via
  ZbName <dev>,<name>,<ep>.

* Outgoing: pass the original config string verbatim in the ZbSend
  Device field. ZbSend's parseDeviceFromName resolves per-endpoint
  friendly names natively. Adds explicit Endpoint field when known.

* Incoming: filter Matter_Zigbee.attributes_final by attr_list._src_ep
  when the mapper has a known endpoint. The frame parameter is
  always nil at this call site (caller passes nullptr), so the
  filter relies on the attribute list's source endpoint instead.

* Boot probe (probe_zb_values) is now endpoint-aware: triggers a
  ZbRead per attribute the plugin tracks for the specific endpoint.
  Avoids the previous merged-state pollution where probe pushed the
  same device.info() to all plugins targeting the same shortaddr.
  Single-endpoint configs keep the cheap cached probe (no extra
  Zigbee traffic).

Backwards compatibility preserved for shortaddr / integer / device-
level friendly name configs - default endpoint behavior is unchanged.

Tested on a 2-channel Zigbee on/off device paired to a Tasmota
Zigbee gateway, verified bidirectional in Apple Home.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Delet solidify file

---------

Co-authored-by: Paul de Monchy <paul.de.monchy@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
2026-05-28 19:56:04 +02:00
joluxerandGitHub 58b7d9d639 JsonParser: fix NULL deref on OOM in token buffer access paths (#24792)
On platforms without exceptions (-fno-exceptions, e.g. ESP8266),
new[] returns nullptr on allocation failure instead of throwing.
The missing NULL check caused a hard crash (load/store to address
derived from nullptr+offset) whenever the token buffer could not
be allocated.

Fix all four paths that dereference _tokens without a NULL guard,
and implement the existing TODO in parse() to ensure _token_len=0
invariant holds after OOM, consistent with the zero-error design.
2026-05-27 23:31:32 +02:00
Jacek ZiółkowskiandGitHub 38e2ce4884 add PowerTotal and ExportActiveTotal to JSON for multi-phase devices (#24790)
* add PowerTotal and ExportActiveTotal to JSON for multi-phase devices

* don't add the fields if SO129=1
2026-05-27 14:46:00 +02:00
s-hadingerandGitHub 4e73601214 Strip coc parser (cosmetic) 2026-05-27 14:11:33 +02:00
GrzegorzandGitHub 07154d430a MiELHVAC fix globals, VLA, duplicate JSON fields and float formatting (#24784)
* MIELHVAC New features and bug fixes

## Changelog

### Bug Fixes

**Memory leak in `miel_hvac_pre_init()`** — `goto del` jumped past the `free(sc)` label, leaking the allocated struct on serial init failure. Replaced with explicit `delete`/`free`/`return`.

**`remotetemp_clear` semantics inverted** — variable was `true` on boot causing a CLR frame to be sent before any sensor registered. Renamed to `remotetemp_active`, initialised `false`.

**`HVACSetPurify` used wrong map** — `airdirection_map` was passed instead of `purifier_map`.

**`0x08` Set Run State flags wrong byte order** — flags are little-endian on the wire (ref: muart-group/muart-group.github.io#17). Removed `htons()` from all `0x08` flag assignments.

**`widevane_isee` false positives** — values like `0x84`/`0x85`/`0x8c` (ISEE bit + position nibble) incorrectly reported `AirDirection:"even"`. Reverted to exact-match for `0x80`, `0x28`, `0xaa`.

---

### New Features

**`0x42` HVAC Options polling** — added `miel_hvac_data_hvac_options` struct and `MIEL_HVAC_REQUEST_HVAC_OPTIONS` request. The unit is polled for Purifier, NightMode and EconoCool state. Requires short request form (len=1). Results stored in `sc_hvac_options` and published in SENSOR and HVACSETTINGS when `cap_run_state=true`.

**Run State commands (`0x41 0x08`)** — new commands `HVACSetPurify`, `HVACSetNightMode`, `HVACSetEconoCool` and `HVACSetAirDirection` sent via `0x08` on units that report `cap_run_state=true`. Optimistic update to `sc_hvac_options` applied before confirmation.

**EconoCool** — `0x08` byte 14, flag `0x10`, COOL mode only. Command `HVACSetEconoCool on|off`.

**Base Capabilities (`0x5B 0xC9`)** — queried once after connecting. Parsed into `miel_hvac_capabilities`. Results published flat inside `MiElHVAC` as `*Supported` fields. Temperature ranges published as °C. Raw packet in `CapabilitiesHex`.

**Capabilities-aware command validation** — commands blocked when unit reports feature unavailable: modes (heat/dry/fan), temperature range from capabilities, fan speeds, run state commands return `NotSupported` or `ControlNotSupported`.

**`0x42` polling skip** — skipped on units with `cap_run_state=false`, eliminating recurring timeouts.

**`miel_hvac_append_settings_json()`** — shared helper replacing ~80 lines of duplicated JSON code between SENSOR and HVACSETTINGS topics.

---

### JSON Changes

- `Power` (W) and `Energy` (kWh) published inside `MiElHVAC` and also in a separate `ENERGY{}` object outside `MiElHVAC` for Home Assistant auto-discovery
- `Purifier`, `NightMode`, `EconoCool` shown in SENSOR and HVACSETTINGS when `cap_run_state=true`; otherwise omitted
- `AirDirection` always shows current state from `0x62 0x02` regardless of control support
- `*Supported` capability fields published flat inside `MiElHVAC`: `HeatSupported`, `DrySupported`, `FanSupported`, `VaneVSupported`, `SwingSupported`, `AutoFanSupported`, `OutdoorTempSupported`, `AirDirectionSupported`, `PurifierSupported`, `NightModeSupported`, `EconoCoolSupported`

---

### Tested on
MSZ-LN25VG2W — `cap_run_state=false`, temp ranges 16–31 °C cool/auto, 10–31 °C heat, 5 fan speeds.

* Extend AirDirection capability, added web ui energy sensor, cleanup

### AirDirection — respect i-See sensor presence

`AirDirection` now requires three conditions instead of just the vertical vane capability:
- `cap_vane_v` — unit has a vertical vane
- `sc_has_isee` — i-See sensor observed at runtime (widevane ever seen with bit `0x80`, or value `0x28`/`0xaa`)
- `cap_run_state` — unit supports `0x08` for control

Resulting behaviour:

| `cap_vane_v` | `sc_has_isee` | `cap_run_state` | `AirDirection` visible | `AirDirectionSupported` |
|:-:|:-:|:-:|:-:|:-:|
|  | — | — | hidden | `not_supported` |
|  |  | — | hidden | `not_supported` |
|  |  |  | shown | `control_not_supported` |
|  |  |  | shown | `on` |

Units with vertical + horizontal vanes but no i-See sensor now correctly report `AirDirectionSupported:"not_supported"` and omit `AirDirection` from both `MiElHVAC` and `HVACSettings` JSON.

### Capability field renames

For naming consistency across the `*Supported` fields:
- `cap_heat` → `cap_mode_heat`, `HeatSupported` → `ModeHeatSupported`
- `cap_dry` → `cap_mode_dry`, `DrySupported` → `ModeDrySupported`
- `cap_fan_mode` → `cap_mode_fan`, `FanSupported` → `ModeFanSupported`
- `cap_auto_fan` → `cap_fan_auto`, `AutoFanSupported` → `FanAutoSupported`
- `OutdoorTempSupported` → `OutdoorTemperatureSupported`
- `TempCool` / `TempHeat` / `TempAuto` → `SetTemperatureCoolMinMax` / `SetTemperatureHeatMinMax` / `SetTemperatureAutoMinMax`

### Energy values

- `Power` (W) and `Energy` (kWh) published both inside `MiElHVAC` and in a standard Tasmota `ENERGY{}` sub-object (`Power`/`Total`) for Home Assistant auto-discovery.
- Added Web UI rows via `FUNC_WEB_SENSOR` showing instantaneous power (W) and cumulative total (kWh) on the Tasmota main page.

### Runtime i-See detection

New `sc_has_isee` flag in `miel_hvac_softc`, set in `miel_hvac_input_settings` on the first widevane value indicating i-See state. Once set, stays set for the session.

**Practical note:** after boot, the flag starts `false`. Units with i-See that has never been activated since Tasmota started will show `AirDirection` as hidden until i-See is first used (via IR remote or `HVACSetAirDirection`). Safe default — prevents showing misleading values on units without i-See.

* MiElHVAC Full support of AirDirection control

* MiELHVAC fix globals, VLA, duplicate JSON fields and float formatting

## Summary

- **Remove file-scope globals** (`temp_type`, `remotetemp_active`,
  `remotetemp_auto_clear_time`, `remotetemp_last_call_time`,
  `remotetemp_half`): moved into `miel_hvac_softc` as `sc_temp_type`
  and `sc_remotetemp_*`. All references updated. Eliminates potential
  conflict with other drivers sharing the same translation unit.

- **Fix VLA in `miel_hvac_send`**: `char hex_d[(len + 1) * 2]` replaced
  with fixed-size `(MIEL_HVAC_DATABUFLEN + 1) * 2`. Variable-length
  arrays on the stack are disallowed by `-Wvla` and unreliable on
  embedded targets.

- **Make `temp_type` explicit**: helper functions `miel_hvac_deg2temp`,
  `miel_hvac_temp2deg`, `miel_hvac_roomtemp2deg` now take `bool
  temp_type` as a parameter. Detection of the extended encoding moved
  from render functions to `miel_hvac_input_data()`, removing a hidden
  side effect inside JSON serialisation code.

- **Remove duplicate JSON fields**: `Purifier`, `NightMode`, `EconoCool`
  were emitted twice (from both the settings block and the options
  block). Options block now only emits `OptionsHex`.

- **Fix `RemoteTemperatureSensorAutoClearTime` JSON type**: was
  serialised as a string (`"10000"`), now a proper JSON number (`10000`).

- **Bool consistency**: assignments `= 1` / `= 0` on `bool` fields
  replaced with `= true` / `= false`.
2026-05-26 10:23:30 +02:00
Theo Arends 6300b542ee Add define USE_ESP8266_DEBUG_HEAP to control (#24777) 2026-05-25 17:27:32 +02:00
joluxerandGitHub ba88358ed6 ESP8266: fix heap metric functions and add OOM diagnostics (#24777)
* ESP8266: fix ESP_getMaxAllocHeap() and ESP_getHeapFragmentation()

Both functions returned wrong values: ESP_getMaxAllocHeap() returned
ESP.getFreeHeap() (total free, not largest contiguous block);
ESP_getHeapFragmentation() read ummHeapInfo.maxFreeContiguousBlocks,
which is only valid immediately after a umm_info() heap walk.

Fix: cache the result of umm_max_block_size() in ESP_UpdateHeapMetrics().
The cache is refreshed once per second when SetOption130 is active, and
on demand in CmndStatus() before Status 4 is output. Both getter functions
read the cached value; the call site overhead is a single integer read.

umm_max_block_size() is unconditionally available (UMM_INFO is hardcoded
in the Arduino ESP8266 umm_malloc_cfg.h), so no build flags are required.

Status 4 (StatusMEM) gains two ESP8266-specific fields: MaxFreeBlock (KB)
and Frag (%).

* ESP8266: add heap OOM diagnostics, Status 4 fields, Status 44 dump

OOM event monitoring (requires UMM_INLINE_METRICS or UMM_STATS_FULL):
- ESP_HeapOomCheck(): called once per second; logs the OOM counter delta
  when the counter changes ("OOM: count N (+M)")
- ESP_HeapOomTest(): logs current OOM count on demand

Status 4 (StatusMEM) gains additional ESP8266-specific fields when the
corresponding build flags are active:
- OomCount: cumulative out-of-memory events (UMM_INLINE_METRICS or
  UMM_STATS_FULL)
- HeapLwm (KB): heap low-watermark since boot (UMM_STATS_FULL)
- MaxAllocSz (bytes): peak single allocation size (UMM_STATS_FULL)

Status 44 (ESP8266-only diagnostic command):
- Triggers umm_info(nullptr, true) to print a full heap block map to
  the serial console
- Calls ESP_HeapOomTest() to log the current OOM count
- Returns {"Status44":{"HeapDump":"serial"}}
- Status 44 is accepted regardless of MAX_STATUS

Build flags UMM_STATS_FULL and UMM_INLINE_METRICS can be enabled via
platformio_override.ini build_flags; documented in
platformio_override_sample.ini.
2026-05-25 17:25:04 +02:00
Jason2866andGitHub 166bb946bd fix pioarduino build (#24789) 2026-05-25 17:09:36 +02:00
Christian BaarsandGitHub ef35d7b6c6 Cleaner solidify (#24788) 2026-05-25 17:04:03 +02:00
Christian BaarsandGitHub 99fc7f87e7 use Tasmota Berry defines in coc (#24787) 2026-05-25 10:02:45 +02:00
s-hadingerandGitHub 3030d20ff0 Fix hallucinations in doc_for_ai (#24775) 2026-05-20 21:08:50 +02:00
Theo Arends ee0748a656 Update change logs 2026-05-20 14:00:18 +02:00
a027be81f6 Fix I80 pushColors swap logic for parallel displays (#24770)
Co-authored-by: Christian Baars <christianbaars@MacStudio-von-Christian.local>
2026-05-20 13:52:46 +02:00
Christian BaarsandGitHub 68635b9668 MI32: unify connection task (#24769) 2026-05-20 12:27:50 +02:00
Theo Arends fb424dca50 Add support for hosted MCU different from esp32c6 2026-05-19 15:35:34 +02:00
Theo Arends a90c539899 Update change logs 2026-05-19 12:28:34 +02:00
Frederick BlaisandGitHub e6d471f25f Add descriptor-driven ST7305 uDisplay packing (#24738) 2026-05-19 12:24:18 +02:00
Theo Arends 01d408ae6d Update change logs 2026-05-19 11:44:58 +02:00
Theo Arends bbd10227af Fix setting DISABLE_REFERER_CHK 2026-05-19 11:38:16 +02:00
Petr GolovachevandGitHub 0a5311c3ee VID6608: add hardware RMT support for Automotive gauge driver (#24759)
* Replace old software-defined library arduino-vid6608 with hw-defined esp-32-vid6608

* VID6608: Rework integration to allow select RMT/SW method by using the `VID6608_RMT` option

* VID6608: Tune library inclusion for RMT version

* The RMT version is not supported on ESP32-C2, library excluded
* Add more clear error message, if RMT is requested, but not supported
2026-05-18 17:40:13 +02:00
Petr GolovachevandGitHub dd1468b47e Fix for TasmotaLEDPusher configutation (#24760)
Library does not have user-defines include and ignores actual confiuration via `user_config_*.h` files
2026-05-18 11:08:02 +02:00
s-hadingerandGitHub 3734308857 Matter Device non nullable attributes (#24764) 2026-05-18 10:01:12 +02:00
Theo Arends f4aa8ed67f Increase security by inverting state of define DISABLE_REFERER_CHK, command SetOption128 controlling HTTP access which is now default off 2026-05-17 15:46:32 +02:00
Theo Arends a098a48242 Update change logs 2026-05-17 13:35:18 +02:00
Christian BaarsandGitHub 2666434b90 BearSSL: update SHA functions for breaking change of IDF 5.5 (#24757) 2026-05-17 13:21:37 +02:00
Theo Arends 2c2a28cae1 Fix HTTP invalid file type upload 2026-05-17 11:59:20 +02:00
s-hadingerandGitHub cfe25959cd Berry Matter improve async HTTP error handling (#24756) 2026-05-16 23:40:37 +02:00
Theo Arends 5009bea30b Fix scripter buffer overflow 2026-05-16 22:54:45 +02:00
Theo Arends 007e7b940c Update change logs 2026-05-16 21:32:01 +02:00
s-hadingerandGitHub 1ef3723300 Manual tool to compare and verify Berry solidification between C and Python (#24754) 2026-05-16 21:09:02 +02:00
Jason2866andGitHub 5bfdcca07f Clarify dns_save4 handling in IPv6 only case (#24752)
Added comments to clarify the handling of dns_save4 during IPv6 only scenarios.
2026-05-16 21:00:54 +02:00
Theo Arends eecf1ad142 Update change logs 2026-05-16 15:14:30 +02:00
Jason2866andGitHub e97673aab5 Disable USE_SHA_ROM in platformio_tasmota32.ini
Comment out USE_SHA_ROM to avoid issues with TLS.
2026-05-16 14:57:41 +02:00
91a33aa39f Add support for multi-byte chars like emojis (💡) in light device toggle buttons (#24482)
* Add support for multi-byte characters like emojis (💡) in WebButton labels for light device toggle buttons

- Remove the 3-character buffer truncation of light device toggle button labels allowing multi-byte characters like emojis
- Rely on CSS to handle truncation and add `max-width:0` to the td so it respects the provided percentage width instead of expanding to fit content
- Wrap button content in a span with overflow handling to prevent layout breakage

* Use localized `D_BUTTON_TOGGLE` for light device button default text

* Improve UTF-8 support in light device WebButton text

- Add `Utf8Truncate` function in `support.ino` to truncate UTF-8 strings to a max chars limit or max visual width limit
- Truncate light device button text to max 4 chars or max width of 4 before passing to button HTML template
- cache calls to GetWebButton so only called once and update bool var from `set_button` to `has_web_button`.

* Small tweaks to improve clarity in Utf8Truncate on codepoint limits and visual width handling

* Correctness fixes

---------

Co-authored-by: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
2026-05-16 14:28:22 +02:00
Allen SchoberandGitHub 90ed4a1b94 Fix URL detection and path handling in esp32_build_filesystem (#24748)
- Replace broken "http" and "://" in file condition with file.startswith(("http://", "https://")) — the original always evaluated "http" as truthy and only tested for "://".
- Strip whitespace and skip blank lines from custom_files_upload entries, matching the pattern in solidify-from-url.py.
- Resolve relative local paths against $PROJECT_DIR rather than the build-time CWD.
2026-05-16 14:25:28 +02:00
Allen SchoberandGitHub 47d53f1761 Add RGBW white blend and 10-bit gamma support to Berry LED pixel rendering so Berry animations render with the same color output as the standard Tasmota NeoPixel light driver. (#24750)
- Replace 8-bit per-channel math with 10-bit intermediates to preserve color ratios at low brightness.
- When SetOption105 (white blend mode) is enabled on a 4-byte RGBW strip, extract the minimum RGB component as a white channel (scaled by rgbwwTable[3]) rather than zeroing it, mirroring the logic in xdrv_04_light.ino.
- Gamma correction is applied via ledGamma10_10 throughout, including the extracted white channel.
2026-05-16 12:31:36 +02:00
Allen SchoberandGitHub 68d21ac2d7 Create tasmota_defines_for_berry.be stub before solidification if absent (#24749)
- solidify_all_python.be imports tasmota_defines during solidification, but the actual file is generated post-compilation by gen-berry-defines.py. If it doesn't exist yet, solidification fails. Create an empty stub before calling prepareBerryFiles so the import succeeds regardless of build order.
2026-05-16 12:28:22 +02:00
s-hadingerandGitHub e18035a6de Support for M5Stack Atom S3R drivers (#24747) 2026-05-15 22:37:48 +02:00