Help Sonoff - Tasmota 5.11.1e on HASS.io 0.63.2

This is situation:
I put everything in one file

After reboot:

image

configuration.yaml

Check configuration:

Sonoff configuration:

Module Config

MQTT config

Which MQTT server do you have running on 192.168.1.219?
What’s in the HA log (the circled i button on bottom right of the menu) and in Tasmota console?

As @namadori suggested three weeks ago - it looks like you do not have a working mosquito broker.

Ignore Home Assistant for now.

First - make sure you have Mosquitto (or whatever broker you have chosen) working at 192.168.1.219 If you do not have a working broker then nothing will work!

  • Is it starting?
  • Can you subscribe to it (eg with mosquitto_sub -u admin -P 12345 -v -t '\''#'\'' )?
  • Can you publish to it with mosquito_pub?

Second - make sure your Sonoff Basic is publishing to the broker

Third - restart Home Assistant and see if you are still getting errors

PLEASE do not publish screen shots of your configuration.yaml. Use 4 ticks “````” to quote code. See the blue box at the top of this page.

after changing the configuration on the sonoff as shown in the image below:

now everything works! thank you all.
now I have duw sonoff how to configure multiple brokers?

  • my second sonoff ip 192.168.1.220 (admin=12345)
# MQTT
mqtt:
  broker: 192.168.1.219
  port: 1883
  username: admin
  password: 12345

# SWITCH
switch:
# SONOFF
  - platform: mqtt
    name: "Sonoff 01"
    state_topic: "stat/sonoff01/POWER"
    command_topic: "cmnd/sonoff01/power"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    retain: true
# optimistic: false

  - platform: mqtt
    name: "Sonoff 02"
    state_topic: "stat/sonoff02/POWER"
    command_topic: "cmnd/sonoff02/power"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    retain: true
# optimistic: false

I give up here. I think you didn’t understand what MQTT is and you are not listening to any advice.

1 Like

absolutely, you’re wrong.
I have rechecked all the settings.
I made a rest of the original configuration.
I started from the beginning as you have advised me all.
the version of my Mosquitto broker 1.0
I left everything and now it’s ok.
I’m sorry if you think the advice was useless

I thank everyone for their valuable advice.

Enabling the WeMo emulation you are not using MQTT at all.

If you want to make MQTT work:

  1. you need a working MQTT Broker. Set it up and manage to connect to it with MQTT Spy (see my previous post) or command line (see @PianSom post). If you are on Hassio, the broker has the IP address of Home Assistant.

after you succesfully connect to your broker

  1. check if HA can connect to the broker. In your previous log it stated “connection refused”. That means one of these: wrong IP address, wrong username, wrong password, network problems.

after you succesfully connect HA to your broker (if you are on hassio you can see the connection in the Mosquitto add-on log)

  1. check if Sonoff can connect to the broker. You must see the connection in tasmota console.

you’re right, I do not connect to the mqtt of the sonoff.
I used mqtt spy as recommended by you.
the ip is correct, also correct username and password.
the network has no problem and through the device IP I reach their http interface

image

OK, I give up.

Why do you ask for advice then ignore it?

2 Likes

The red tab means MQTT Spy can’t connect to the broker. We are still at point 1.

  1. What’s the IP address of Home Assistant?
  2. Are you using Hassio? Go to the Hass.io page -> Mosquitto Broker -> Post here the content of the Options panel and Logs panel