[SOLVED] MQTT Help-cant read data to openhab

  • Platform information:
    • Hardware:Raspberry pi 3

    • OS: 2018-03-13-raspbian-stretch

    • Java Runtime Environment: java version “1.8.0_171”
      Java™ SE Runtime Environment (build 1.8.0_171-b11)
      Java HotSpot™ Client VM (build 25.171-b11, mixed mode)

    • openHAB version: 2.2

  • Issue of the topic: I can’t get my openhab to get information from my mutt I have tested it with mqtt-spy. even node red can read information from the server.
  • Please post configurations (if applicable):
    • Items configuration related to the issue :
      Number Bathroom_Temperature “Temperature” (Bathroom) {mqtt="<[flatcntr:/TempCNTR/test/Temperature:string:default]"}
      Number Bathroom_Humidity “Humidity [%.1F %%]” (Bathroom) {mqtt="<[flatcntr:/TempCNTR/test/Humidity:state:default]"}

    • Sitemap configuration related to the issue
      sitemap flat label=“FLAT” {
      Frame {
      Group item=Bathroom
      }

      Frame {
      Text label=“Light” icon=“light” {
      Default item=Bathroom_Light label=“Bathroom”
      }

      Text label="Fan" icon="fan_ceiling" {
          Default item=Bathroom_Fan label="Bathroom"
      }
      
      Text label="Temperature" icon="temperature" {
          Default item=Bathroom_Temperature label="Bathroom"
      }
      
      Text label="Humidity" icon="humidity" {
          Default item=Bathroom_Humidity label="Bathroom"
      }
      

      }
      }

    • Services configuration related to the issue

Define your MQTT broker connections here for use in the MQTT Binding or MQTT

Persistence bundles. Replace with an ID you choose.

URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883

.url=ssl://localhost:1883

Optional. Client id (max 23 chars) to use when connecting to the broker.

If not provided a random default is generated.

flatcntr=

Optional. True or false. If set to true, allows the use of clientId values

up to 65535 characters long. Defaults to false.

NOTE: clientId values longer than 23 characters may not be supported by all

MQTT servers. Check the server documentation.

#.allowLongerClientIds=false

Optional. User id to authenticate with the broker.

#.user=

Optional. Password to authenticate with the broker.

#.pwd=

Optional. Set the quality of service level for sending messages to this broker.

Possible values are 0 (Deliver at most once),1 (Deliver at least once) or 2

(Deliver exactly once). Defaults to 0.

#.qos=

Optional. True or false. Defines if the broker should retain the messages sent to

it. Defaults to false.

#.retain=

Optional. True or false. Defines if messages are published asynchronously or

synchronously. Defaults to true.

#.async=

Optional. Defines the last will and testament that is sent when this client goes offline

Format: topic:message:qos:retained

#.lwt=

I am new to this. I have a esp8266 with a dht sensor. running espeasy
I can see the information is coming to the mqtt broker but I just can’t get the info in to openhab.
this is part of my cnew system for climate monitoring. I am also adding more to it my sonoff touch are getting delivered today.

Your url definition is wrong

flatcntr.url=tcp://localhost:1883
and
comment out the client Id (It’s optional)
#flatcntr=

did the changes and received this in the log

09:38:06.181 [INFO ] [rt.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection ‘’
09:38:06.185 [DEBUG] [rt.mqtt.internal.MqttBrokerConnection] - Creating new client for ‘ssl://localhost:1883’ using id ‘paho58712023007635’ and file store ‘/var/lib/openhab2/tmp/’
09:38:06.415 [ERROR] [openhab.io.transport.mqtt.MqttService] - Error starting broker connection
org.eclipse.paho.client.mqttv3.MqttException: MqttException
at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:38) [208:org.openhab.io.transport.mqtt:1.11.0]
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:664) [208:org.openhab.io.transport.mqtt:1.11.0]
at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210) ~[?:?]
at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[?:?]
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465) ~[?:?]
at sun.security.ssl.InputRecord.read(InputRecord.java:503) ~[?:?]
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983) ~[?:?]
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385) ~[?:?]
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413) ~[?:?]
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397) ~[?:?]
at org.eclipse.paho.client.mqttv3.internal.SSLNetworkModule.start(SSLNetworkModule.java:93) ~[?:?]
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:650) ~[?:?]
… 1 more

