[SOLVED] Getting status from tasmota in string with mqtt

Hi there,

As some may know I’m starting to use tasmota in combination with openhab2, as you can see in following link:

https://community.openhab.org/t/solved-tasmota-mqtt-with-config-files/85673

So in my .things I’ve this:

Bridge mqtt:broker:mosquitto [ host="192.168.178.39", secure=false ]
{
    Thing mqtt:topic:Bathroom_Boiler_Control "Bathroom Boiler Control" @ "Haardvuur Controller"{
    Channels:
        Type switch : Bathroom_Boiler_Relay [ stateTopic="stat/tasmota-switch/POWER", commandTopic="cmnd/tasmota-switch/POWER", on="ON", off="OFF" ]        

    }
}

I would like to know the status I receive from

"stat/tasmota-switch/POWER

in a String. So I can use this information for further manipulations.

I just dont know how to get this. I tried to add

Type String : Bathroom_Boiler_Status [ stateTopic="stat/tasmota-switch/POWER" ]

in the channels. But I get errors in the paper UI
Is there an other way?

In .Sitemap I’ve added:

Text item=Bathroom_Boiler_Status label="status tasmota: [%s]"

But that doesn’t bring me much further and it just displays a “-”.
Could someone help me?

Need to add [%s] to item for string. I use item files but I think you can do this via PaperUI or REST?

Closest example I have at the moment. You would use the [%s] in your item where [%.1f °F] is in example.

Number LivingRoom_Light_Temp "Temperature [%.1f °F]"      <temp>             { channel="mqtt:topic:pibroker:sonoff11:temperature" }

EDIT: In PaperUI > Configuration > Things > select your things then click the pencil icon to edit the channel. Next click show more at bottom left and you will see options to add the %s in appropriate spot.

Hi H102, Thx for your reply again!

So I’ve this now
log:

==> /var/log/openhab2/events.log <==
2019-11-24 17:04:30.740 [hingStatusInfoChangedEvent] - 'mqtt:topic:Bathroom_Boiler_Control' changed from ONLINE to UNINITIALIZED
2019-11-24 17:04:30.799 [hingStatusInfoChangedEvent] - 'mqtt:topic:Bathroom_Boiler_Control' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2019-11-24 17:04:30.824 [hingStatusInfoChangedEvent] - 'mqtt:broker:mosquitto' changed from ONLINE to UNINITIALIZED
2019-11-24 17:04:30.910 [hingStatusInfoChangedEvent] - 'mqtt:broker:mosquitto' changed from UNINITIALIZED to OFFLINE
2019-11-24 17:04:30.964 [hingStatusInfoChangedEvent] - 'mqtt:broker:mosquitto' changed from OFFLINE to UNINITIALIZED (HANDLER_MISSING_ERROR)

Items:

Switch Bathroom_Tasmota_Relay "Tasmota" <switch> {channel="mqtt:topic:Bathroom_Boiler_Control:Bathroom_Boiler_Relay" }
String Bathroom_Tasmota_Status "Mode: [%s]"  <colorlight> {channel="mqtt:topic:Bathroom_Boiler_Control:Bathroom_Relay_Status"}

things:

Bridge mqtt:broker:mosquitto [ host="192.168.178.39", secure=false ]
{
    Thing mqtt:topic:Bathroom_Boiler_Control "Bathroom Boiler Control" @ "Haardvuur Controller"{
    Channels:
        Type switch : Bathroom_Boiler_Relay [ stateTopic="stat/tasmota-switch/POWER", commandTopic="cmnd/tasmota-switch/POWER", on="ON", off="OFF" ]        
        Type String : Bathroom_Boiler_Status [ stateTopic="stat/tasmota-switch/POWER" ]
    }
}

But as you can see the broker even gets offline.

Are you on OH version 2.4? If so and you made a change to the mqtt files then a restart of OH is needed sudo systemctl restart openhab2 This should get your broker back online and note that each time a mqtt file change is made a restart will be needed.

This bug has been fixed in later versions.

You have duplicate stateTopics so if this causes an issue change the String part “stat” to “tele”.

