MQTT Not Autodiscovering Devices After core-2021.9.x Update

I need some help with MQTT as it is behaving strangely after the core-2021.9.1 update. Auto-discover just works the first time a device is added, and if you need to reboot the device it will never become again in Home Assistant

What is happening:
Auto-discovery devices never come back after they go through a power cycle. If I have an auto-discovered device that needs to be rebooted it will never come online again, all it entities will remain unavailable.

What I did to try to fix it:

  • I deleted the auto-discovered device from Home Assistant and rebooted Home Assistant, and the device wasn’t rediscovered.
  • I removed the MQTT integration, restarted Home Assistant and re-added the MQTT integration, and the device wasn’t rediscoverd.
  • I removed the MQTT integration and Mosquitto broker add-on, restarted Home Assistant, added Mosquitto broker add-on, and reconfigured the integration, and the device wasn’t rediscovered.

Steps to replicate:

  • Have a device added via MQTT Auto-Discover;
  • Turn the device off, making all its entities unavailable;
  • Turn the device on, and it will never show again in Home Assistant

System Info

## System Health

version | core-2021.9.6
-- | --
installation_type | Home Assistant OS
dev | false
hassio | true
docker | true
user | root
virtualenv | false
python_version | 3.9.6
os_name | Linux
os_version | 5.10.17-v8
arch | aarch64
timezone | America/Toronto

<details><summary>Home Assistant Community Store</summary>

GitHub API | ok
-- | --
Github API Calls Remaining | 4772
Installed Version | 1.15.2
Stage | running
Available Repositories | 881
Installed Repositories | 12

</details>

<details><summary>Home Assistant Cloud</summary>

logged_in | true
-- | --
subscription_expiration | October 9, 2021, 8:00 PM
relayer_connected | true
remote_enabled | true
remote_connected | true
alexa_enabled | false
google_enabled | true
can_reach_cert_server | ok
can_reach_cloud_auth | ok
can_reach_cloud | ok

</details>

<details><summary>Home Assistant Supervisor</summary>

host_os | Home Assistant OS 6.3
-- | --
update_channel | stable
supervisor_version | supervisor-2021.09.0
docker_version | 20.10.7
disk_total | 58.0 GB
disk_used | 8.9 GB
healthy | true
supported | true
board | rpi4-64
supervisor_api | ok
version_api | ok
installed_addons | File editor (5.3.3), Terminal & SSH (9.1.3), Samba share (9.5.1), Network UPS Tools (0.8.0), Z-Wave JS (0.1.39), Check Home Assistant configuration (3.8.0), Home Assistant Google Drive Backup (0.105.1), ESPHome (2021.8.2), AirCast (3.1.1)

</details>

<details><summary>Lovelace</summary>

dashboards | 1
-- | --
resources | 7
views | 4
mode | storage

</details>

<details><summary>Spotify</summary>

api_endpoint_reachable | ok
-- | --

</details>

I don’t know why the Mosquito Broker isn’t included in the installed add-ons list but it is running:

Mosquito broker log captured after restarting it:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] mosquitto.sh: executing... 
[00:26:56] INFO: Certificates found: SSL is available
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[00:26:57] INFO: Starting NGINX for authentication handling...
[00:26:57] INFO: Starting mosquitto MQTT broker...
1631507217: mosquitto version 1.6.12 starting
1631507217: |-- *** auth-plug: startup
[00:26:57] INFO: Successfully send discovery information to Home Assistant.
[00:26:58] INFO: Successfully send service information to the Supervisor.
1631507217: Config loaded from /etc/mosquitto/mosquitto.conf.
1631507217: Loading plugin: /usr/share/mosquitto/auth-plug.so
1631507217:  ├── Username/password checking enabled.
1631507217:  ├── TLS-PSK checking enabled.
1631507217:  └── Extended authentication not enabled.
1631507217: Opening ipv4 listen socket on port 1883.
1631507217: Opening ipv6 listen socket on port 1883.
1631507217: Opening websockets listen socket on port 1884.
1631507217: Opening ipv4 listen socket on port 8883.
1631507217: Opening ipv6 listen socket on port 8883.
1631507217: Opening websockets listen socket on port 8884.
1631507217: Warning: Mosquitto should not be run as root/administrator.
1631507217: mosquitto version 1.6.12 running
1631507217: New connection from 192.168.86.202 on port 1883.
1631507217: New connection from 127.0.0.1 on port 1883.
1631507217: New client connected from 192.168.86.202 as 3vnd5l2wjZWpHDqDN67hUY (p1, c1, k60).
1631507217: Socket error on client <unknown>, disconnecting.
1631507218: New connection from 172.30.32.1 on port 1883.
1631507218: New client connected from 172.30.32.1 as 1nnWVCVzui5yFaOChmutu6 (p2, c1, k60, u'homeassistant').
1631507295: New connection from 172.30.32.2 on port 1883.
1631507295: Socket error on client <unknown>, disconnecting.
1631507415: New connection from 172.30.32.2 on port 1883.
1631507415: Socket error on client <unknown>, disconnecting.
1631507535: New connection from 172.30.32.2 on port 1883.
1631507535: Socket error on client <unknown>, disconnecting.
1631507655: New connection from 172.30.32.2 on port 1883.
1631507655: Socket error on client <unknown>, disconnecting.
1631507775: New connection from 172.30.32.2 on port 1883.
1631507775: Socket error on client <unknown>, disconnecting.
1631507895: New connection from 172.30.32.2 on port 1883.
1631507895: Socket error on client <unknown>, disconnecting.
1631508015: New connection from 172.30.32.2 on port 1883.
1631508015: Socket error on client <unknown>, disconnecting.
1631508135: New connection from 172.30.32.2 on port 1883.

The device that should be autodiscovery is the client from 192.168.86.202 - It is a Ender 3 3D Printer connected to Octoprint and running the MQTT, Home Assistant Discovery and PSU to MQTT Plug-in.

It was working fine until I had to reboot RaspeberyPI running Octoprint, after that, I couldn’t make it reappear in Home Assistant.

It also happened with a LED controller built using ESP8266. It was working fine until the update and a reboot, after that it never became available again, and I ended-up converting it to ESPHome.

Supervisor Log

