#25082·Tasmota

ShutterButton parser off-by-one for MQTT flags in Tasmota 15.6.0

Author: smartify-your-homeCreated Sep 28, 2026Updated Sep 28, 2026

https://github.com/arendst/Tasmota/blob/db3ae7e0276fdc38b7aeb241a2a8e33d8ffd6892/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino#L1403

https://github.com/arendst/Tasmota/blob/db3ae7e0276fdc38b7aeb241a2a8e33d8ffd6892/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino#L335

ShutterButton parser off-by-one for MQTT flags in Tasmota 15.6.0

I found what appears to be an off-by-one error in CmndShutterButton() in xdrv_27_esp32_shutter.ino.

Version: Tasmota 15.6.0 (release-tasmota32)
BuildDateTime: 2026-08-25T09:12:38
ESP32-U4WDH-D v3.1

The documented ShutterButton syntax is:

ShutterButton<x> <button> <p1> <p2> <p3> <ph> <m1> <m2> <m3> <mh> <mi>

However, in CmndShutterButton() the MQTT flags are assigned using:

setting.position[i-6].mqtt_broadcast

With i starting at 5 for the first MQTT parameter, this results in:

  • i=5 → position[-1]
  • i=6 → position[0] (single)
  • i=7 → position[1] (double)
  • i=8 → position[2] (triple)
  • i=9 → position[3] (hold)

Therefore the documented mh parameter is shifted by one position.

This can also be reproduced directly on the device.

Command:

ShutterButton1 2 -/++20 - - 100 - - - 1 -

Result:

{"ShutterButton1":"2 -/++20 - - 100 - - 1 -"}

The 1, intended for HOLD (mh), is stored as the triple-press MQTT flag instead.

Using one additional placeholder:

ShutterButton1 2 -/++20 - - 100 - - - - 1

sets the HOLD MQTT flag as intended.

This also affects the HOLD release behavior because ShutterButtonHandler() checks:

position[3].mqtt_broadcast

before calling CmndShutterStop() when the button is released after HOLD.

Could you please confirm whether position[i-6] should be position[i-5], or whether the documented ShutterButton syntax needs to be adjusted?

It also appears that the documented mi / mqtt_all parameter cannot be reached with the current parser loop/token limit.