MQTT & Sonoff tasmota

Hello!
I have a relay sonoff s26 with Tasmota firmware.
I installed a mosquito broker in the home assistant (Raspberry pi3b, hassio system).
I configured the relay on the broker adress, login and password.
And write in configuration.yaml next code:

mqtt:
  broker: 192.168.1.10
  port: 1883
  username: user1
  password: password1
  client_id: home-assistant
  
switch:
  - platform: mqtt
    name: "sonoff_s26"
    state_topic: "stat/sonoff_s26/POWER/"
    command_topic: "cmnd/sonoff_s26/POWER/"
    availability_topic: "tele/sonoff_s26/LWT"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    state_on: "ON"
    state_off: "OFF"
    retain: true

As a result, a switch in lovelacecard appeared, but the switch button is not active.
Безымянный
I installed the MQTT client on the computer, and also configure him to broker in the homeassistant . Now from the computer I can control the relay, i.e. the broker is working.
If I press the setup button on the lovelacecardl, a message appears:
“This object does not have a unique identifier, therefore its settings cannot be controlled from the user interface.”
What other settings do you need to make the power button active? In the video tutorials that I saw, they do not do any additional actions, and this button is active and controls the relay. In the broker integration settings, I have the “auto search” switch

Remove the switch from your configuration.yaml, and in the tasmota console enter the following command :

setoption19 1

That is the easiest way to set it up.

1 Like

Thank you so much.
I did as you advised.
I had to remove the integration.
After the reboot, everything worked.
Thank you

FYI I have mine working through configuration.yaml:

switch:
  - platform: mqtt
    name: "S26 One"
    command_topic: "cmnd/sonoff-s26-switch-one/POWER"
    state_topic: "stat/sonoff-s26-switch-one/POWER"
    qos: 1
    optimistic: false
    payload_on: "ON"
    payload_off: "OFF"
    retain: true

You will need to ensure the actual switch is configured to connect to MQTT, you’ll know you have this correct when the switch console shows

23:54:17 MQT: Attempting connection...
23:54:17 MQT: Connected