21-09-12 23:26:43 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
21-09-12 23:44:19 INFO (SyncWorker_6) [supervisor.docker.interface] Restarting ghcr.io/home-assistant/raspberrypi4-64-homeassistant
21-09-12 23:44:33 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
21-09-12 23:44:41 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state CoreState.RUNNING
21-09-12 23:44:42 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
21-09-12 23:45:28 INFO (MainThread) [supervisor.homeassistant.core] Detect a running Home Assistant instance
21-09-12 23:48:35 INFO (SyncWorker_2) [supervisor.docker.interface] Stopping addon_core_mosquitto application
21-09-12 23:48:37 INFO (SyncWorker_2) [supervisor.docker.interface] Cleaning addon_core_mosquitto application
21-09-12 23:48:40 INFO (SyncWorker_1) [supervisor.docker.addon] Starting Docker add-on homeassistant/aarch64-addon-mosquitto with version 6.0.1
21-09-12 23:48:43 ERROR (MainThread) [supervisor.services.modules.mqtt] There is already a MQTT service in use from core_mosquitto
21-09-12 23:49:43 INFO (SyncWorker_5) [supervisor.docker.interface] Stopping addon_core_mosquitto application
21-09-12 23:49:45 INFO (SyncWorker_5) [supervisor.docker.interface] Cleaning addon_core_mosquitto application
21-09-12 23:49:48 INFO (SyncWorker_7) [supervisor.docker.addon] Starting Docker add-on homeassistant/aarch64-addon-mosquitto with version 6.0.1
21-09-12 23:49:50 ERROR (MainThread) [supervisor.services.modules.mqtt] There is already a MQTT service in use from core_mosquitto
21-09-12 23:51:19 INFO (SyncWorker_6) [supervisor.docker.interface] Restarting ghcr.io/home-assistant/raspberrypi4-64-homeassistant
21-09-12 23:51:30 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
21-09-12 23:51:39 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state CoreState.RUNNING
21-09-12 23:51:39 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
21-09-12 23:52:25 INFO (MainThread) [supervisor.homeassistant.core] Detect a running Home Assistant instance
21-09-12 23:55:04 INFO (SyncWorker_0) [supervisor.docker.interface] Stopping addon_core_mosquitto application
21-09-12 23:55:05 INFO (SyncWorker_0) [supervisor.docker.interface] Cleaning addon_core_mosquitto application
21-09-12 23:55:08 INFO (SyncWorker_6) [supervisor.docker.addon] Starting Docker add-on homeassistant/aarch64-addon-mosquitto with version 6.0.1
21-09-12 23:55:11 ERROR (MainThread) [supervisor.services.modules.mqtt] There is already a MQTT service in use from core_mosquitto
21-09-12 23:56:44 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
21-09-12 23:58:54 INFO (SyncWorker_0) [supervisor.docker.interface] Stopping addon_core_mosquitto application
21-09-12 23:58:56 INFO (SyncWorker_0) [supervisor.docker.interface] Cleaning addon_core_mosquitto application
21-09-12 23:58:59 INFO (SyncWorker_3) [supervisor.docker.addon] Starting Docker add-on homeassistant/aarch64-addon-mosquitto with version 6.0.1
21-09-12 23:59:02 ERROR (MainThread) [supervisor.services.modules.mqtt] There is already a MQTT service in use from core_mosquitto
21-09-12 23:59:55 INFO (SyncWorker_2) [supervisor.docker.interface] Stopping addon_core_mosquitto application
21-09-12 23:59:57 INFO (SyncWorker_2) [supervisor.docker.interface] Cleaning addon_core_mosquitto application
21-09-13 00:00:00 INFO (SyncWorker_5) [supervisor.docker.addon] Starting Docker add-on homeassistant/aarch64-addon-mosquitto with version 6.0.1
21-09-13 00:00:03 ERROR (MainThread) [supervisor.services.modules.mqtt] There is already a MQTT service in use from core_mosquitto
21-09-13 00:08:20 INFO (SyncWorker_3) [supervisor.docker.interface] Restarting ghcr.io/home-assistant/raspberrypi4-64-homeassistant
21-09-13 00:08:50 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
21-09-13 00:08:59 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state CoreState.RUNNING
21-09-13 00:08:59 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
21-09-13 00:09:44 INFO (MainThread) [supervisor.homeassistant.core] Detect a running Home Assistant instance
21-09-13 00:12:26 INFO (MainThread) [supervisor.auth] Auth request from 'core_mosquitto' for 'mqtt'
21-09-13 00:12:27 INFO (MainThread) [supervisor.auth] Successful login for 'mqtt'
21-09-13 00:15:57 INFO (SyncWorker_1) [supervisor.docker.interface] Stopping addon_core_mosquitto application
21-09-13 00:15:59 INFO (SyncWorker_1) [supervisor.docker.interface] Cleaning addon_core_mosquitto application
21-09-13 00:15:59 INFO (SyncWorker_1) [supervisor.docker.interface] Removing image homeassistant/aarch64-addon-mosquitto with latest and 6.0.1
21-09-13 00:15:59 INFO (MainThread) [supervisor.addons.addon] Removing add-on data folder /data/addons/data/core_mosquitto
21-09-13 00:15:59 INFO (MainThread) [supervisor.discovery] Delete discovery to Home Assistant mqtt from core_mosquitto
21-09-13 00:15:59 INFO (MainThread) [supervisor.addons] Add-on 'core_mosquitto' successfully removed
21-09-13 00:15:59 INFO (MainThread) [supervisor.discovery] Discovery 8b98ec34ae9147d687f555366cee7b16 message send
21-09-13 00:16:19 INFO (SyncWorker_2) [supervisor.docker.interface] Restarting ghcr.io/home-assistant/raspberrypi4-64-homeassistant
21-09-13 00:16:41 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
21-09-13 00:16:48 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state CoreState.RUNNING
21-09-13 00:16:48 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
21-09-13 00:17:39 INFO (MainThread) [supervisor.homeassistant.core] Detect a running Home Assistant instance
21-09-13 00:17:47 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup
21-09-13 00:17:47 INFO (MainThread) [supervisor.api.middleware.security] /backups access from cebe7a76_hassio_google_drive_backup
21-09-13 00:18:31 INFO (SyncWorker_4) [supervisor.docker.interface] Restarting ghcr.io/home-assistant/raspberrypi4-64-homeassistant
21-09-13 00:18:43 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
21-09-13 00:18:52 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state CoreState.RUNNING
21-09-13 00:18:52 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
21-09-13 00:19:38 INFO (MainThread) [supervisor.homeassistant.core] Detect a running Home Assistant instance
21-09-13 00:22:00 INFO (MainThread) [supervisor.addons] Creating Home Assistant add-on data folder /data/addons/data/core_mosquitto
21-09-13 00:22:00 INFO (SyncWorker_7) [supervisor.docker.interface] Downloading docker image homeassistant/aarch64-addon-mosquitto with tag 6.0.1.
21-09-13 00:22:03 INFO (MainThread) [supervisor.addons] Add-on 'core_mosquitto' successfully installed
21-09-13 00:22:13 INFO (SyncWorker_1) [supervisor.docker.addon] Starting Docker add-on homeassistant/aarch64-addon-mosquitto with version 6.0.1
21-09-13 00:22:15 INFO (MainThread) [supervisor.discovery] Sending discovery to Home Assistant mqtt from core_mosquitto
21-09-13 00:22:15 INFO (MainThread) [supervisor.discovery] Discovery fc2b72df07124ea5b7b075d2f4456046 message send
21-09-13 00:22:16 INFO (MainThread) [supervisor.services.modules.mqtt] Set core_mosquitto as service provider for mqtt
21-09-13 00:22:18 INFO (MainThread) [supervisor.resolution.check] Starting system checks with state CoreState.RUNNING
21-09-13 00:22:18 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.SECURITY/ContextType.CORE
21-09-13 00:22:18 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.TRUST/ContextType.PLUGIN
21-09-13 00:22:18 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.TRUST/ContextType.CORE
21-09-13 00:22:18 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.TRUST/ContextType.SUPERVISOR
21-09-13 00:22:18 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.PWNED/ContextType.ADDON
21-09-13 00:22:18 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.FREE_SPACE/ContextType.SYSTEM
21-09-13 00:22:18 INFO (MainThread) [supervisor.resolution.check] System checks complete
21-09-13 00:22:18 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state CoreState.RUNNING
21-09-13 00:22:19 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
21-09-13 00:22:19 INFO (MainThread) [supervisor.resolution.fixup] Starting system autofix at state CoreState.RUNNING
21-09-13 00:22:19 INFO (MainThread) [supervisor.resolution.fixup] System autofix complete
21-09-13 00:26:44 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
21-09-13 00:26:48 INFO (SyncWorker_5) [supervisor.docker.interface] Stopping addon_core_mosquitto application
21-09-13 00:26:51 INFO (SyncWorker_5) [supervisor.docker.interface] Cleaning addon_core_mosquitto application
21-09-13 00:26:55 INFO (SyncWorker_6) [supervisor.docker.addon] Starting Docker add-on homeassistant/aarch64-addon-mosquitto with version 6.0.1
21-09-13 00:26:57 ERROR (MainThread) [supervisor.services.modules.mqtt] There is already a MQTT service in use from core_mosquitto

