-
Notifications
You must be signed in to change notification settings - Fork 1
Tips
Find below some background and other information.
Initially I had one MQTT configurable topic planned called TOPIC but soon found out that when two sonoffs come online with the same topic this would be a challenge at least...
I then introduced a unique, non-configurable topic which I call fallback topic that allows me to always change the MQTT configurable topic to a new unique topic. This fallback topic is just what it is meant to be: A FALLBACK TOPIC in case of emergency.
All MQTT status messages will be sent using the configurable TOPIC which should be made unique by the user. It might be called bedroom but it could also have been called titanic10 as long as the user knows what it is and where to find it.
Having two sonoffs with the same topic allowed for MQTT commands to be sent once to make them act in sono. That inspired me to add a third topic to subscribe to which I call GROUPTOPIC. Sonoffs with the same GROUPTOPIC will react to the same MQTT command. I use it to update firmware to all my sonoffs using separate groups for plain sonoff, pow sonoffs and th sonoffs.
BTW changing TOPIC can be done online using the fallback topic and is only needed once. There is no need to change user_config.h all the time, as many users seem to think they have to do with any new release. All changes are stored in flash and I make a lot of effort to keep these changes available between versions.
-
To stop saving parameter changes to Flash or Spiffs use command
SaveData off
. -
To stop saving power changes only to Flash or Spiffs use command
SetOption0 off
. This will disable the relay from returning to the same state after power on UNLESS you use the MQTT retain flag in which case the MQTT broker will send the last known MQTT state on restart or power on. The commandButtonRetain on
will configure the button to send a MQTT command with Topic and the MQTT retain flag set.
-
For debugging purposes you can use the serial interface with command
SerialLog 4
and the Arduino IDE set to 115200 baud (19200 for Sonoff Dual) and both NL & CR or the web console with commandWebLog 4
. -
Debugging the Sonoff Pow is a bit tricky as the serial interface has a direct connection to one of the AC power lines. I designed below schematic using two opto couplers seperating the AC connection on the left from the low voltage connection on the right allowing for serial control at 115200 baud and uploading of firmware up to 57600 baud while AC is connected.
- To aid in finding the IP address of sonoff the network name will be
<MQTT_TOPIC>-<last 4 decimal chars of MAC address>
. So the default name issonoff-1234
. Another option is MQTT commandStatus 5
.
Home | Wiki | What's new | Tutorials | FAQ | Troubleshooting | Button usage | Commands | Rules
Home
Theo's Tasmota Tips
What's New
Getting Started
Upload tools
- SonOTA
- OTA over SCP
- Esptool
- Arduino IDE
- PlatformIO
- PlatformIO CLI
- Visual Studio Code
- Python HTTP OTA server
- Node Red OTA server and firmware manager
Usage
- Button Functionality
- MQTT Features
- Supported Commands
- Using Rules
- Sensor Configuration
- PowerOnState Configuration
- SwitchMode/SwitchTopic
- Button Multipress
- Energy Saving
- KNX Features
- Misc. Tips
Devices - Additional Info
- Sonoff Basic
- Sonoff SV
- Sonoff S20 Smart Socket
- Sonoff S26 Smart Socket
- Sonoff Dual / Dual R2
- Sonoff 4CH / 4CH Pro
- Sonoff RF and Slampher
- Sonoff RF Bridge 433
- Sonoff Pow / Pow R2
- Sonoff Touch
- Sonoff T1
- Sonoff B1 / B1 R2
- Sonoff iFan02
- Sonoff SC
- Sonoff PSA
- Sonoff S31
- Shelly 1 and 2
- Wemos D1 R1 & R2
- Wemos D1 Mini
- HuaFan Smart Socket
- Hyleton-313 Smart Plug
- MagicHome LED controller
- H801
- Arilux LC02
- SP108E LED controller
- Blitzwolf SHP2
- Tuya Dimmer
- PS-16-DZ Dimmer
- Armtronix Dimmers
- Other Devices
- retired
Home Automation Integration
- OpenHAB
- Home Assistant
- Domoticz - Manual configuaration
- Domoticz - Automatic discovery
- HomeBridge
- HomeSeer
- SmartThings
- IP-Symcon
- IOBroker
- TasmoAdmin
- Alexa
- Yeti
- NodeRed Examples
- Securing your Setup
Other Integrations
Further Topics
- MQTT Overview
- Remote Button
- Modified Kaku
- PZEM004T Energy Monitor
- IR Extension
- S20 sensor
- Wiring additional things to a module
- Sonoff Basic DHT11 Wiring
- Expand Sonoff 4CH with jack plug
- Defining new module types
- GPIO Locations
- JSON Status Responses
- Expand Sonoff Basic to 4MB Flash
- Time Proportioned Output support
- PID Control with Sonoff Devices
- Sensor-API
- Sensors Supported by Tasmota
- Syslog Setup
ESP32
Misc