I’m new here, so apologies if I’m doing all wrong
I have my system running with a Xiaomi Hub, a Termometer also from Xiaomi and, as for now, some external calls with webhooks.
In order to avoid this webhook calls, that give sometimes an unreasonable delay, i’m configuring a MQTT device.
And here come my problems.
I installed mosquitto via “sudo openhabian-config” withouth password for now.
Then I went to Paperui GUI and installed “MQTT Binding” add-on
Created a mqtt.cfg file as follow:
mosquitto.url=tcp://192.168.0.52:1883
mosquitto.user=openhabian
Then I went to Configuration Things, and configured MQTT Broker
Broker Hostname: 192.168.0.52
Broker Port: 1883
Username: openhabian
MQTT Broker Thing is showed as ONLINE
Then I added a Sonoff TH10 with a Thermometer SI7021. (It was visible in my Inbox), but it shows as OFFLINE - GONE.
I have also created, as i saw on some guide, for testing purposes the following Item
Number mqtt_kitchen_gas "Gas Level [%.1f]" {mqtt="<[mosquitto:Home/Floor1/Kitchen/Gas_Sensor:state:default]"}
And added it for visualitation on my sitemap
Text item=mqtt_kitchen_gas icon="gas"
Then on a terminal I typed:
sudo mosquitto_pub -u openhabian --pw smarthomeblog -t “Home/Floor1/Kitchen/Gas_Sensor” -m 10
To update the value and test if all worked. Nothing changed.
I have the following error on my openhab.log.
2019-02-20 17:21:41.520 [ERROR] [g.discovery.AbstractDiscoveryService] - An error occurred while calling the discovery listener org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.
java.lang.NullPointerException: null
at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.thingRemoved(DiscoveryServiceRegistryImpl.java:278) ~[?:?]
at org.eclipse.smarthome.config.discovery.AbstractDiscoveryService.thingRemoved(AbstractDiscoveryService.java:300) ~[?:?]
at org.eclipse.smarthome.binding.mqtt.generic.internal.discovery.HomeAssistantDiscovery.receivedMessage(HomeAssistantDiscovery.java:164) ~[?:?]
at org.eclipse.smarthome.binding.mqtt.discovery.TopicSubscribe.processMessage(TopicSubscribe.java:52) ~[?:?]
at org.eclipse.smarthome.io.transport.mqtt.internal.ClientCallback.lambda$3(ClientCallback.java:90) ~[?:?]
at java.util.ArrayList.forEach(ArrayList.java:1257) [?:?]
at org.eclipse.smarthome.io.transport.mqtt.internal.ClientCallback.messageArrived(ClientCallback.java:90) [202:org.eclipse.smarthome.io.transport.mqtt:0.10.0.oh240]
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.deliverMessage(CommsCallback.java:499) [198:org.eclipse.paho.client.mqttv3:1.2.0]
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:402) [198:org.eclipse.paho.client.mqttv3:1.2.0]
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:206) [198:org.eclipse.paho.client.mqttv3:1.2.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
What am I missing? What can I do?
Thanks in advance.