09:38:05.671 [ERROR] [del.item.internal.GenericItemProvider] - Binding configuration of type ‘mqtt’ of item ‘Bathroom_Temperature’ could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: Configuration ‘flatcntr:/TempCNTR/test/Temperature:string:default’ is not a valid inbound configuration: Invalid type.

09:56:07.151 [WARN ] [.ui.internal.items.ItemUIRegistryImpl] - Exception while formatting undefined value [sourcePattern=%.1F %ºC, targetPattern=%1$s %ºC, {}]
java.util.UnknownFormatConversionException: Conversion = ‘º’
at java.util.Formatter.checkText(Formatter.java:2579) [?:?]
at java.util.Formatter.parse(Formatter.java:2565) [?:?]
at java.util.Formatter.format(Formatter.java:2501) [?:?]
at java.util.Formatter.format(Formatter.java:2455) [?:?]
at java.lang.String.format(String.java:2940) [?:?]
at org.eclipse.smarthome.ui.internal.items.ItemUIRegistryImpl.formatUndefined(ItemUIRegistryImpl.java:434) [155:org.eclipse.smarthome.ui:0.10.0.b1]
at org.eclipse.smarthome.ui.internal.items.ItemUIRegistryImpl.getLabel(ItemUIRegistryImpl.java:345) [155:org.eclipse.smarthome.ui:0.10.0.b1]
at org.eclipse.smarthome.io.rest.sitemap.internal.SitemapResource.createWidgetBean(SitemapResource.java:417) [129:org.eclipse.smarthome.io.rest.sitemap:0.10.0.b1]
at org.eclipse.smarthome.io.rest.sitemap.internal.SitemapResource.createPageBean(SitemapResource.java:383) [129:org.eclipse.smarthome.io.rest.sitemap:0.10.0.b1]
at org.eclipse.smarthome.io.rest.sitemap.internal.SitemapResource.getPageBean(SitemapResource.java:288) [129:org.eclipse.smarthome.io.rest.sitemap:0.10.0.b1]
at org.eclipse.smarthome.io.rest.sitemap.internal.SitemapResource.getPageData(SitemapResource.java:222) [129:org.eclipse.smarthome.io.rest.sitemap:0.10.0.b1]
at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76) [15:com.eclipsesource.jaxrs.publisher:5.3.1.201602281253]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [85:org.eclipse.jetty.security:9.3.22.v20171030]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:284) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.Server.handle(Server.java:534) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [79:org.eclipse.jetty.io:9.3.22.v20171030]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [79:org.eclipse.jetty.io:9.3.22.v20171030]
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [79:org.eclipse.jetty.io:9.3.22.v20171030]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [90:org.eclipse.jetty.util:9.3.22.v20171030]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [90:org.eclipse.jetty.util:9.3.22.v20171030]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [90:org.eclipse.jetty.util:9.3.22.v20171030]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [90:org.eclipse.jetty.util:9.3.22.v20171030]
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [90:org.eclipse.jetty.util:9.3.22.v20171030]
at java.lang.Thread.run(Thread.java:748) [?:?]
09:56:08.456 [WARN ] [.ui.internal.items.ItemUIRegistryImpl] - Exception while formatting undefined value [sourcePattern=%.1F %ºC, targetPattern=%1$s %ºC, {}]
java.util.UnknownFormatConversionException: Conversion = ‘º’
at java.util.Formatter.checkText(Formatter.java:2579) [?:?]
at java.util.Formatter.parse(Formatter.java:2565) [?:?]
at java.util.Formatter.format(Formatter.java:2501) [?:?]
at java.util.Formatter.format(Formatter.java:2455) [?:?]
at java.lang.String.format(String.java:2940) [?:?]
at org.eclipse.smarthome.ui.internal.items.ItemUIRegistryImpl.formatUndefined(ItemUIRegistryImpl.java:434) [155:org.eclipse.smarthome.ui:0.10.0.b1]
at org.eclipse.smarthome.ui.internal.items.ItemUIRegistryImpl.getLabel(ItemUIRegistryImpl.java:345) [155:org.eclipse.smarthome.ui:0.10.0.b1]
at org.eclipse.smarthome.io.rest.sitemap.internal.SitemapResource.createWidgetBean(SitemapResource.java:417) [129:org.eclipse.smarthome.io.rest.sitemap:0.10.0.b1]
at org.eclipse.smarthome.io.rest.sitemap.internal.SitemapResource.createPageBean(SitemapResource.java:383) [129:org.eclipse.smarthome.io.rest.sitemap:0.10.0.b1]
at org.eclipse.smarthome.io.rest.sitemap.internal.SitemapResource.getPageBean(SitemapResource.java:288) [129:org.eclipse.smarthome.io.rest.sitemap:0.10.0.b1]
at org.eclipse.smarthome.io.rest.sitemap.internal.SitemapResource.getPageData(SitemapResource.java:222) [129:org.eclipse.smarthome.io.rest.sitemap:0.10.0.b1]
at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [177:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) [178:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) [175:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76) [15:com.eclipsesource.jaxrs.publisher:5.3.1.201602281253]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [85:org.eclipse.jetty.security:9.3.22.v20171030]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:284) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.Server.handle(Server.java:534) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [79:org.eclipse.jetty.io:9.3.22.v20171030]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [79:org.eclipse.jetty.io:9.3.22.v20171030]
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [79:org.eclipse.jetty.io:9.3.22.v20171030]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [90:org.eclipse.jetty.util:9.3.22.v20171030]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [90:org.eclipse.jetty.util:9.3.22.v20171030]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [90:org.eclipse.jetty.util:9.3.22.v20171030]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [90:org.eclipse.jetty.util:9.3.22.v20171030]
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [90:org.eclipse.jetty.util:9.3.22.v20171030]
at java.lang.Thread.run(Thread.java:748) [?:?]