No relevant errors on Core log

Can you check with mqtt explorer if the discovery messages have the ‘retain’ flag set ?

this seems a problem too.

I will need some help here as I am an MQTT noob. I managed to install MQTT Explorer (neat tool!) and connect to my MQTT broker, but couldn’t figure out how to check the retain flag in the discovery messages.

That’s what MQTT Explorer shows me:
image

Looking at the Mosquito Brokers logs I can see my MQTT Explorer connection (I was double-checking just to make sure I didn’t connect to a demo broker…lol)

1631514183: New connection from 192.168.86.52 on port 1883.
{"result": "ok", "data": {}}1631514184: New client connected from 192.168.86.52 as mqtt-explorer-2d733bfc (p2, c1, k60, u'mqttuser').

@francisp Managed to fix that with a Host Reboot after finding this post :slight_smile:: ERROR (MainThread) [supervisor.services.modules.mqtt] There is already a MQTT service in use from core_mosquitto - #3 by LukasQ

So far didn’t get this error again, so it is probably not the root cause for the autodiscovery just work the first time.

The $SYS topic is information about the broker, nice to look at, but nothing to do with HA.

The autodiscovery messages must be under homeassistant

I just have $SYS in my list.

Here is what I after a clean install of Mosquito Broker Add-on and MQTT Integration, using the auto-configuration (I just click the configure button when the integration is discovered)

Mosquito Broker Log:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] mosquitto.sh: executing... 
[11:07:57] INFO: Certificates found: SSL is available
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[11:07:58] INFO: Starting NGINX for authentication handling...
[11:07:58] INFO: Starting mosquitto MQTT broker...
1631545678: mosquitto version 1.6.12 starting
1631545678: |-- *** auth-plug: startup
[11:07:59] INFO: Successfully send discovery information to Home Assistant.
[11:07:59] INFO: Successfully send service information to the Supervisor.
1631545678: Config loaded from /etc/mosquitto/mosquitto.conf.
1631545678: Loading plugin: /usr/share/mosquitto/auth-plug.so
1631545678:  ├── Username/password checking enabled.
1631545678:  ├── TLS-PSK checking enabled.
1631545678:  └── Extended authentication not enabled.
1631545678: Opening ipv4 listen socket on port 1883.
1631545678: Opening ipv6 listen socket on port 1883.
1631545678: Opening websockets listen socket on port 1884.
1631545678: Opening ipv4 listen socket on port 8883.
1631545678: Opening ipv6 listen socket on port 8883.
1631545678: Opening websockets listen socket on port 8884.
1631545678: Warning: Mosquitto should not be run as root/administrator.
1631545678: mosquitto version 1.6.12 running
1631545678: New connection from 127.0.0.1 on port 1883.
1631545678: Socket error on client <unknown>, disconnecting.
1631545680: New connection from 172.30.32.1 on port 1883.
{"result": "ok", "data": {}}1631545680: New client connected from 172.30.32.1 as 1FGwC0ordZ61MMRudL4Qq2 (p2, c1, k60, u'mqttuser').
1631545682: New connection from 192.168.86.202 on port 1883.
1631545682: New client connected from 192.168.86.202 as 3vnd5l2wjZWpHDqDN67hUY (p1, c1, k60).
1631545710: Socket error on client 1FGwC0ordZ61MMRudL4Qq2, disconnecting.
1631545742: New connection from 172.30.32.2 on port 1883.
1631545742: Socket error on client <unknown>, disconnecting.
1631545862: New connection from 172.30.32.2 on port 1883.
1631545862: Socket error on client <unknown>, disconnecting.
1631545870: New connection from 172.30.32.1 on port 1883.
1631545870: New client connected from 172.30.32.1 as auto-7A1D3BC5-2027-CDCA-A654-5F564960A724 (p2, c1, k60, u'homeassistant').
1631545870: Client auto-7A1D3BC5-2027-CDCA-A654-5F564960A724 disconnected.
1631545870: New connection from 172.30.32.1 on port 1883.
1631545870: New client connected from 172.30.32.1 as 2EbmLAe6b2Bm6NNShxUqzQ (p2, c1, k60, u'homeassistant').
1631545893: New connection from 192.168.86.52 on port 1883.

