MQTT Broker does not show ny devices

Hi,

My HASS just got corrupted so I am installing all fresh. I have a few sonoffs connecting via MQTT. I installed Mosquitto add on and configured. But when I go to integrations I don’t see any devices. I am hoping this is due to different users connecting for devices and HASS. Below is from MQTT Log:

1560623592: New client connected from 192.168.1.24 as sonoff_plug3 (c1, k10, u'manjulapra').
[INFO] found manjulapra on local database
1560623593: New client connected from 192.168.1.34 as sonoff_plug1 (c1, k10, u'manjulapra').
1560623664: New connection from [HASS External IP] on port 1883.
[INFO] found homeassistant on local database
1560623666: New client connected from [HASS External IP] as dbxxxxxx-79a8-4834-a137- 
xxxxxxxxx
(c1, k60, u'homeassistant').

As you see above, the devices are connecting using manjulapra and HASS connects using homeassistant as users. Is this the case why I don’t see any devices in integrations?

Thanks in advance,
Manjula

Is discovery for mqtt set up in HA?

A similar issue was driving me crazy all night.
This is my first attempt with home-assistant and sonoff/tasmota.

I followed the latest guides I could find, using HA 0.94.3 and Mosquitto broker 4.3 from the add-on store.

HA seemed to connect just fine to MQTT and the logs for Mosquitto broker reflected the same.
I saw both HA and my clients connecting to MQTT, but no devices were ever discovered.
SetOption19 returned {“SetOption19”:“ON”} in the devices’ consoles.

I finally found this small golden nugget of info in the Tasmota Wiki (Home Assistant page):

To ease Home Assistant configuration a feature called MQTT discovery is available. (warning: this feature is not included in sonoff-basic.bin and sonoff-classic.bin )

I had “sonoff-basic.bin” installed on my devices. “SetOption19” was still an available option to enable and disable, but apparently it doesn’t actually work using -basic.

Hopefully this is helpful to someone!

Thanks. I tried all the settings, with discovery on in config.yml and off. With all other settings. But none seem to work. All the Sonoffs seem to connect to MQTT and MQTT connect to HA too, but none of the devices are visible in HA.

I finally ended up adding all my devices manually. It worked

There is no file called config.yml

My bad. I meant to say “configuration.yaml”

Hi all,

I’m brand new to HA and am also having trouble accessing my Sonoff mini device via MQTT

I’ve tried:

  • Auto Discovery - see details below
  • Manually entering (though I’m not sure I’ve done it correctly) as it sounds like @manjulapra is says that worked for him
  • Using the Mini template - as others (see: Sonoff Mini auto discovery) have said they’ve gotten the mini to auto discover using the mini template (I wonder what firmware they were using)

Maybe @hackiero 's note is true with the tasmota-lite.bin as well (see below bullet) but I’m also trying manual and others

  • “To ease Home Assistant configuration a feature called MQTT discovery is available. (warning: this feature is not included in sonoff-basic.bin and sonoff-classic.bin)”

Config:

  • HassOS 3.11 ver 206 - Running in Windows Hyper-V
  • Mosquitto broker 5.1

Auto Discovery

  • I SetOption19 & SetOption30 to 5 devices
  • 1 Gosund WP6 plug using firmware: 8.1.0.2(tasmota) - tasmota.bin
  • 4 mini’s using firmware: 8.1.0(lite) - tasmota-lite.bin (tasmota.bin doesn’t fit on the mini)

Only the 1 Gosund WP6 is discovered / shows up in MQTT integrations

NOTE:
All minis use the Mini template as follows:
{“NAME”:“Sonoff Mini”,“GPIO”:[17,0,0,0,9,0,0,0,21,56,0,0,255],“FLAG”:0,“BASE”:1}

Here’s the Log:
NOTE: 192.168.2.89 represents the 1 Gosund WP6 plug that appears in MQTT integrations)