Please read the following first:

It is almost impossible to read your posts, therefore its even harder to analyze what’s wrong in your setting.
I see, you have got several errors:

09:38:06.415 [ERROR] [openhab.io.transport.mqtt.MqttService] - Error starting broker connection
org.eclipse.paho.client.mqttv3.MqttException: MqttException#
...
Caused by: java.net.SocketException: Connection reset

So for me it seems that the MQTT binding cannot connect to the broker. Please check if all settings are correct

After that you get many parsing errors:

09:38:05.671 [ERROR] [del.item.internal.GenericItemProvider] - Binding configuration of type ‘mqtt’ of item ‘Bathroom_Temperature’ could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: Configuration ‘flatcntr:/TempCNTR/test/Temperature:string:default’ is not a valid inbound configuration: Invalid type.

I guess that the STRING here is wrong. From my experience it is always either a state or a command.

09:56:07.151 [WARN ] [.ui.internal.items.ItemUIRegistryImpl] - Exception while formatting undefined value [sourcePattern=%.1F %ºC, targetPattern=%1$s %ºC, {}]
java.util.UnknownFormatConversionException: Conversion = ‘º’

You might want to use a lower case “f” here. See also https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax
OpenHab is using this formatter class and for formatting floats only a lower case f is specified.

1 Like

You need to read the docs:

The first binding is wrong the second is correct:

Number Bathroom_Temperature “Temperature” (Bathroom) {mqtt="<[flatcntr:/TempCNTR/test/Temperature:string:default]"}
Number Bathroom_Humidity “Humidity [%.1F %%]” (Bathroom) {mqtt="<[flatcntr:/TempCNTR/test/Humidity:state:default]"}

It should be:

Number Bathroom_Temperature “Temperature” (Bathroom) {mqtt="<[flatcntr:/TempCNTR/test/Temperature:state:default]"}
Number Bathroom_Humidity “Humidity [%.1F %%]” (Bathroom) {mqtt="<[flatcntr:/TempCNTR/test/Humidity:state:default]"}

You didn’t read my previous post properly:

your mqtt.cfg should be:
flatcntr.url=tcp://localhost:1883

NOT ssl