Mosquito Broker config:

logins: []
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

I connected to the broker using the homeassistant user auto-created and also the user I created , called mqttuser and had the same results.

When I add my user (mqttuser) to the Mosquito Broker Configuration and also reconfigure the integration to use it instead of homeassistant I get this result

image

Mosquito Broker log

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] mosquitto.sh: executing... 
[11:05:32] INFO: Setting up user mqttuser
[11:05:33] INFO: Certificates found: SSL is available
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[11:05:33] INFO: Starting NGINX for authentication handling...
[11:05:33] INFO: Starting mosquitto MQTT broker...
1631545533: mosquitto version 1.6.12 starting
1631545533: |-- *** auth-plug: startup
[11:05:34] INFO: Successfully send discovery information to Home Assistant.
1631545533: Config loaded from /etc/mosquitto/mosquitto.conf.
1631545533: Loading plugin: /usr/share/mosquitto/auth-plug.so
1631545533:  ├── Username/password checking enabled.
1631545533:  ├── TLS-PSK checking enabled.
1631545533:  └── Extended authentication not enabled.
1631545533: Opening ipv4 listen socket on port 1883.
1631545533: Opening ipv6 listen socket on port 1883.
1631545533: Opening websockets listen socket on port 1884.
1631545533: Opening ipv4 listen socket on port 8883.
1631545533: Opening ipv6 listen socket on port 8883.
1631545533: Opening websockets listen socket on port 8884.
1631545533: Warning: Mosquitto should not be run as root/administrator.
1631545533: mosquitto version 1.6.12 running
1631545533: New connection from 127.0.0.1 on port 1883.
1631545533: New connection from 192.168.86.202 on port 1883.
1631545533: Socket error on client <unknown>, disconnecting.
1631545533: New client connected from 192.168.86.202 as 3vnd5l2wjZWpHDqDN67hUY (p1, c1, k60).
[11:05:34] INFO: Successfully send service information to the Supervisor.

Mosquito Broker config:

logins:
  - username: mqttuser
    password: <super secure password>
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

After a fresh installation, there will be no auto-discovery messages. Your devices need to send them again.

I am assuming this is the discovery message as 192.168.86.202 is the device’s IP address and I have auto-discover enable in it.

I let Home Assistant sit for a while and I still just have this :frowning: :
image

auto-discovery messages do not originate from HA, but from your devices.

Got it! 192.168.86.202 is the client device. From my limited MQTT knowledge, the connected client device to the broker is publishing status messages in the broker and home assistant is listening to those messages as a subscriber.

The question that I can’t figure out the answer to is if the Mosquito Brokers show a connection in its logs then why MQTT Explorer isn’t showing a topic for the given connection?

I just order another ESP8266 to flash TASMODA and see if it works, because I don’t know what else I can change in the configurations to make it work. If you get any insight let me know. Thanks for the help :slight_smile:

correct, although the reverse is possible to : HA publishing commands, and the device is listening for commands (most of the time it is both ways)

A device can make a connection, but if it has nothing to say it will not publish something. Maybe it is just listening for commands ?

I restarted my whole network and enabled homeassistant.components.mqtt: debug

Now octoprint show in MqTT Explorer and is remained:

Core Logs