Type switch : Bathroom_Boiler_Relay [ stateTopic="stat/tasmota-switch/POWER"
Type String : Bathroom_Boiler_Status [ stateTopic="stat/tasmota-switch/POWER" ]

like this:

Type String : Bathroom_Boiler_Status [ stateTopic="tele/tasmota-switch/POWER" ]

Nice one, I always used Sudo reboot.

But not the desired effect:

==> /var/log/openhab2/openhab.log <==
2019-11-24 17:32:32.311 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Stopped Paper UI
2019-11-24 17:32:32.367 [INFO ] [panel.internal.HABPanelDashboardTile] - Stopped HABPanel
2019-11-24 17:32:32.380 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Stopped Home Builder
2019-11-24 17:32:32.422 [INFO ] [.dashboard.internal.DashboardService] - Stopped Dashboard
2019-11-24 17:32:51.095 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2019-11-24 17:32:51.191 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Started Home Builder at /homebuilder
2019-11-24 17:33:01.633 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'default.items'
2019-11-24 17:33:10.379 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'default.rules'
2019-11-24 17:33:10.799 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2019-11-24 17:33:11.557 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'default.sitemap'
2019-11-24 17:33:12.077 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'default.things' has errors, therefore ignoring it: [6,14]: mismatched input 'String' expecting RULE_ID


==> /var/log/openhab2/events.log <==
2019-11-24 17:33:12.232 [.ItemChannelLinkAddedEvent] - Link 'Bathroom_Tasmota_Relay-mqtt:topic:Bathroom_Boiler_Control:Bathroom_Boiler_Relay' has been added.
2019-11-24 17:33:12.240 [.ItemChannelLinkAddedEvent] - Link 'Bathroom_Tasmota_Status-mqtt:topic:Bathroom_Boiler_Control:Bathroom_Relay_Status' has been added.
2019-11-24 17:33:12.264 [.ItemChannelLinkAddedEvent] - Link 'network_servicedevice_0e1b06e8_latency-network:servicedevice:0e1b06e8:latency' has been added.
2019-11-24 17:33:12.269 [.ItemChannelLinkAddedEvent] - Link 'network_servicedevice_0e1b06e8_online-network:servicedevice:0e1b06e8:online' has been added.
2019-11-24 17:33:12.275 [.ItemChannelLinkAddedEvent] - Link 'mqtt_topic_Bathroom_Boiler_Control_Bathroom_Boiler_Relay-mqtt:topic:Bathroom_Boiler_Control:Bathroom_Boiler_Relay' has been added.
2019-11-24 17:33:12.286 [.ItemChannelLinkAddedEvent] - Link 'Sonoff_SonoffRelayCommand-mqtt:topic:34a42238:Sonoff_Relay_Command' has been added.
2019-11-24 17:33:12.291 [.ItemChannelLinkAddedEvent] - Link 'network_servicedevice_0e1b06e8_lastseen-network:servicedevice:0e1b06e8:lastseen' has been added.
2019-11-24 17:33:12.654 [hingStatusInfoChangedEvent] - 'network:servicedevice:0e1b06e8' changed from UNINITIALIZED to INITIALIZING
2019-11-24 17:33:12.737 [hingStatusInfoChangedEvent] - 'network:servicedevice:0e1b06e8' changed from INITIALIZING to ONLINE

==> /var/log/openhab2/openhab.log <==
2019-11-24 17:33:13.805 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.178.39:8080
2019-11-24 17:33:13.809 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.178.39:8443
2019-11-24 17:33:14.408 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui

==> /var/log/openhab2/events.log <==
2019-11-24 17:33:14.570 [vent.ItemStateChangedEvent] - network_servicedevice_0e1b06e8_lastseen changed from NULL to UNDEF
2019-11-24 17:33:15.622 [vent.ItemStateChangedEvent] - Livingroom_Woodfire_Relay changed from NULL to OFF
2019-11-24 17:33:15.915 [vent.ItemStateChangedEvent] - network_servicedevice_0e1b06e8_online changed from NULL to OFF
2019-11-24 17:33:15.934 [vent.ItemStateChangedEvent] - network_servicedevice_0e1b06e8_latency changed from NULL to -1.0
2019-11-24 17:33:15.941 [vent.ItemStateChangedEvent] - network_servicedevice_0e1b06e8_latency changed from -1.0 to UNDEF

==> /var/log/openhab2/openhab.log <==
2019-11-24 17:33:16.752 [ERROR] [ipse.smarthome.io.mqttembeddedbroker] - bundle org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240 (211)[org.eclipse.smarthome.io.mqttembeddedbroker.internal.EmbeddedBrokerServiceImpl(223)] : The activate method has thrown an exception
java.net.BindException: Address already in use
        at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
        at sun.nio.ch.Net.bind(Net.java:433) ~[?:?]
        at sun.nio.ch.Net.bind(Net.java:425) ~[?:?]
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:?]
        at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:128) ~[?:?]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:558) ~[?:?]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1283) ~[?:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:501) ~[?:?]
        at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:486) ~[?:?]
        at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:989) ~[?:?]
        at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:254) ~[?:?]
        at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:364) ~[?:?]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[?:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[?:?]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463) ~[?:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) ~[?:?]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[?:?]
        at java.lang.Thread.run(Thread.java:748) ~[?:?]
