TasmotaManager/docs/CONSOLE_COMMANDS.md
Mike Geppert 9c22168f79 Refactor: Split TasmotaManager into modular structure
- Created modular Python files (main, utils, discovery, configuration, console_settings, unknown_devices, reporting, unifi_client)
- Moved documentation files to docs/
- Moved data files to data/
- Removed old monolithic TasmotaManager.py and TasmotaManager_fixed.py
- Updated .gitignore and pyproject.toml
- All functionality preserved, command-line interface unchanged
Version: 2.0.0
2025-10-29 16:38:03 +00:00

6.6 KiB

Tasmota Console Commands Documentation

This document provides detailed information about the console commands used in the network_configuration.json file, particularly focusing on the SetOptions commands.

Console Section in network_configuration.json

The console_set section in the network_configuration.json file is now a dictionary of named command lists. This lets you define multiple sets (profiles) and choose one per device via device_list. These settings are applied during processing.

{
  "console_set": {
    "Default": [
      "SwitchRetain Off",
      "ButtonRetain Off",
      "PowerOnState 3",
      "PowerRetain On",
      "SetOption1 0",
      "SetOption3 1",
      "SetOption13 0",
      "SetOption19 0",
      "SetOption32 8",
      "SetOption53 1",
      "SetOption73 1",
      "rule1 on button1#state=10 do power0 toggle endon"
    ],
    "alt": [
      "SwitchRetain Off",
      "ButtonRetain Off",
      "PowerOnState 3",
      "PowerRetain On",
      "SetOption1 0",
      "SetOption3 1",
      "SetOption4 1",
      "SetOption13 0",
      "SetOption19 0",
      "SetOption32 8",
      "SetOption53 1",
      "SetOption73 1",
      "rule1 on button1#state=10 do power0 toggle endon"
    ]
  }
}

MQTT Retain Settings

Important Note: For all Retain parameters, the TasmotaManager script automatically sets the opposite state first before applying the final state specified in the configuration. This is necessary because the changes (not the final state) are what create the update of the Retain state at the MQTT server. The values in the configuration represent the final desired state.

Command Values Description
SwitchRetain On, Off Controls whether MQTT retain flag is used on switch press messages. Default: Off
ButtonRetain On, Off Controls whether MQTT retain flag is used on button press messages. Default: Off
PowerRetain On, Off Controls whether MQTT retain flag is used on power state messages. Default: Off

For example, if you specify "PowerRetain": "On" in your configuration:

  1. The script will first set PowerRetain Off
  2. Then set PowerRetain On

This ensures that the MQTT broker's retain settings are properly updated.

Power Settings

Command Values Description
PowerOnState 0 to 4 Controls the power state when the device is powered up:
0 = Off
1 = On
2 = Toggle
3 = Last state (default)
4 = Turn on if off after restart

SetOptions

SetOptions are special commands that control various aspects of Tasmota device behavior. Below are the SetOptions currently used in the configuration:

Command Values Description
SetOption1 0, 1 Controls whether a button press toggles power or sends a MQTT message:
0 = toggle power (default)
1 = send MQTT message
SetOption3 0, 1 Controls MQTT enabled/disabled:
0 = disable MQTT
1 = enable MQTT (default)
SetOption4 0, 1 Return MQTT response as RESULT or %COMMAND%:
0 = RESULT (default)
1 = %COMMAND%
SetOption13 0, 1 Controls whether a button press clears retained messages:
0 = disable (default)
1 = enable
SetOption19 0, 1 Controls Home Assistant auto-discovery:
0 = disable (default)
1 = enable
SetOption32 1 to 250 Time in minutes to hold relay latching power before reset. Default: 1
SetOption53 0, 1 Controls display of hostname and IP address in GUI:
0 = disable (default)
1 = enable
SetOption73 0, 1 Controls whether HTTP cross-origin resource sharing is enabled:
0 = disable (default)
1 = enable

Additional SetOptions

Here are some other useful SetOptions that can be added to the configuration:

Command Values Description
SetOption0 0, 1 Save power state and use after restart:
0 = disable
1 = enable (default)
SetOption8 0, 1 Show temperature in Celsius or Fahrenheit:
0 = Celsius (default)
1 = Fahrenheit
SetOption10 0, 1 When the device restarts, the LWT message is sent:
0 = disable (default)
1 = enable
SetOption11 0, 1 Swap button single and double press functionality:
0 = disable (default)
1 = enable
SetOption20 0, 1 Update of Hass discovery messages:
0 = disable (default)
1 = enable
SetOption30 0, 1 Enforce Home Assistant auto-discovery as light:
0 = disable (default)
1 = enable
SetOption31 0, 1 Disable status LED blinking during Wi-Fi and MQTT connection issues:
0 = LED enabled (default)
1 = LED disabled
SetOption36 0 to 255 Boot loop control:
0 = disable (default)
1 to 200 = enable with number of boot loops before entering safe mode
SetOption52 0, 1 Control display of optional time offset from UTC in JSON messages:
0 = disable (default)
1 = enable
SetOption65 0, 1 Device recovery using fast power cycle detection:
0 = disable (default)
1 = enable
SetOption80 0, 1 Enable Alexa support for devices with an ESP8266 over 1M flash:
0 = disable
1 = enable (default)
SetOption82 0, 1 Reduce the CT range from 153..500 to 200..380 to accommodate with Alexa:
0 = CT ranges from 153 to 500 (default)
1 = CT ranges from 200 to 380 (Alexa compatible)

Rules

Rules allow you to create simple automations directly on the Tasmota device.

Automatic Rule Enabling

When you define a rule (e.g., rule1, rule2, rule3), the TasmotaManager script will automatically enable it by sending the corresponding enable command (Rule1 1, Rule2 1, Rule3 1) to the device. This means you only need to include the rule definition in your configuration, and the script will handle enabling it.

Command Values Description
rule1 Rule expression Defines the first rule. Example: on button1#state=10 do power0 toggle endon
rule2 Rule expression Defines the second rule.
rule3 Rule expression Defines the third rule.

Note: You no longer need to include the Rule1, Rule2, or Rule3 commands in your configuration as they are automatically applied. If you do include them, they will still be processed, but they are redundant.

For more information about Tasmota commands, visit the official Tasmota documentation.