2021-09-14 10:27:23 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on homeassistant/status: 'online', mid: 4
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
2021-09-14 10:31:13 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: stop_scanning() takes 1 positional argument but 2 were given
2021-09-14 10:31:15 ERROR (MainThread) [homeassistant.components.hassio.handler] Client error on /homeassistant/restart request Server disconnected
s6-svscanctl: fatal: unable to control /var/run/s6/services: supervisor not listening
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2021-09-14 10:31:28 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration var which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-14 10:31:28 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-14 10:31:28 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration govee_ble_hci which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-14 10:31:28 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration smartthinq_sensors which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-14 10:31:28 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration googlewifi which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-14 10:31:28 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration govee which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-14 10:31:37 INFO (Thread-3) [homeassistant.components.mqtt] Connected to MQTT server core-mosquitto:1883 (0)
2021-09-14 10:31:42 WARNING (MainThread) [homeassistant.setup] Setup of zone is taking over 10 seconds.
2021-09-14 10:31:42 WARNING (MainThread) [homeassistant.setup] Setup of group is taking over 10 seconds.
2021-09-14 10:31:43 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/config, mid: 1
2021-09-14 10:31:43 ERROR (MainThread) [snitun.client.client_peer] Challenge/Response error with SniTun server
2021-09-14 10:31:43 ERROR (MainThread) [hass_nabucasa.remote] Connection problem to snitun server
2021-09-14 10:31:45 WARNING (MainThread) [homeassistant.setup] Setup of input_boolean is taking over 10 seconds.
2021-09-14 10:31:45 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/+/config, mid: 2
2021-09-14 10:31:47 WARNING (MainThread) [homeassistant.setup] Setup of webostv is taking over 10 seconds.
2021-09-14 10:31:47 ERROR (SyncWorker_7) [custom_components.govee_ble_hci.sensor] Error during Bluetooth LE scan: Attribute hass is None for <Entity Bedroom Enviroment temp: 23.06>
2021-09-14 10:31:48 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to tasmota/discovery/#, mid: 3
2021-09-14 10:31:51 WARNING (MainThread) [custom_components.govee] API is back online.
2021-09-14 10:31:53 WARNING (MainThread) [zigpy.zcl] Unknown cluster 57344
2021-09-14 10:31:53 WARNING (MainThread) [zigpy.zcl] Unknown cluster 57345
2021-09-14 10:31:53 WARNING (MainThread) [zigpy.zcl] Unknown cluster 57344
2021-09-14 10:31:53 WARNING (MainThread) [zigpy.zcl] Unknown cluster 57345
2021-09-14 10:31:55 WARNING (MainThread) [homeassistant.components.camera] Setup of camera platform environment_canada is taking over 10 seconds.
2021-09-14 10:32:18 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on homeassistant/status: 'online', mid: 4
2021-09-14 10:33:09 INFO (Thread-113) [homeassistant.components.mqtt] Connected to MQTT server core-mosquitto:1883 (0)
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Unsubscribing from homeassistant/+/+/config, mid: 1
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Unsubscribing from homeassistant/+/+/+/config, mid: 2
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Unsubscribing from tasmota/discovery/#, mid: 3
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/config, mid: 4
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/+/config, mid: 5
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/+/config, mid: 6
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/config, mid: 7
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to tasmota/discovery/#, mid: 8
2021-09-14 10:33:11 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on homeassistant/status: 'online', mid: 9
2021-09-14 10:41:30 ERROR (stream_worker) [libav.rtsp] method DESCRIBE failed: 404 Not Found
2021-09-14 10:41:30 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream rtsps://stream-ue1-delta.dropcam.com:443/sdm_live_stream/CiQA2vuxr8MbjzGcmOJsIOA23-kOzN4VxlYavElNEelb4ivIN8QScQAFjsOTdhwPRBwozHH8wTsnj6sDAzeLfhOfjWlOgGF-bgayKWzYZtD90KoSICgQxbNYQOatuKw9k7XFSLeK4FFKS6lPEJLXIJ4iopRkET4B4xZb0IYIIFA5QvAhIZ5OIZBUSc6v-xdFsaSNY2dwLvm3?auth=g.0.eyJraWQiOiIyMzhiNTUxZmMyM2EyM2Y4M2E2ZTE3MmJjZTg0YmU3ZjgxMzAzMmM4IiwiYWxnIjoiUlMyNTYifQ.eyJpc3MiOiJuZXN0LXNlY3VyaXR5LWF1dGhwcm94eSIsInN1YiI6Im5lc3RfaWQ6bmVzdC1waG9lbml4LXByb2Q6MjE1MjU4NTAiLCJwb2wiOiIzcC1vYXV0aC1zY29wZS1BUElfU0RNX1NFUlZJQ0UtY2xpZW50LTgyMTMwMjcyNTEyMC1zZWk1c2ppcXYzZjhtb2pmZzhwZGZ1aG85YThvNXFvMy5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsImV4cCI6MTYzMTYzMDc3OH0.N6555ya3BGiv4bnRsPOFS0sAMxcp4YV7-HqheEB3c4h-AdDHT9vp3IrvanfgyY1aCfamNo9MWumPenoGMnvRzT3N-8behyTQkfpOTFmYqYoLkDfhIxBQ_psJCf_lGt1TrmVKjBM3J0I6WJSsBxHie5rwF6IxueOqHkbU4NbZxhFtGLrFUelvxkagCCawFkKdwnp7iB0hYA7XHpvSWS-lVtYHY2sTNNCJI1B-FfGS38ry2QnKjov_MZvdKtopfQsONwv81HHw7ACiFYih1PNolkjfW9Y4UH2sr_xXf8XbMVQBGd4CG2XKuM2tpE1QYRhQboFMKiUkM1rs9pGQb7vyJQ
2021-09-14 10:45:20 WARNING (Thread-113) [homeassistant.components.mqtt] Disconnected from MQTT server core-mosquitto:1883 (1)
2021-09-14 10:45:28 INFO (Thread-113) [homeassistant.components.mqtt] Connected to MQTT server core-mosquitto:1883 (0)
2021-09-14 10:45:28 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/+/config, mid: 10
2021-09-14 10:45:28 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/config, mid: 11
2021-09-14 10:45:28 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to tasmota/discovery/#, mid: 12
2021-09-14 10:45:30 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on homeassistant/status: 'online', mid: 13

Mosquito Broker Log

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] mosquitto.sh: executing... 
[10:45:26] INFO: Certificates found: SSL is available
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[10:45:27] INFO: Starting NGINX for authentication handling...
[10:45:27] INFO: Starting mosquitto MQTT broker...
1631630727: mosquitto version 1.6.12 starting
1631630727: |-- *** auth-plug: startup
[10:45:28] INFO: Successfully send discovery information to Home Assistant.
1631630727: Config loaded from /etc/mosquitto/mosquitto.conf.
1631630727: Loading plugin: /usr/share/mosquitto/auth-plug.so
1631630727:  ├── Username/password checking enabled.
1631630727:  ├── TLS-PSK checking enabled.
1631630727:  └── Extended authentication not enabled.
1631630727: Opening ipv4 listen socket on port 1883.
1631630727: Opening ipv6 listen socket on port 1883.
1631630727: Opening websockets listen socket on port 1884.
1631630728: Opening ipv4 listen socket on port 8883.
1631630728: Opening ipv6 listen socket on port 8883.
1631630728: Opening websockets listen socket on port 8884.
1631630728: Warning: Mosquitto should not be run as root/administrator.
1631630728: mosquitto version 1.6.12 running
1631630728: New connection from 127.0.0.1 on port 1883.
1631630728: Socket error on client <unknown>, disconnecting.
1631630728: New connection from 172.30.32.1 on port 1883.
1631630728: New client connected from 172.30.32.1 as 0lbm8Tw6mfdrjZC5JBy79w (p2, c1, k60, u'homeassistant').
[10:45:29] INFO: Successfully send service information to the Supervisor.
1 Like

Thanks to the magic of amazon prime I can do more tests with my new ESP8266.

