Sonoff mini tasmotized with ver 6.6- Not behaving as expected

I"m on the latest version of Hassio.
I have tasmotized a couple of Sonoff Minis wtih V6.6
TasmoAdmin can see all the Minis and can control them correctly.

  1. I am able to control them through the UI only when the payload is “2” as noted below. If I use a payload of “ON” and “OFF” I can only turn them ON, the OFF does not work.

  2. The switch in the UI is acting like a momentary switch or button. When I click it, it turns on and then turns off. The mini will toggle correctly, but I have no visibility of the status, since the switch flipped to the off status. (I read something similar that was fixed on Tuya devices)

  3. I can correctly control the Mini using the MQTT under Developer tools with the following commands:
    topic:
    cmnd/tas02_stairs_light/POWER
    payload:
    ON or OFF or Toggle or 1 or 0 or 2 (they all work correctly)

Here is the config for one of them

  - platform: mqtt
    name: "Tas02_stairs_light"
    state_topic: "stat/tas02_stairs_light/RESULT"
    value_template: '{{ value_json["POWER1"] }}'
    command_topic: "cmnd/tas02_stairs_light/POWER1"
    availability_topic: "tele/tas02_stairs_light/LWT"
    qos: 1
    payload_on: "2"
    payload_off: "2"
    payload_available: "Online"
    payload_not_available: "Offline"
    retain: true 

Try:

payload_on: "ON" 
payload_off: "OFF"

Hope it helps.

I have tried on/off and it did not work. As I mentioned, with on/off, when I use the UI switch, I can only turn the switch on…

Try with:

 retain: false

And I believe you’ll need to clear the retain topic as well.
I use MQTT explorer for tasks like this.

Hope it of help.

Did you use setoption19 1. This should set up everything correct in ha

Thanks for the effort.

I changed per your feedback to:

  - platform: mqtt
    name: "Tas02_stairs_light"
    state_topic: "stat/tas02_stairs_light/RESULT"
    value_template: '{{ value_json["POWER1"] }}'
    command_topic: "cmnd/tas02_stairs_light/POWER1"
    availability_topic: "tele/tas02_stairs_light/LWT"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    retain: false

and now at least the On/OFF is working correctly where from LL UI I can control the switch.

The biggest issue to resolve is the behavior of the switch acting like a momentary switch.

I used the tasomota console and issued “setoption19 1”, this did not change the behavior of the switch (see item 2).

Not sure what issue the setoption19 was address…

Thanks for feedback

This thread may be worth a read:

Hope it’s of help.

Added info, I used the following template for the Sonoff Mini

{"NAME":"Sonoff Mini","GPIO":[17,0,0,0,9,0,0,0,21,56,0,0,255],"FLAG":0,"BASE":1}

I’ll give it a shot and advise…

Did not work. The Switch still acts as momentary…

I changed the the state_topic:

Form
  state_topic: "stat/tas02_stairs_light/RESULT"  
To
  state_topic: "stat/tas02_stairs_light/POWER"  

This seems to fix the issue with the Switch acting as a momentary. Now it behaves as toggle switch.
I do not understand it, if someone does, please expand so others…