2019-11-24 17:33:16.853 [WARN ] [ipse.smarthome.io.mqttembeddedbroker] - FrameworkEvent WARNING - org.eclipse.smarthome.io.mqttembeddedbroker
org.osgi.framework.ServiceException: org.apache.felix.scr.impl.manager.SingleComponentManager.getService() returned a null service object
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:232) ~[?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111) ~[?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45) ~[?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:508) ~[?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461) ~[?:?]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:624) ~[?:?]
        at com.eclipsesource.jaxrs.publisher.internal.ResourceTracker.addingService(ResourceTracker.java:39) ~[?:?]
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941) ~[?:?]
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870) ~[?:?]
        at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) ~[?:?]
        at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) ~[?:?]
        at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901) ~[?:?]
        at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109) ~[?:?]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:920) ~[?:?]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) ~[?:?]
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) ~[?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862) ~[?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801) ~[?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127) ~[?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225) ~[?:?]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:469) ~[?:?]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:891) ~[?:?]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:877) ~[?:?]
        at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:128) ~[?:?]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:944) ~[?:?]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:727) ~[?:?]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:661) ~[?:?]
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:427) ~[?:?]
        at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:665) ~[?:?]
        at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:339) ~[?:?]
        at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:381) ~[?:?]
        at org.apache.felix.scr.impl.Activator.access$200(Activator.java:49) ~[?:?]
        at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:263) ~[?:?]
        at org.apache.felix.scr.impl.AbstractExtender.createExtension(AbstractExtender.java:196) ~[?:?]
        at org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:169) ~[?:?]
        at org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:49) ~[?:?]
        at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482) ~[?:?]
        at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415) ~[?:?]
        at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) ~[?:?]
        at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444) ~[?:?]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908) [?:?]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) ~[?:?]
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) ~[?:?]
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213) ~[?:?]
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120) ~[?:?]
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112) ~[?:?]
        at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:168) ~[?:?]
        at org.eclipse.osgi.container.Module.publishEvent(Module.java:476) ~[?:?]
        at org.eclipse.osgi.container.Module.start(Module.java:467) ~[?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1634) ~[?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1614) ~[?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1585) ~[?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1528) ~[?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) ~[?:?]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]
2019-11-24 17:33:16.870 [ERROR] [ipse.smarthome.io.mqttembeddedbroker] - bundle org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240 (211)[org.eclipse.smarthome.io.mqttembeddedbroker.internal.EmbeddedBrokerServiceImpl(223)] : The activate method has thrown an exception
java.net.BindException: Address already in use
        at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
        at sun.nio.ch.Net.bind(Net.java:433) ~[?:?]
        at sun.nio.ch.Net.bind(Net.java:425) ~[?:?]
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:?]
        at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:128) ~[?:?]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:558) ~[?:?]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1283) ~[?:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:501) ~[?:?]
        at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:486) ~[?:?]
        at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:989) ~[?:?]
        at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:254) ~[?:?]
        at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:364) ~[?:?]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[?:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[?:?]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463) ~[?:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) ~[?:?]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[?:?]
        at java.lang.Thread.run(Thread.java:748) ~[?:?]
==> /var/log/openhab2/openhab.log <==
2019-11-24 17:32:32.311 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Stopped Paper UI
2019-11-24 17:32:32.367 [INFO ] [panel.internal.HABPanelDashboardTile] - Stopped HABPanel
2019-11-24 17:32:32.380 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Stopped Home Builder
2019-11-24 17:32:32.422 [INFO ] [.dashboard.internal.DashboardService] - Stopped Dashboard
2019-11-24 17:32:51.095 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2019-11-24 17:32:51.191 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Started Home Builder at /homebuilder
2019-11-24 17:33:01.633 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'default.items'
2019-11-24 17:33:10.379 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'default.rules'
2019-11-24 17:33:10.799 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2019-11-24 17:33:11.557 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'default.sitemap'
2019-11-24 17:33:12.077 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'default.things' has errors, therefore ignoring it: [6,14]: mismatched input 'String' expecting RULE_ID


