[Solved] Wemos D1 Mini is unavailable in hassio after flashed with TASMOTA

Hello friends,

I flashed my Wemos D1 Mini with TASMOTA following the instructions from https://github.com/arendst/Sonoff-Tasmota/wiki/Home-Assistant.

The entries in my configuration.yaml file is as following:

# MQTT Broker
  broker: core-mosquitto
  username: !secret mqtt_username
  password: !secret mqtt_password
  discovery: true

# switch
  - platform: mqtt
    name: "Sonoff power"
    state_topic: "stat/sonoff/POWER"
    command_topic: "cmnd/sonoff/POWER"
    availability_topic: "tele/sonoff/LWT"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    retain: false

The MQTT config on my wemos is in the attached screenshot.

The switch is unavailable, as you can see in this screenshot.

Any ideas, what can I be doing wrong?

Does Sonoff connect to mqtt broker?
Check in console.

Change in ha configuration.yaml

Manually publish a MQTT packet (in the good topic) via HA’s Developer Tools and see what’s happening.

Thanks. Checked the console (didn’t know to do that before. I am quite the noob). Realised that it wasn’t connecting. There was a typo in the creds. It connected.
However, I have a new problem now. When I turn it “on” the relay “turns off” and vice versa. I vaguely remember reading somewhere that this is because of pull down / up resistors (I am not sure how to check which one I have).
I am guessing there is a place in the code to change that. Not sure. I don’t wanna make a reverse entry in configuration.yaml like below:

payload_on: "OFF"
payload_off: "ON"

My D1 mini responds correctly, But you can change in configuration (D1 mini web page) from 21 relay1 to 29 relay1i. This will invert the relay operation.

1 Like

Thanks. That resolved it.


my wemos D1 mini is not available on home assistant even with these configurations, and an other problem i have a 5v relay wired to D1 mini when i click on On or Off on sonoff webpage the relay is always on, noway to turn it off.