I did some debugging with a new device that I just configured using ESPHome, and now I can’t even make it work for the first time. Unless I am doing something wrong with its configuration (I never used ESPHome and MQTT), now MQTT autodiscover isn’t working at all.

Debugging:

I got an ESP8299 and installed ESPHome in it and configure it to use MQTT. First I made sure that I got everything working with the API, and then I changed it to use MQTT.

Here is the ESP home configuration:

esphome:
  name: temp-device
  platform: ESP8266
  board: esp01_1m

# Enable logging
logger:
  level: DEBUG

# Enable Home Assistant API
# api:

# Enable MQTT
mqtt:
  broker: homeassistant

ota:
  password: "xxxxxxxxxxxxxxxxxxxxxxxxxx"

wifi:
  ssid: "Skynet"
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Temp-Device Fallback Hotspot"
    password: "xxxxxxxxxxxxxxxxxxx"

captive_portal:

# Device Configuration
light:
  - platform: binary
    name: "Onboard LED"
    output: light_output

output:
  - id: light_output
    platform: gpio
    pin: GPIO2
    inverted: true

However I can’t see the device in MQTT Explorer or in Home assistant.

Mosquito Broker Log

1631630727: mosquitto version 1.6.12 starting
1631630727: |-- *** auth-plug: startup
[10:45:28] INFO: Successfully send discovery information to Home Assistant.
1631630727: Config loaded from /etc/mosquitto/mosquitto.conf.
1631630727: Loading plugin: /usr/share/mosquitto/auth-plug.so
1631630727:  ├── Username/password checking enabled.
1631630727:  ├── TLS-PSK checking enabled.
1631630727:  └── Extended authentication not enabled.
1631630727: Opening ipv4 listen socket on port 1883.
1631630727: Opening ipv6 listen socket on port 1883.
1631630727: Opening websockets listen socket on port 1884.
1631630728: Opening ipv4 listen socket on port 8883.
1631630728: Opening ipv6 listen socket on port 8883.
1631630728: Opening websockets listen socket on port 8884.
1631630728: Warning: Mosquitto should not be run as root/administrator.
1631630728: mosquitto version 1.6.12 running
1631630728: New connection from 127.0.0.1 on port 1883.
1631630728: Socket error on client <unknown>, disconnecting.
1631630728: New connection from 172.30.32.1 on port 1883.
1631630728: New client connected from 172.30.32.1 as 0lbm8Tw6mfdrjZC5JBy79w (p2, c1, k60, u'homeassistant').
[10:45:29] INFO: Successfully send service information to the Supervisor.
1631630728: New connection from 192.168.86.45 on port 1883.
{"result": "ok", "data": {}}1631630728: New client connected from 192.168.86.45 as mqtt-explorer-36d9a907 (p2, c1, k60, u'mqttuser').
1631630735: New connection from 192.168.86.202 on port 1883.
1631630735: New client connected from 192.168.86.202 as 3vnd5l2wjZWpHDqDN67hUY (p1, c1, k60).
1631630826: New connection from 172.30.32.2 on port 1883.
1631630826: Socket error on client <unknown>, disconnecting.
1631630946: New connection from 172.30.32.2 on port 1883.
1631630946: Socket error on client <unknown>, disconnecting.
1631631066: New connection from 172.30.32.2 on port 1883.
1631631066: Socket error on client <unknown>, disconnecting.
1631631186: New connection from 172.30.32.2 on port 1883.
1631631186: Socket error on client <unknown>, disconnecting.
1631631306: New connection from 172.30.32.2 on port 1883.
1631631306: Socket error on client <unknown>, disconnecting.
1631631426: New connection from 172.30.32.2 on port 1883.
1631631426: Socket error on client <unknown>, disconnecting.
1631631546: New connection from 172.30.32.2 on port 1883.
1631631546: Socket error on client <unknown>, disconnecting.
1631631614: New connection from 192.168.86.54 on port 1883.
1631631614: New client connected from 192.168.86.54 as temp-device-c45bbe485d5e (p2, c1, k15).
1631631666: New connection from 172.30.32.2 on port 1883.
1631631666: Socket error on client <unknown>, disconnecting.
1631631786: New connection from 172.30.32.2 on port 1883.
1631631786: Socket error on client <unknown>, disconnecting.
1631631906: New connection from 172.30.32.2 on port 1883.
1631631906: Socket error on client <unknown>, disconnecting.
1631632026: New connection from 172.30.32.2 on port 1883.
1631632026: Socket error on client <unknown>, disconnecting.
1631632146: New connection from 172.30.32.2 on port 1883.
1631632146: Socket error on client <unknown>, disconnecting.
1631632266: New connection from 172.30.32.2 on port 1883.
1631632266: Socket error on client <unknown>, disconnecting.
1631632386: New connection from 172.30.32.2 on port 1883.
1631632386: Socket error on client <unknown>, disconnecting.
1631632410: New connection from 172.30.32.1 on port 1883.
1631632410: New client connected from 172.30.32.1 as auto-0CDACE3B-400F-C10E-5C56-8DB4D45E5680 (p2, c1, k60).
1631632424: New connection from 192.168.86.54 on port 1883.
1631632424: Client temp-device-c45bbe485d5e already connected, closing old connection.
1631632424: New client connected from 192.168.86.54 as temp-device-c45bbe485d5e (p2, c1, k15).
1631632486: Socket error on client auto-0CDACE3B-400F-C10E-5C56-8DB4D45E5680, disconnecting.
1631632495: New connection from 172.30.32.1 on port 1883.
1631632495: New client connected from 172.30.32.1 as auto-149016AF-D2E2-08C2-4AB7-DA37B4214AD5 (p2, c1, k60).
1631632506: New connection from 172.30.32.2 on port 1883.
1631632506: Socket error on client <unknown>, disconnecting.
1631632528: Saving in-memory database to /data/mosquitto.db.
1631632626: New connection from 172.30.32.2 on port 1883.
1631632626: Socket error on client <unknown>, disconnecting.
1631632746: New connection from 172.30.32.2 on port 1883.
1631632746: Socket error on client <unknown>, disconnecting.
1631632866: New connection from 172.30.32.2 on port 1883.
1631632866: Socket error on client <unknown>, disconnecting.
1631632986: New connection from 172.30.32.2 on port 1883.
1631632986: Socket error on client <unknown>, disconnecting.
1631633064: New connection from 192.168.86.54 on port 1883.
1631633064: Client temp-device-c45bbe485d5e already connected, closing old connection.
1631633064: New client connected from 192.168.86.54 as temp-device-c45bbe485d5e (p2, c1, k15).
1631633106: New connection from 172.30.32.2 on port 1883.
1631633106: Socket error on client <unknown>, disconnecting.
1631633226: New connection from 172.30.32.2 on port 1883.
1631633226: Socket error on client <unknown>, disconnecting.
1631633346: New connection from 172.30.32.2 on port 1883.
1631633346: Socket error on client <unknown>, disconnecting.
1631633459: Client mqtt-explorer-36d9a907 has exceeded timeout, disconnecting.
1631633466: New connection from 172.30.32.2 on port 1883.
1631633466: Socket error on client <unknown>, disconnecting.
1631633483: Socket error on client auto-149016AF-D2E2-08C2-4AB7-DA37B4214AD5, disconnecting.
1631633586: New connection from 172.30.32.2 on port 1883.
1631633586: Socket error on client <unknown>, disconnecting.
1631633706: New connection from 172.30.32.2 on port 1883.
1631633706: Socket error on client <unknown>, disconnecting.
1631633826: New connection from 172.30.32.2 on port 1883.
1631633826: Socket error on client <unknown>, disconnecting.
1631633946: New connection from 172.30.32.2 on port 1883.
1631633946: Socket error on client <unknown>, disconnecting.
1631634066: New connection from 172.30.32.2 on port 1883.
1631634066: Socket error on client <unknown>, disconnecting.
1631634186: New connection from 172.30.32.2 on port 1883.
1631634186: Socket error on client <unknown>, disconnecting.
1631634306: New connection from 172.30.32.2 on port 1883.

