Default Powen ON state Sonoff Tasmoto

Hi,
I have flashed my Sonoff RF with Tasmoto & using it with HA.
It works great.

I have the following issue.
How do I set Default Powen ON state Sonoff Tasmoto?

When Power reset’s or I switch off & Switch ON the physical switch I want the sonoff to TURN ON & stay as a default state.

But for me, the sonoff Turn’s ON for few seconds & switches OFF automatically, When Power reset’s or I switch off & Switch ON the physical switch

Am I Missing some MQTT code in yaml file or I need to make any settings in Sonoff config page?
Please help

Below is my Switch details from Configuration.yaml file

mqtt:
** broker: core-mosquitto**
** username: admin**
** password: admin**


switch 01:
** platform: mqtt**
** name: “Mirror Light”**
** command_topic: “cmnd/sonoff00/power”**
** state_topic: “stat/sonoff00/POWER”**
** qos: 1**
** payload_on: “ON”**
** payload_off: “OFF”**
** retain: false**

You have to set the power on state through the tasmota web gui. Dr zzz’s has done a great you tube video on tasmota commands . I did mine through the tasmoadmin (formerly sonweb) addon which is also brilliant so that’s another option

1 Like

Thanks for the Reply
I have set PowerON state in tasmato UI as 1 (I.e as per documentation is PowerOnState | 1 | on | Turn relay(s) on after power on)

But still i dont get it working, Do you have any idea what am missing?
Is my MQTT over rides that ?? if so how to resolve??

Please help

I don’t think it’s anything in the mqtt commands unless you set retain state to true. There is something in the tasmota wiki page that explains why that’s not always a good idea.

I didn’t get on with understanding the command line commands very well. It didn’t seem to change the state hence discovering the tasmoadmin was a revelation. I suggest trying that instead it really is great

Finally, I found this working
Below are the settings which i have made

In Sonoff Tasmoto Firmware Web UI
Power On State: 1
Power Retain State: 1

In my HA Config.yamal
retain = false

Code as below

switch 01:
platform: mqtt
name: “Mirror Light”
command_topic: “cmnd/sonoff00/power”
state_topic: “stat/sonoff00/POWER”
qos: 1
payload_on: “ON”
payload_off: “OFF”
retain: false

Thank You all