1583122996: New connection from 192.168.2.31 on port 1883.
1583122996: Client DVES_431F8B already connected, closing old connection.
1583122996: New client connected from 192.168.2.31 as DVES_431F8B (p2, c1, k30, u’jim’).
1583122997: New connection from 192.168.2.32 on port 1883.
1583122997: Client DVES_BE15FC already connected, closing old connection.
1583122997: New client connected from 192.168.2.32 as DVES_BE15FC (p2, c1, k30, u’jim’).
1583122999: New connection from 192.168.2.54 on port 1883.
1583122999: Client DVES_C1DB30 already connected, closing old connection.
1583122999: New client connected from 192.168.2.54 as DVES_C1DB30 (p2, c1, k30, u’jim’).
1583122999: New connection from 192.168.2.89 on port 1883.
1583122999: Client DVES_D0524A already connected, closing old connection.
1583122999: New client connected from 192.168.2.89 as DVES_D0524A (p2, c1, k30, u’jim’).
1583123004: New connection from 192.168.2.33 on port 1883.
1583123004: Client DVES_B3D233 already connected, closing old connection.
1583123004: New client connected from 192.168.2.33 as DVES_B3D233 (p2, c1, k30, u’jim’).
1583123093: Saving in-memory database to /data/mosquitto.db.

Manual Attempt
I added the following to my configuration.yaml, not sure if this is correct but after restarting, I don’t see it in integrations MQTT, but I do see it in entities but when I click on it it says the following so I’m not sure how to add it to lovelace UI, with the auto discovered plug I was able to select the option to do so:

  • “This entity does not have a unique ID, therefore it’s settings can not be managed from the UI.”

NOTE: I’ve tried bot with and without discovery options (below)

mqtt:
discovery: true
discovery_prefix: homeassistant
broker: 192.168.2.45
username: jim
password: xxx

light:

  • platform: mqtt
    name: Garage Outside
    command_topic: “cmnd/Garage_Outside/power”
    state_topic: “stat/Garage_Outside/POWER”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”

Tasmota-lite does not support discovery. You can upgrade your Mini’s to full tasmota to enable discovery.

Yes it used to say that in the tasmota docs. I assume it still does.

EDIT: Assumption huh? The mother of all stuff ups. I submitted a PR to the docs.

Under lite, there is a - next to use_discovery. So lite does not support discovery.

Try :

light:
  - platform: mqtt
    name: Garage Outside
    command_topic: “cmnd/Garage_Outside/power”
    state_topic: “stat/Garage_Outside/POWER”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”
    unique_id: garage_outside

It needs to be in the discovery instructions though, in order to prevent damage to walls through banging of heads.

@nickrout and @francisp, thank you guys for being so kind to respond, your suggestions and pointing me to that documentation, it’s much appreciated!

Good news!
Your suggestion to use unique_id: garage_outside worked, under Entities it now shows as a light: light.garage_outside! Once you sent it I found a reference to it in the Entity documentation - https://developers.home-assistant.io/docs/entity_index/

Not so good news!
Referencing the BUILDS.md documentation you kindly sent me I’m now seeing the USE_HOME_ASSISTANT property isn’t checked for tasmota-lite.bin, I’m not sure if that means that my tasmota-lite.bin flashed Sonoff Mini has no use when utilizing the Home Assistant UI?

Sonoff Mini - tasmota.bin, tasmota-lite.bin is too big
Ugh, I knew when I went to flash my Mini with tasmota-lite.bin I’d run into unwanted restrictions but now I’m thinking my Sonoff Mini has no use in Home Assistant…

Unfortunately the Sonoff Mini won’t accept tasmota.bin, it’s too big. See Flash the Sonoff Mini with Tasmota (it’s a little old and references sonoff.bin and how it can’t be used due to size and to use sonoff-mini.bin instead, but lower in the comments area you’ll see the reference to the tasmota-lite.bin that others and I used). I’m pretty sure the DIY flash tool in the instructions also gave me a message that tasmota.bin was too big when I tried.

Not wanting to give up
Thanks to your help I “think” I can use my Sonoff Mini as it’s now available as an MQTT device and am guessing that I can do automation, like the classic lights on at sunset. Wanting to explore/take advantage of the HA automation UI, such as “Turn on the lights when the sun is set” which utilizes the pretty cool looking Areas feature, but this might be where USE_HOME_ASSISTANT property not being checked for tasmota-lite.bin may be a factor…

Here’s what I tried

  • Learning that Areas are only accessible via integrations, I utilized the integration access to my Mini via my MikroTik router integration (device_tracker.tasmota_5628) - as you guys pointed out MQTT integration is nogo due to no discovery support for tasmota-lite.bin
  • I then edited it and set it’s Area to “Outside Lights”. But when I went to add a new automation via the UI and selected “Turn on the lights when the sun is set”, when I select a light in an area, “Outside Lights” isn’t available.
  • If I add my tasmota.bin flashed livingroom lamp which I see in MQTT integrations, and set it’s Area to and do the “Turn on the lights when the sun is set” automation again, “Outside Lights” is now available, but obviously for my tasmota.bin flashed Living Room Lamp, not my desired Outside Garage Light.
  • So, I then thought maybe it’s not seeing my outside garage light as a light because MikroTik integration called it device_tracker.tasmota_5628, so I tried to rename it to light.outside_garage (ensuring no name conflict), but I immediately get the error “Domain needs to stay the same” and update is disabled.