`

thank you
sorted .

You are welcome, but this was easy.
You just needed to read the docs carefully.
When you have a problem, always go back to the docs first. 90% of the time the answer of your problem will be there and you get to learn something by yourself at the same time.
The remaining 9%, someone will probably have tried it before and ask the forum and the answer will be there after a quick search.
The last 1% is when you ask a question in the forum. When you get really stuck.

Good luck, break things and learn

hi I think I broke it and can’t figure out what is going on. did everything back as it was and now it is not working.

What did you change?

my pi decided to go all screw you. and I had to load everything. did everything according to how it was working . the mqqt message from the temp sensor dos not display in open tab again.
I had a look at all my mqtt on the items and I think I am over looking something.

Ok, so you reloaded your PI with a fresh openhabian.
Have you got mosquitto running on it too?
Can you show me your mqtt.cfg?
And your openhab start up log, please?

04:28:52.155 [INFO ] [del.core.internal.ModelRepositoryImpl] - Refreshing model 'items.items'
04:28:52.302 [DEBUG] [.binding.mqtt.internal.MqttItemConfig] - Loaded MQTT config for item 'Bathroom_Temperature' : 1 subscribers, 0 publishers
04:28:52.399 [INFO ] [ab.core.service.AbstractActiveService] - HTTP Refresh Service has been shut down
04:28:52.438 [DEBUG] [.binding.mqtt.internal.MqttItemConfig] - Loaded MQTT config for item 'Bathroom_Humidity' : 1 subscribers, 0 publishers
04:28:52.671 [INFO ] [ab.core.service.AbstractActiveService] - HTTP Refresh Service has been started
04:28:52.671 [DEBUG] [.binding.mqtt.internal.MqttItemConfig] - Loaded MQTT config for item 'FamilyRoom_Light' : 1 subscribers, 2 publishers
04:28:52.878 [DEBUG] [.binding.mqtt.internal.MqttItemConfig] - Loaded MQTT config for item 'FamilyRoom_Pargola_Light' : 1 subscribers, 2 publishers
04:28:53.017 [DEBUG] [.binding.mqtt.internal.MqttItemConfig] - Loaded MQTT config for item 'FamilyRoom_Fan' : 1 subscribers, 2 publishers
04:29:23.038 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'Bathroom_Fan' received command ON
04:29:23.201 [INFO ] [smarthome.event.ItemStateChangedEvent] - Bathroom_Fan changed from NULL to ON
04:29:24.271 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'Bathroom_Fan' received command OFF
04:29:24.390 [INFO ] [smarthome.event.ItemStateChangedEvent] - Bathroom_Fan changed from ON to OFF

I use http to send commands to some relays that works .

but I can’t get the temp readings back .
here is my items :

Number   Bathroom_Temperature   "Temperature [%.1fC]"   <temperature>   (Bathroom)      {mqtt="<[flatcntr:/TempCNTR/test/Temperature:state:default]"}
Number   Bathroom_Humidity      "Humidity[%.1f%%]"      <humidity>      (Bathroom)         {mqtt="<[flatcntr:TempCNTR/test/Humidity:state:default]"}

mitt.cfg


```php
# URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883
flatcntr.url=:tcp//localhost:1883

Spot the difference:

flatcntr.url=tcp://localhost:1883

Thank you. that fixed. copy and past is a big Nono . sorry I am still learning and the vs code the L and l displays the same.

can you just have a look at these and just tel me if they are wrong. I want to trie and get these to work my self. just unsure .

Switch   FamilyRoom_Light         "Light"         <light>         (FamilyRoom, gLight)            {mqtt=">[flatcntr:LeefVertrek/relay/0/set:command:ON:1],>[flatcntr:LeefVertrek/relay/0/set:command:OFF:0],<[flatcntr:LeefVertrek/relay/0:state:DEFAULT]"}
Switch   FamilyRoom_Pargola_Light        "Pargola Light"         <light>         (FamilyRoom, gLight)  {mqtt="<[flatcntr:LeefVertrek/relay/2:state:DEFAULT],>[flatcntr:LeefVertrek/relay/2/set:command:ON:1],>[flatcntr:LeefVertrek/relay/2/set:command:OFF:0]"}
Switch   FamilyRoom_Fan           "Fan"           <fan_ceiling>   (FamilyRoom, gFan)              {mqtt=">[flatcntr:LeefVertrek/relay/1/set:command:ON:1],>[flatcntr:LeefVertrek/relay/1/set:command:OFF:0],<[flatcntr:LeefVertrek/relay/1:state:DEFAULT]"}
Number   FamilyRoom_Temperature   "Temperature"   <temperature>   (FamilyRoom, gTemperature)