==> /var/log/openhab2/events.log <==
2019-11-24 17:33:12.232 [.ItemChannelLinkAddedEvent] - Link 'Bathroom_Tasmota_Relay-mqtt:topic:Bathroom_Boiler_Control:Bathroom_Boiler_Relay' has been added.
2019-11-24 17:33:12.240 [.ItemChannelLinkAddedEvent] - Link 'Bathroom_Tasmota_Status-mqtt:topic:Bathroom_Boiler_Control:Bathroom_Relay_Status' has been added.
2019-11-24 17:33:12.264 [.ItemChannelLinkAddedEvent] - Link 'network_servicedevice_0e1b06e8_latency-network:servicedevice:0e1b06e8:latency' has been added.
2019-11-24 17:33:12.269 [.ItemChannelLinkAddedEvent] - Link 'network_servicedevice_0e1b06e8_online-network:servicedevice:0e1b06e8:online' has been added.
2019-11-24 17:33:12.275 [.ItemChannelLinkAddedEvent] - Link 'mqtt_topic_Bathroom_Boiler_Control_Bathroom_Boiler_Relay-mqtt:topic:Bathroom_Boiler_Control:Bathroom_Boiler_Relay' has been added.
2019-11-24 17:33:12.286 [.ItemChannelLinkAddedEvent] - Link 'Sonoff_SonoffRelayCommand-mqtt:topic:34a42238:Sonoff_Relay_Command' has been added.
2019-11-24 17:33:12.291 [.ItemChannelLinkAddedEvent] - Link 'network_servicedevice_0e1b06e8_lastseen-network:servicedevice:0e1b06e8:lastseen' has been added.
2019-11-24 17:33:12.654 [hingStatusInfoChangedEvent] - 'network:servicedevice:0e1b06e8' changed from UNINITIALIZED to INITIALIZING
2019-11-24 17:33:12.737 [hingStatusInfoChangedEvent] - 'network:servicedevice:0e1b06e8' changed from INITIALIZING to ONLINE

==> /var/log/openhab2/openhab.log <==
2019-11-24 17:33:13.805 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.178.39:8080
2019-11-24 17:33:13.809 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.178.39:8443
2019-11-24 17:33:14.408 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui

==> /var/log/openhab2/events.log <==
2019-11-24 17:33:14.570 [vent.ItemStateChangedEvent] - network_servicedevice_0e1b06e8_lastseen changed from NULL to UNDEF
2019-11-24 17:33:15.622 [vent.ItemStateChangedEvent] - Livingroom_Woodfire_Relay changed from NULL to OFF
2019-11-24 17:33:15.915 [vent.ItemStateChangedEvent] - network_servicedevice_0e1b06e8_online changed from NULL to OFF
2019-11-24 17:33:15.934 [vent.ItemStateChangedEvent] - network_servicedevice_0e1b06e8_latency changed from NULL to -1.0
2019-11-24 17:33:15.941 [vent.ItemStateChangedEvent] - network_servicedevice_0e1b06e8_latency changed from -1.0 to UNDEF

==> /var/log/openhab2/openhab.log <==
2019-11-24 17:33:16.752 [ERROR] [ipse.smarthome.io.mqttembeddedbroker] - bundle org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240 (211)[org.eclipse.smarthome.io.mqttembeddedbroker.internal.EmbeddedBrokerServiceImpl(223)] : The activate method has thrown an exception
java.net.BindException: Address already in use
        at sun.nio.ch.Net.bind0(Native Method) ~[?:?]

Always stop OH before rebooting! sudo systemctl stop openhab2 then reboot.

You may need to clean the cache.

sudo systemctl stop openhab2

sudo openhab-cli clean-cache

sudo systemctl start openhab2

Also change String to string in item as it’s case sensitive.

Have you installed more than one broker?

Clue, big S little s
channel types are case sensitive
So are Item types, and unfortunately not the same

In the past I use to run 2 brokers. But that was not intended. Now there’s only one running, named: mosquitto.

@rossko57
So it is case sensitive. It has to be lower case s I assume?

I just spotted this myself…:laughing: Usually, you beat me to it.:smiley:

Yes lower case and sorry for not catching it in first post.:upside_down_face:

You may want to check via the console that only one broker is installed and active.

sudo openhab-cli console once console is open type bundle:list and check all bindings for duplicates.

Eureka!
Cleaning the cash was the ting to do it seems.
Or the lower case. One of the 2. Or both :slight_smile:

1 Like

:+1:

Looking at logs both was needed.:grin:

If your issue is solved please click the square box on the post that provided the solution.

Thanks