Skip to content

Instantly share code, notes, and snippets.

@calexandre
Last active February 8, 2022 15:12
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calexandre/e384b98476c5725e42708028f5e4cb23 to your computer and use it in GitHub Desktop.
Save calexandre/e384b98476c5725e42708028f5e4cb23 to your computer and use it in GitHub Desktop.
Tasmota Cheat Sheet

TASMOTA CHEAT SHEET

Reference: https://tasmota.github.io/docs/Commands/

General flashing commands

# clear flash remnants
reset 5

# Find relays
{"NAME":"Discovery","GPIO":[0,0,0,0,21,22,0,0,23,24,25,26,27],"FLAG":0,"BASE":18}

# Save power state and use after restart (=SaveState)
# 0 = disable
# 1 = enable (default)
SetOption0 0
SetOption0 1

# UTC timezone
timezone 0

# Portugal Timezone DST
backlog timezone 99; timedst 0,0,3,1,1,60; timestd 0,0,10,1,2,0


# Enable discovery 
# For a Tasmota device to be automatically discovered by Home Assistant you need to enable MQTT discovery with command:
SetOption19 1

Random Commands

# Control power state when the device is powered up. More information
# 0 / OFF = keep power(s) OFF after power up

# 1 / ON = turn power(s) ON after power up
# useful if you have a dumb switch
PowerOnState 1

# 3 = switch power(s) to their last saved state (default)
PowerOnState 3

Sockets

Blitzwolf SHP6 10A

Tasmota: https://templates.blakadder.com/blitzwolf_SHP6.html

{"NAME":"BW-SHP6 10A","GPIO":[158,255,56,255,0,134,0,0,131,17,132,21,0],"FLAG":0,"BASE":45}

Power Calibration: https://tasmota.github.io/docs/#/Power-Monitoring-Calibration

# Verify the Power reading in the web UI (optionally with the power meter as well) for the expected wattage. Adjust the power offset if needed (in Watts):
# If you're using something other than a 60W bulb, enter your load's power rating
PowerSet 60.0

# Verify the Voltage reading. Adjust the voltage offset if needed (in Volts):
VoltageSet 240

#Verify the Current reading by calculating current value (amperage) using this formula: P(W)/V(V)=I(A). Adjust the current offset if needed (in milliAmps (mA=A*1000)):
CurrentSet 250

Confirm the validity of your calibration process checking Power Factor from the web UI which should be as close as possible to 1.00. In theory resistive loads will always provide a power factor of 1.00. If that is not the case, we recommend you repeat the calibration process and make sure everything was done correctly.

Sonoff Basic

Disable relay on switch

# Two possible methods:

# 1. create a rule (prefered)
rule1 on switch1#state do publish %topic%/stat/custom/switch-2 {"STATE":"TOGGLE"} endon

# Enable or disable rules
rule1 off
rule1 on

# 2. disable the relay by setting the initial state
# More info: https://tasmota.github.io/docs/#/PowerOnState?id=poweronstate-functionality
PowerOnState 4 # Relay is always on
PowerOnState 3 # Default

Lights

More info here: https://tasmota.github.io/docs/#/Lights?id=pwm-ct

# Enable fade
backlog fade 1; speed 4;

# WhiteBlend mode enable
RGBWWTable 255,255,255,255,0
# Disable
RGBWWTable 255,255,255,255,255

E27 BlitzWolf LT21 RGBWW

{"NAME":"BlitzWolf LT21","GPIO":[0,0,0,0,0,39,0,0,38,0,37,40,0],"FLAG":0,"BASE":18}

E27 Bawoo (TV-Light 1)

# Disabled white channel - Scenes work OK on HA
{"NAME":"E27 RWBW Bawoo","GPIO":[0,0,0,0,0,0,0,0,38,39,37,0,0],"FLAG":0,"BASE":18}

# The white channel works strangely - Scenes always resetting the white
{"NAME":"E27 RWBW Bawoo","GPIO":[0,0,0,0,40,0,0,0,38,39,37,0,0],"FLAG":0,"BASE":18}

E14 AliExpress Lights (Spotlight 1|2)

# RGBCCT Standard
{"NAME":"E14 RGBCCT","GPIO":[0,0,0,0,40,41,0,0,38,39,37,0,0],"FLAG":0,"BASE":18}

# Mode WW
{"NAME":"E14 WW","GPIO":[0,0,0,0,37,38,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
# GPIO Config and PWM
GPIO4   White   PWM4(40)
GPIO5   Wharm   PWM5(41)
GPIO12  Green   PWM2(38)
GPIO13  Blue    PWM3(39)
GPIO14  Red     PWM1(37)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment