# \[solved\] Openhab 3 unable to discover mqtt things with auto discovery

**URL:** <https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254>\
**Category:** Beginners\
**Tags:** mqtt-binding, homeassistant, openhab3\
**Created:** [January 15, 2021, 3:45pm UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254 "2021-01-15T15:45:08Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mario\_Almeida](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/c57346/32.png) [@Mario\_Almeida](https://community.openhab.org/u/Mario_Almeida)\
**Post date:** [January 15, 2021, 3:45pm UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254/1 "2021-01-15T15:45:08Z")

</div>

Hi All,

I am using homeassistant standard as below, and manually publishing the topic, but OH3 is unable to discover anything, even if I click the scan button, it is not able to find it.

> homeassistant/binary\_sensor/253/pir/config

Logs:

> 19:34:54.214 [DEBUG] [.core.karaf.internal.FeatureInstaller] - Running scheduled sync job  
> 19:35:53.253 [DEBUG] [internal.DiscoveryServiceRegistryImpl] - Trying to start 2 scans with an aggregating listener.  
> 19:35:53.255 [DEBUG] [internal.DiscoveryServiceRegistryImpl] - Triggering scan for thing types ‘[mqtt:systemBroker, mqtt:broker]’ on ‘MqttServiceDiscoveryService’…  
> 19:35:53.256 [DEBUG] [internal.DiscoveryServiceRegistryImpl] - Finished 1 of 2 discovery services.  
> 19:35:53.257 [DEBUG] [internal.DiscoveryServiceRegistryImpl] - Triggering scan for thing types ‘[mqtt:homie300]’ on ‘Homie300Discovery’…  
> 19:35:53.258 [DEBUG] [internal.DiscoveryServiceRegistryImpl] - Finished 2 of 2 discovery services.  
> 19:35:53.259 [DEBUG] [.internal.discovery.DiscoveryResource] - Scan for binding ‘mqtt’ successfully finished.

```
runtimeInfo:
  version: 3.1.0
  buildString: "Build #2143"
locale: en_US
systemInfo:
  configFolder: /openhab/conf
  userdataFolder: /openhab/userdata
  logFolder: /openhab/userdata/logs
  javaVersion: 11.0.9
  javaVendor: Azul Systems, Inc.
  javaVendorVersion: Zulu11.43+21-CA
  osName: Linux
  osVersion: 5.8.0-38-generic
  osArchitecture: amd64
  availableProcessors: 8
  freeMemory: 799574744
  totalMemory: 1522532352
bindings:
  - mqtt
clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: false
    macos: false
    windows: false
    cordova: false
    phonegap: false
    electron: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    pixelRatio: 1
    prefersColorScheme: light
  isSecureContext: true
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: 8
    hardwareConcurrency: 8
    language: en-US
    languages:
      - en-US
      - en
    onLine: true
    platform: Linux x86_64
  screen:
    width: 1920
    height: 1080
    colorDepth: 24
  support:
    touch: false
    pointerEvents: true
    observer: true
    passiveListener: true
    gestures: false
    intersectionObserver: true
  themeOptions:
    dark: light
    filled: true
    pageTransitionAnimation: default
    bars: filled
    homeNavbar: default
    homeBackground: default
    expandableCardAnimation: default
  userAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like
    Gecko) Chrome/87.0.4280.141 Safari/537.36
timestamp: 2021-01-15T15:44:26.212Z

```

---

<div class="post-metadata">

**Author:** ![hafniumzinc](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@hafniumzinc](https://community.openhab.org/u/hafniumzinc)\
**Post date:** [January 15, 2021, 3:46pm UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254/2 "2021-01-15T15:46:14Z")

</div>

Do you have the JINJA and JSONPATH Transformation Services installed?

---

<div class="post-metadata">

**Author:** ![Mario\_Almeida](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/c57346/32.png) [@Mario\_Almeida](https://community.openhab.org/u/Mario_Almeida)\
**Post date:** [January 15, 2021, 3:50pm UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254/3 "2021-01-15T15:50:23Z")

</div>

Yes,

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/7/f/7fd52717cf1a6c7744fc95b8f5488cf8517498af.png)

> 233 │ Active │ 75 │ 3.1.0.202101150350 │ openHAB Add-ons :: Bundles :: Transformation Service :: Jinja  
> 235 │ Active │ 75 │ 3.1.0.202101150350 │ openHAB Add-ons :: Bundles :: Transformation Service :: JSonPath

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [January 15, 2021, 4:18pm UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254/4 "2021-01-15T16:18:50Z")

</div>

There is a toggle on the MQTT Broker thing to enable/disable autodiscovery. Is autodiscovery turned on?

---

<div class="post-metadata">

**Author:** ![Mario\_Almeida](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/c57346/32.png) [@Mario\_Almeida](https://community.openhab.org/u/Mario_Almeida)\
**Post date:** [January 15, 2021, 4:23pm UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254/5 "2021-01-15T16:23:06Z")

</div>

Yes,

> UID: mqtt:broker:gateway  
> label: MQTT Gateway  
> thingTypeUID: mqtt:broker  
> configuration:  
> lwtQos: 0  
> publickeypin: true  
> clientID: openhab  
> keepAlive: 60  
> qos: 0  
> reconnectTime: 60000  
> port: 1883  
> host: 192.168.1.101  
> secure: false  
> certificatepin: true  
> lwtRetain: true  
> enableDiscovery: true  
> location: Workshop

Here are the logs If I manually create HomeAssistant MQTT Component

> 20:19:04.833 [TRACE] [o.transport.mqtt.MqttBrokerConnection] - subscribeRaw message consumer for topic ‘homeassistant/sensor/253/temperature/state’ from broker ‘192.168.1.101’  
> 20:19:04.837 [TRACE] [o.transport.mqtt.MqttBrokerConnection] - Successfully subscribed to topic homeassistant/sensor/253/temperature/state  
> 20:19:04.838 [DEBUG] [hab.binding.mqtt.generic.ChannelState] - Subscribed channel mqtt:homeassistant:gateway:7f7891901f:253\_5Ftemperature\_5Fsensor#sensor to topic: homeassistant/sensor/253/temperature/state  
> 20:19:31.863 [TRACE] [assistant.internal.DiscoverComponents] - Found HomeAssistant thing temperature component sensor

But not via auto-discovery.

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [January 15, 2021, 4:49pm UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254/6 "2021-01-15T16:49:30Z")

</div>

Either this is a bug or you have to manually create the HomeAssistant Things like your log seems to indicate. It does say that it “Found HomeAssistant thing” so there is some sort of discovery going on. You wouldn’t see those logs if you created a Generic MQTT Thing.

---

<div class="post-metadata">

**Author:** ![Mario\_Almeida](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/c57346/32.png) [@Mario\_Almeida](https://community.openhab.org/u/Mario_Almeida)\
**Post date:** [January 15, 2021, 5:04pm UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254/7 "2021-01-15T17:04:20Z")

</div>

No, I did not create the Generic MQTT Think. but HomeAssistant MQTT Component as below.

![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/5/b5613449a483e456557384d8488bb4a8acf9d2e4.png)

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/5/4/541c103026f7312275158a311e9a51f0b4b76e8e.png)

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/8/8/88a5581e7db426ce66025568a1f0335b3c1f4602.png)

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [January 15, 2021, 5:06pm UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254/8 "2021-01-15T17:06:26Z")

</div>

So, did you create the Broker Thing?

---

<div class="post-metadata">

**Author:** ![Mario\_Almeida](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/c57346/32.png) [@Mario\_Almeida](https://community.openhab.org/u/Mario_Almeida)\
**Post date:** [January 15, 2021, 5:15pm UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254/9 "2021-01-15T17:15:56Z")

</div>

Yes, below rite? Or, is it something else?

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/d/5/d5f3a55b490864237ce6e65b3fb0aed039889386.png)

```
UID: mqtt:broker:gateway
label: MQTT Gateway
thingTypeUID: mqtt:broker
configuration:
  lwtQos: 0
  publickeypin: true
  clientID: openhab2.5
  keepAlive: 60
  qos: 0
  reconnectTime: 60000
  port: 1883
  host: 192.168.1.101
  secure: false
  certificatepin: true
  lwtRetain: true
  enableDiscovery: true
location: Workshop

```

---

<div class="post-metadata">

**Author:** ![Mario\_Almeida](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/c57346/32.png) [@Mario\_Almeida](https://community.openhab.org/u/Mario_Almeida)\
**Post date:** [January 15, 2021, 5:53pm UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254/10 "2021-01-15T17:53:29Z")

</div>

Issue resolved.

```
sudo systemctl stop openhab.service
sudo openhab-cli clean-cache
sudo systemctl start openhab.service

```

---

<div class="post-metadata">

**Author:** ![guny74](https://community.openhab.org/user_avatar/community.openhab.org/guny74/32/108565_2.png) [@guny74](https://community.openhab.org/u/guny74)\
**Post date:** [January 8, 2023, 11:57am UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254/11 "2023-01-08T11:57:01Z")

</div>

> [@Mario\_Almeida](#):
>
> `clean-cache`

I have the same issue, but running docker…there

`systemctl` does not exists… Any idea so soöve this at Docker ?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [January 8, 2023, 5:57pm UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254/12 "2023-01-08T17:57:01Z")

</div>

So the container.  
Delete the contents of the cache and temp folders under the userdata.  
Restart the container.

---

<div class="post-metadata">

**Author:** ![guny74](https://community.openhab.org/user_avatar/community.openhab.org/guny74/32/108565_2.png) [@guny74](https://community.openhab.org/u/guny74)\
**Post date:** [January 8, 2023, 7:47pm UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254/13 "2023-01-08T19:47:49Z")

</div>

Thank you,

…but this did not solve my problem with the “auto discovery” for zigbee2mqtt..

Any Idea ?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [January 8, 2023, 11:24pm UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254/14 "2023-01-08T23:24:24Z")

</div>

I don’t the l use zigbee2mqtt do I’ve no ideas. I know zigbee2mqtt head multiple modes, maybe you are not using one of the discoverable modes.

---

<div class="post-metadata">

**Author:** ![Fabio\_Pergola](https://community.openhab.org/user_avatar/community.openhab.org/fabio_pergola/32/77867_2.png) [@Fabio\_Pergola](https://community.openhab.org/u/Fabio_Pergola)\
**Post date:** [October 14, 2024, 2:42pm UTC](https://community.openhab.org/t/solved-openhab-3-unable-to-discover-mqtt-things-with-auto-discovery/114254/15 "2024-10-14T14:42:41Z")

</div>

hey @Mario_Almeida @guny74 , you guys still using the HA MQTT Binding?  
im new to Openhab, i setup an MQTT binding, its online:  
 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/6/b/6bd27e22c7fa7dc1ab95ec5d4511f1bacbdd6c8c.png)

in HA, im exposing all light/switch entities to MQTT, i use a seperate base topic “openhab”  
i see all my lights/switches in MQTT, so for example , i want to add thim item below

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/6/0/60b8341fb443edfaac7181e34ae5382814aa9e0d.png)

But its giving me an unknown state ? what am i missing?

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/6/c/6cb5a23ec184195996f22ffef1f4752c84b3c076.png)