I guess in the end, can you confirm if this lack of ability to use this HA functionality the result of lack of support for any tasmota-lite.bin flashed device such as the Sonoff Mini?

  • If so that would leave me at my assumption that I can still manually configure automation in .yaml utilizing MQTT, correct?

Thanks again, I’m trying to provide a lot of detail and info that may help others as you guys have helped me.

Did you flash minimal first?

You should still be able to enable it. How much memory does your device have? I would expect to be able to load full tasmota after minimal…

Hi @DavidFW1960, thanks for your reply!

So for clarification are you saying I should be ok flashing with lite, then minimal (as the below doc says no minimal first), then tasmota.bin should fit?

I ask because to better familiarize myself before replying I found tasmota-minimal.bin in the Tasmota v8.1.0 Doris documentation with the following description

  • tasmota-minimal.bin = The Minimal version allows intermediate OTA uploads to support larger versions and does NOT change any persistent parameter. This version should NOT be used for initial installation.

Note: Being a newbie to all this I hadn’t considered/heard of tasmota-minimal.bin as my investigation to flashing let me to Flash the Sonoff Mini with Tasmota which didn’t mention tasmota-minimal.bin.

Regarding how much memory the Sonoff Mini has, unfortunately the ones I bought are all installed and I wasn’t able to find that spec googling it, not even at ITead’s page. But I was able to get this from the Tasmota Information page:
image

For reference here’s what the the Tasmota v8.1.0 Doris documentation says:

  • tasmota-lite.bin 463 KB
  • tasmota-minimal.bin 372 KB
  • tasmota.bin 567 KB

It’s a stretch for me to use my memory on this one but I think Free Program Space 540KB represents memory available to flash to (I could be wrong on that, but that number seems to jive w/ my memory). If correct, would that mean that the tasmota.bin (567 KB) wouldn’t work or does installing tasmota-minimal.bin do some kind of magic to allow more space for subsequent firmware installs?

Is there anything I should know about flashing with tasmota-minimal.bin? I can try to flash it easy enough pointing to the file via the UI, just a little nervous I might ruin the device.

Normally for the initial first flash, you need to use a USB and connect to the tx,rx,ground and 3v pins on the device with a serial adapter. But if you already have Tasmota on the device then you would OTA flash MINIMAL and then you can flash whatever you want after that. Flash MINIMAL First and then lite if that’s what you want.

You have 1mb memory. What Tasmota does is it holds 2 versions of firmware in the device simultaneously (so you can recover) which gives you roughly 512kb for currently installed and 512kb for new. That’s why you flash minimal and when that is successful you can flash the full version (or any other version you want).

Unless there’s a really good reason you want to flash lite then I would use the full tasmota.bin.

Yep. minimal frees up enough space to flash the full version. I guess that’s magic.

If this is a switch, I’d look at using discovery instead of manual configuration.

1 Like

Fantastic answer really appreciate the expiation and the understanding on how it works! I went on to learn additional information from the Upgrading documentation that your answer led me to. I simply did the OTA upgrade to tasmota.bin (I chose the release version, which was actually the default via the tasmota interface: http://thehackbox.org/tasmota/release/tasmota.bin) and it worked like a charm. I was able to do it with some comfort level, despite the original tasmota flashing only being able to support tasmota-lite.bin due to your explanation and further reading. In the end, I now see my device in integrations. Thanks once again!

2 Likes

We’re warned time and time again not to flash -minimal onto a sonoff mini. Personally, after OTA flashing with tasmota-lite, I was able to flash right up to the full tasmota.bin by using the tasmota.bin.gz since these newer versions of tasmota support flashing from a gunzip. They are small enough to fit alongside a tasmota-lite.

2 Likes

You have spoken about the mini from Sonoff, now i have problems with the minir2. Thanks to one of you, who writes: flash with the full tasmota. I hve done the same with the minir2, now everything is ok.
I have search about 4 days to find a solution…