Sonoff TH, Hass.io, mqtt, duplicate entity id’s and missing data

I’m running hass.io in a docker on a synology box (installation instructions here: Hass.io on Synology DSM (native package) )

I have installed the mqtt add-on and after much stuffing around I am finally able to see some items pop up but having a hard time managing them.

For one I’m getting errors that entity_id’s aren’t unique, but I can’t finding where those ids exist anywhere else. I eventually logged into the sonoff device and changed friendly names and mqtt settings thinking that should help, but that just made it worse, now there’s two devices, one with an “_2” and one without (which is now old and removed). Through a few searches I was able to “hide” the old entry, but the new one still claims the entity_id isn’t unique.

The second problem I’m having with this unit is that it is identifying as a “switch” and coming up as “switch.laundryth” (laundry because that’s where it is, and th because it is a sonoff TH model)

I have the mqtt addon installed, but I can’t see any interaction anywhere in the logs or history between HA and MQTT and the sonoff.

I’ve been trying to get the temperature and humidity readings from it and I can’t determine what to enter where to even poll the device and see what the readings are. In the mqtt debug tools all I can see is listed under states and that is the fact it is a status of being on or off. There’s nothing there about the devices other values.

I’ve been clutching at this for a couple of days now and am pulling my hair out. It appears nothing I enter into the publish a packet field can find its way to the sonoff, I realise I’m just not entering the right text/mqtt query, so any help would be appreciated.

Oh and obviously the mqtt signals are working as I can turn the device on and off without issues (it is slow, it it does do it).

  1. what packet to send from the publish a packet in the mqtt debug tools will allow me to see the other data?

MQTT settings I have are:

Client : dves_%06X <— what is this even used for?
Topic : laundryth
Full topic : %prefix%/%topic%

In “publish” I’ve tried all variants of:

stat/laundryth/
stat/laundryth/status10
cmnd/laundryth/status10

I’ve tried the status10 on the payload line to no avail.

  1. how do I get that data into HA?

Edit:
Bonus points:
3) how can I make sure laundryth has a unique entity_id? I mean, I’m not seeing a duplicate anywhere.
I moved this to a new question here: Entities and hass.io, where are they stored?

Long post, little concrete information.

From dves_%06X, I deduct that you have flashed Tasmota on your sonoff. And from the fact that you don’t have a unique I’d that you did not auto discovery. And from the fact that you don’t get temperature an humidity readings ? Can be either not correct defined in the Tasmota template, or not correct defined when you created the sensor in HA.

Problem is : without more concrete information we cannot help.

Thanks @francisp what can I provide that best helps?

You are correct, it is tasmota on a sonoff TH device. It is correctly setup in the sonoff. It is a model 4 sonoff TH. Correct sensor and works as normal in every respect.

I think the issue is that I never set it up in HA, it’s auto discovered and that process doesn’t seem to create anything for me to edit, or none that I’ve found anywhere. As mentioned, I’m using hass.io instead of a native install of home assistant (I’m beginning to think that is part of the issue, there’s a lot of murkiness between the two and it’s very ill defined in the forums and website, from what I’ve seen so far anyway).

Things that are automatically entered and need “fixing”, how exactly do I do that?

There is nothing in the configuration.yaml file about sonoff sat all, there are two other switches I’ve specifically created, but they’re not even sonoff devices.

Customize.yaml only has the old sonoff Entity that was created (under switch.laundry).

You did select module Sonoff TH (4) and under GPIO14 configured the sensor you have connected.
Then the temperature and humidity should be available in HA.

You are correct, I did. :slight_smile:

So when you say “should be available in HA”, what do you mean exactly?

Here are some screenies to show what I mean:

#1 shows sonoff model TH selected

#2 shows that there are no attributes under switch.laundryth

What I expected to see above is the available attributes much like the weather station below it, where the attributes with their values are available to the user.

#3 showing entity_id’s (sorted by id) showing that the id is not duplicated

Now what I have just found tonight in trying to poll the mqtt output of the sonoff directly from HA, I have found that I can listen specifically for that message and I receive it: #4

but other than that particular screen, I’m not seeing it anywhere else in any logs anywhere.

Also what has puzzled me mostly is the fact that I haven’t “configured” anything, HA discovered the sonoff based on the auto discovery settings being made available when I SetOption19 1

But generally, how does one “modify” the settings that are detected? As in this case, it’s not entirely correct and I want to correct it, but I don’t know where without messing things around. I wouldn’t think I’d re-create it in the configuration.yaml file mostly because what/how do I create it without duplicating it? And what settings am I duplicating anyway?

In the developer tools section at the top there is this area, am I supposed to “configure” auto detected devices here? This is where I gave it a unique name, but it’s never been happy with it.

Hopefully that gives you enough info to help me a little further.

Much appreciated