Adding first Tasmota device. Always unavailable

Hello!
I’m new to Home Assistant, but been busy getting a bunch of things connected. My FTDI board arrived today and I successfully flashed my Sonoff S31 with Tasmota. I installed the built in MQTT broker in Hass.io, added an mqtt user in Hassio, configured the MQTT integration all successfully. I also installed TasmoAdmin. (Plus a few restarts in there for good measure).

I setup my S31 with the relevant MQTT broker details, did a setoption19 On and my S31 showed up in hass.io under the Integrations -> MQTT. However, I have yet to be able to get it to be any state other than “Unavailable”.

image

Reading around the forum, 6.4.1 seems to have issues with connecting, but I don’t believe that is my issue as I am always able to access/control/view power consumption of the device from TasmoAdmin! I used an MQTT client on my mac to connect to the MQTT broker running in hassio, and it shows the regular updates from Tasmota.

I don’t have anything in configuration.yaml as from what I’ve read everything should be automatic these days.

What am I missing? Thanks!

Sounds like you’ve done everything correctly.

I’m really not sure what could cause discovery to work but the device to be unavailable.

I still use Tasmota v6.2.1 and manual configuration because Tasmota has gone a bit shit recently.

You could try the mosquitto add-on broker rather than the built-in one. With this you will have a log you can use to help see what is going on.

That doesn’t look like it’s unavailable…

Tap on switch.kettle on that screen… does it show unavailable there?

Thanks for the reply. Indeed it does: image
(Where it shows ‘off’ earlier, I had a wemo switch named switch.kettle before, but I removed it from the entity register before changing the Tasmota to switch.kettle. Had the same ‘unavailable’ issue when it was just switch.sonoff)

Thanks. At least I’m not missing anything obvious. Maybe tomorrow I’ll point everything to the MQTT broker I’ve got running on my Mac and see if that makes a difference. Otherwise try downgrading Tasmota and/or doing some manual configs.

My guess would be that you still have something amiss in the .storage files from this.

So it’s seeing the old device… have you checked in the states in dev-tools? Is it called something else maybe?

What are the following options set to in the sonoff console?

SetOption26
SetOption59

I’ve uninstalled the MQTT broker, took a look at the .storage files (thanks for the pointer to that) and made sure everything was removed from the relevant files when I removed the entities, removed the switch from the core.device_registry file. I then changed the name of the Sonoff in Tasmota, reinstalled the MQTT broker, did a SetOption19 ON, and the device shows up under the MQTT with its new name, but still unavailable:
image
Same SOKettle devices are shown under dev-tools as unavailable. No other unknown entities are there, only the other devices I have setup.

SetOption26 and SetOption59 are both OFF.

Off to try a different MQTT broker and/or downgrade Tasmota…

Downgrading to Tasmota 6.3.0 and doing manual configurations of the sensors and switch in my yaml seems to have done the trick! I can now control the switch and see the power usage. The auto-config is a great idea and will make things much simpler once it works, but is not without issues at this point I guess.
Thanks for much for all your help!