Sonoff Touch shows always unavailable

Hi all,

I have a Sonoff Touch sucessfully flashed with the latest Tasmota firmware.
I also have mosquitto running on my raspberry.
But I don’t get the Sonoff Touch in my home assistant

Here my configs:

mqtt:
broker: 127.0.01
port: 1883
client_id: home-assistant-1
keepalive: 60
username: homeassistant
password: xxxxxxx
protocol: 3.1

Switch:

  • platform: mqtt
    name: “On/Off Sonoff”
    state_topic: “tele/sonoff/STATE”
    value_template: ‘{{ value_json[“POWER”] }}’
    command_topic: “cmnd/salon/POWER”
    availability_topic: “tele/salon/LWT”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”
    payload_available: “Online”
    payload_not_available: “Offline”
    retain: true

and the settings of the Sonoff touch

But in home assistant I see the switch only as unavailable

Who can help me?

Thanks all

The client id must be unique for each client - so they mustn’t be the same for the sonoff (or any other sonoff) and home assistant.

If there is still a problem after changing that, can you connect to the broker using another client and see what is being sent. For instance

mosquitto_sub -t "#" -v -u homeassistant -P xxxxx

Is that a direct copy from your config? IP address is missing a . if so, should be 127.0.0.1. Try the actual IP of the device instead too, and the host details on the sonoff as xx.xx.xx.xx:1883

1 Like

thank you both
change the IP and also changed the client id
but still in home assistant I get only unavailable

with another client I get following output:

tele/sonoff/LWT online
tele/hass1/LWT Online
stat/sonoff/POWER ON

got it now

change

availability_topic: “tele/salon/LWT”

to

availability_topic: “tele/hass1/LWT”

1 Like