192.168.86.54 is the client device IP

Client Device Log

INFO Reading configuration /config/esphome/temp-device.yaml...
INFO Starting log output from temp-device/debug
INFO Connected to MQTT broker!

Core Log

2021-09-14 10:27:22 WARNING (MainThread) [homeassistant.components.automation.all_hs210_extra_nudge] Integration - HS210 "Extra Nudge" Upstairs Hallway: Already running
2021-09-14 10:27:22 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_kitchen_hallway] Integration - HS210 "Extra Nudge" Kitchen Hallway: Already running
2021-09-14 10:27:22 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_front_door_hallway] Integration - HS210 "Extra Nudge" Front Door Hallway: Already running
2021-09-14 10:27:22 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_basement_hallway] Integration - HS210 "Extra Nudge" Basement Hallway: Already running
2021-09-14 10:27:22 WARNING (MainThread) [homeassistant.components.automation.all_hs210_extra_nudge] Integration - HS210 "Extra Nudge" Upstairs Hallway: Already running
2021-09-14 10:27:22 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_kitchen_hallway] Integration - HS210 "Extra Nudge" Kitchen Hallway: Already running
2021-09-14 10:27:22 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_front_door_hallway] Integration - HS210 "Extra Nudge" Front Door Hallway: Already running
2021-09-14 10:27:22 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_basement_hallway] Integration - HS210 "Extra Nudge" Basement Hallway: Already running
2021-09-14 10:27:23 WARNING (MainThread) [homeassistant.components.automation.all_hs210_extra_nudge] Integration - HS210 "Extra Nudge" Upstairs Hallway: Already running
2021-09-14 10:27:23 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_kitchen_hallway] Integration - HS210 "Extra Nudge" Kitchen Hallway: Already running
2021-09-14 10:27:23 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_front_door_hallway] Integration - HS210 "Extra Nudge" Front Door Hallway: Already running
2021-09-14 10:27:23 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_basement_hallway] Integration - HS210 "Extra Nudge" Basement Hallway: Already running
2021-09-14 10:27:23 WARNING (MainThread) [homeassistant.components.automation.all_hs210_extra_nudge] Integration - HS210 "Extra Nudge" Upstairs Hallway: Already running
2021-09-14 10:27:23 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_kitchen_hallway] Integration - HS210 "Extra Nudge" Kitchen Hallway: Already running
2021-09-14 10:27:23 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_front_door_hallway] Integration - HS210 "Extra Nudge" Front Door Hallway: Already running
2021-09-14 10:27:23 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_basement_hallway] Integration - HS210 "Extra Nudge" Basement Hallway: Already running
2021-09-14 10:27:23 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on homeassistant/status: 'online', mid: 4
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.all_hs210_extra_nudge] Integration - HS210 "Extra Nudge" Upstairs Hallway: Already running
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_kitchen_hallway] Integration - HS210 "Extra Nudge" Kitchen Hallway: Already running
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_front_door_hallway] Integration - HS210 "Extra Nudge" Front Door Hallway: Already running
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_basement_hallway] Integration - HS210 "Extra Nudge" Basement Hallway: Already running
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.all_hs210_extra_nudge] Integration - HS210 "Extra Nudge" Upstairs Hallway: Already running
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_kitchen_hallway] Integration - HS210 "Extra Nudge" Kitchen Hallway: Already running
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_front_door_hallway] Integration - HS210 "Extra Nudge" Front Door Hallway: Already running
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_basement_hallway] Integration - HS210 "Extra Nudge" Basement Hallway: Already running
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.all_hs210_extra_nudge] Integration - HS210 "Extra Nudge" Upstairs Hallway: Already running
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_kitchen_hallway] Integration - HS210 "Extra Nudge" Kitchen Hallway: Already running
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_front_door_hallway] Integration - HS210 "Extra Nudge" Front Door Hallway: Already running
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_basement_hallway] Integration - HS210 "Extra Nudge" Basement Hallway: Already running
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.all_hs210_extra_nudge] Integration - HS210 "Extra Nudge" Upstairs Hallway: Already running
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_kitchen_hallway] Integration - HS210 "Extra Nudge" Kitchen Hallway: Already running
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_front_door_hallway] Integration - HS210 "Extra Nudge" Front Door Hallway: Already running
2021-09-14 10:27:36 WARNING (MainThread) [homeassistant.components.automation.integration_hs210_extra_nudge_basement_hallway] Integration - HS210 "Extra Nudge" Basement Hallway: Already running
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
2021-09-14 10:31:13 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: stop_scanning() takes 1 positional argument but 2 were given
2021-09-14 10:31:15 ERROR (MainThread) [homeassistant.components.hassio.handler] Client error on /homeassistant/restart request Server disconnected
s6-svscanctl: fatal: unable to control /var/run/s6/services: supervisor not listening
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2021-09-14 10:31:28 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration var which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-14 10:31:28 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-14 10:31:28 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration govee_ble_hci which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-14 10:31:28 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration smartthinq_sensors which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-14 10:31:28 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration googlewifi which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-14 10:31:28 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration govee which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-09-14 10:31:37 INFO (Thread-3) [homeassistant.components.mqtt] Connected to MQTT server core-mosquitto:1883 (0)
2021-09-14 10:31:42 WARNING (MainThread) [homeassistant.setup] Setup of zone is taking over 10 seconds.
2021-09-14 10:31:42 WARNING (MainThread) [homeassistant.setup] Setup of group is taking over 10 seconds.
2021-09-14 10:31:43 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/config, mid: 1
2021-09-14 10:31:43 ERROR (MainThread) [snitun.client.client_peer] Challenge/Response error with SniTun server
2021-09-14 10:31:43 ERROR (MainThread) [hass_nabucasa.remote] Connection problem to snitun server
2021-09-14 10:31:45 WARNING (MainThread) [homeassistant.setup] Setup of input_boolean is taking over 10 seconds.
2021-09-14 10:31:45 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/+/config, mid: 2
2021-09-14 10:31:47 WARNING (MainThread) [homeassistant.setup] Setup of webostv is taking over 10 seconds.
2021-09-14 10:31:47 ERROR (SyncWorker_7) [custom_components.govee_ble_hci.sensor] Error during Bluetooth LE scan: Attribute hass is None for <Entity Bedroom Enviroment temp: 23.06>
2021-09-14 10:31:48 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to tasmota/discovery/#, mid: 3
2021-09-14 10:31:51 WARNING (MainThread) [custom_components.govee] API is back online.
2021-09-14 10:31:53 WARNING (MainThread) [zigpy.zcl] Unknown cluster 57344
2021-09-14 10:31:53 WARNING (MainThread) [zigpy.zcl] Unknown cluster 57345
2021-09-14 10:31:53 WARNING (MainThread) [zigpy.zcl] Unknown cluster 57344
2021-09-14 10:31:53 WARNING (MainThread) [zigpy.zcl] Unknown cluster 57345
2021-09-14 10:31:55 WARNING (MainThread) [homeassistant.components.camera] Setup of camera platform environment_canada is taking over 10 seconds.
2021-09-14 10:32:18 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on homeassistant/status: 'online', mid: 4
2021-09-14 10:33:09 INFO (Thread-113) [homeassistant.components.mqtt] Connected to MQTT server core-mosquitto:1883 (0)
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Unsubscribing from homeassistant/+/+/config, mid: 1
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Unsubscribing from homeassistant/+/+/+/config, mid: 2
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Unsubscribing from tasmota/discovery/#, mid: 3
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/config, mid: 4
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/+/config, mid: 5
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/+/config, mid: 6
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/config, mid: 7
2021-09-14 10:33:09 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to tasmota/discovery/#, mid: 8
2021-09-14 10:33:11 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on homeassistant/status: 'online', mid: 9
2021-09-14 10:45:20 WARNING (Thread-113) [homeassistant.components.mqtt] Disconnected from MQTT server core-mosquitto:1883 (1)
2021-09-14 10:45:28 INFO (Thread-113) [homeassistant.components.mqtt] Connected to MQTT server core-mosquitto:1883 (0)
2021-09-14 10:45:28 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/+/config, mid: 10
2021-09-14 10:45:28 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/+/+/config, mid: 11
2021-09-14 10:45:28 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to tasmota/discovery/#, mid: 12
2021-09-14 10:45:30 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on homeassistant/status: 'online', mid: 13
2021-09-14 10:58:31 WARNING (MainThread) [homeassistant.components.esphome] Can't connect to ESPHome API for temp-device (192.168.86.54): Timeout while connecting to ('192.168.86.54', 6053)