do I need to create a .map for them ?

log : gives me this :

04:51:00.021 [WARN ] [ab.core.events.EventPublisherDelegate] - given new state is NULL, couldn't post update for 'FamilyRoom_Light'
04:51:00.022 [INFO ] [smarthome.event.ItemStateChangedEvent] - Bathroom_Humidity changed from 55.0 to 56.0
04:51:00.036 [WARN ] [ab.core.events.EventPublisherDelegate] - given new state is NULL, couldn't post update for 'FamilyRoom_Fan'
04:51:00.045 [WARN ] [ab.core.events.EventPublisherDelegate] - given new state is NULL, couldn't post update for 'FamilyRoom_Pargola_Light

Yes I would advise you to create 2 maps files:

0OFF1ON.map

NULL=NULL
-=NULL
0=OFF
1=ON

OFF0ON1.map

NULL=NULL
-=NULL
OFF=0
ON=1

And your items become:

Switch   FamilyRoom_Light         "Light"         <light>         (FamilyRoom, gLight)            {mqtt=">[flatcntr:LeefVertrek/relay/0/set:command:*:MAP(OFF0ON1.map)],<[flatcntr:LeefVertrek/relay/0:state:MAP(0OFF1ON.map)]"}
Switch   FamilyRoom_Pargola_Light        "Pargola Light"         <light>         (FamilyRoom, gLight)  {mqtt=">[flatcntr:LeefVertrek/relay/2/set:command:*:MAP(OFF0ON1.map)],<[flatcntr:LeefVertrek/relay/2:state:MAP(0OFF1ON.map)]"}
Switch   FamilyRoom_Fan           "Fan"           <fan_ceiling>   (FamilyRoom, gFan)              {mqtt=">[flatcntr:LeefVertrek/relay/1/set:command:*:MAP(OFF01ON.map)],<[flatcntr:LeefVertrek/relay/1:state:MAP(0OFF1ON.map)]"}

thank you.

changed it :

Switch   FamilyRoom_Light         "Light"         <light>         (FamilyRoom, gLight)            {mqtt=">[flatcntr:LeefVertrek/relay/0/set:command:*:MAP(OFF0ON1.map)],<[flatcntr:LeefVertrek/relay/0:state:MAP(0OFF1ON.map)]"}
Switch   FamilyRoom_Pargola_Light        "Pargola Light"         <light>         (FamilyRoom, gLight)  {mqtt=">[flatcntr:LeefVertrek/relay/2/set:command:*:MAP(OFF0ON1.map)],<[flatcntr:LeefVertrek/relay/2:state:MAP(0OFF1ON.map)]"}
Switch   FamilyRoom_Fan           "Fan"           <fan_ceiling>   (FamilyRoom, gFan)              {mqtt=">[flatcntr:LeefVertrek/relay/1/set:command:*:MAP(OFF01ON.map)],<[flatcntr:LeefVertrek/relay/1:state:MAP(0OFF1ON.map)]"}
Number   FamilyRoom_Temperature   "Temperature"   <temperature>   (FamilyRoom, gTemperature)

now I get this :

06:05:32.524 [WARN ] [ab.core.events.EventPublisherDelegate] - given new state is NULL, couldn't post update for 'FamilyRoom_Light'
06:05:33.257 [DEBUG] [g.mqtt.internal.MqttMessageSubscriber] - Received message before transformation service '{}' was initialized.
06:05:33.266 [WARN ] [b.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MAP
06:05:33.275 [DEBUG] [tt.internal.AbstractMqttMessagePubSub] - No transformation service found for MAP
06:05:33.283 [WARN ] [ab.core.events.EventPublisherDelegate] - given new state is NULL, couldn't post update for 'FamilyRoom_Light'