This log includes the test device reflash transition from API to MQTT configuration

Is that a real mosquitto, or the HA add-on ? If the add-on, you need to provide a user and password in the esphome yaml.

It is the HA add-on. After 40min the new device was autodiscovered. With out adding the user name.

However I can’t control it from Home Assistant. This is the same behavior that I got from my previously Fastled implementation.

40 minutes is not normal, it should be nearly instantaneous. Try with your mqttuser and super-secret-password.

I will try latter today. Just uninstalled everything from Home Assistant and from Octoprint MQTT, and will start everything from scratch with just the ESPHome Device. I will also restart the network just to be on the safe side.

Correction: I will do that in 2 days, just ordered a second Raspbery PI to isolate all variables as I am intrigued why I am the only one having this issue.

I am back @francisp, with news, given that now I have the power of having 2 HA servers…lol

So I managed to debut the issue to the interaction between the Mosquito Broker Add-On and Home Assistant users.

How I found this out:
Pre-requisites: A fresh installation of Home Assistant OS with Mosquito Broker installed with the default configuration, MQTT integration installed with the default configuration, an mqtt user create in HA, ESPHome addon installed with the default configuration an ESP device configured in ESPHome to connect HA using as an MQTT client.

Steps to reproduce the error:

  • Setup the ESP device configure to use MQTT using the mqtt HA user and password.
    – At this point, it should connect without a problem
  • Change the mqtt user password
  • Update the password in the ESP client
    – At this point, the device will not be able to connect to the MQTT Broker, and the only way to fix it is to explicitly include the mqtt HA user name and password under the login segment of the Mosquito Broker Add-on, I tried turning the ESP device off, restarting HA and turning the ESP device on again, but it didn’t work.
logins:
  - username: mqtt
    password: 12345
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

This behaviour is not what is stated in the Add-on Documentation:

Option: logins (optional)

A list of local users that will be created with username and password. You don’t need to do this because you can use Home Assistant users too, without any configuration. If a local user is specifically desired:

Now that I figure all out I will update my bug report :slight_smile:

1 Like