woot woot, it magically started working. well, not really. I had both the mqtt and the embedded mqtt services installing. Also, had to remove the last / in the topics. Thanks for the help @Udo_Hartmann!!!
Hello,
That is up to you as both approaches will work. If the garage doors are right next to each other it would probably make more sense to have one thing with two channels (eg right door and left door) but if they are separate from each other it might make more sense in your hierarchy to have two things with a channel each. You will have to link items too the channels anyway and they won’t care what thing the channel belongs to.
Best regards Johannes
Thanks for the reply, how do check current state of a channel returned, or do I create another channel to receive state?
one thing for switch and one for state?
I use this in my oh 2.3 rule to check if door left open
I’m seeing the following errors which I’m not sure why:
2019-06-06 21:15:21.374 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'Runnable.run()' on 'org.eclipse.smarthome.core.thing.internal.ThingManagerImpl$$Lambda$693/322684888@f7ef772': org.eclipse.smarthome.binding.mqtt.generic.internal.handler.GenericThingHandler cannot be cast to org.eclipse.smarthome.binding.mqtt.handler.AbstractBrokerHandler
java.lang.ClassCastException: org.eclipse.smarthome.binding.mqtt.generic.internal.handler.GenericThingHandler cannot be cast to org.eclipse.smarthome.binding.mqtt.handler.AbstractBrokerHandler
at org.eclipse.smarthome.binding.mqtt.internal.MqttBrokerHandlerFactory.lambda$0(MqttBrokerHandlerFactory.java:83) ~[?:?]
at java.util.WeakHashMap.forEach(WeakHashMap.java:1025) ~[?:?]
at java.util.Collections$SynchronizedMap.forEach(Collections.java:2647) ~[?:?]
at org.eclipse.smarthome.binding.mqtt.internal.MqttBrokerHandlerFactory.removeHandler(MqttBrokerHandlerFactory.java:83) ~[?:?]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory.unregisterHandler(BaseThingHandlerFactory.java:261) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.lambda$5(ThingManagerImpl.java:811) ~[?:?]
at sun.reflect.GeneratedMethodAccessor130.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.10.0.oh240]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
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) [?:?]
I sorry Im no help here as I dont use thing files for the mqtt Binding but do it all through paper ui
edit: are your contacts actually sending OPEN / CLOSED Values? and Im not quite sure if it makes sense to linka type contact to a string item. But thats just me guessing
You linked a channel for the contacts that doesn’t exist (correct Channels GarageStateDoor1/GarageStateDoor2 used Channels for items GarageDoor1Status/GarageDoor2Status)
2019-06-07 07:01:27.867 [ERROR] [utomation.module.script.defaultscope] - bundle org.eclipse.smarthome.automation.module.script.defaultscope:0.10.0.oh240 (218)[org.eclipse.smarthome.automation.module.script.de
faultscope.internal.DefaultScriptScopeProvider(271)] : The addThingActions method has thrown an exception
java.lang.NullPointerException: null
at org.eclipse.smarthome.automation.module.script.defaultscope.internal.DefaultScriptScopeProvider.addThingActions(DefaultScriptScopeProvider.java:125) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.apache.felix.scr.impl.inject.methods.BaseMethod.invokeMethod(BaseMethod.java:228) ~[?:?]
at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$500(BaseMethod.java:41) ~[?:?]
at org.apache.felix.scr.impl.inject.methods.BaseMethod$Resolved.invoke(BaseMethod.java:664) ~[?:?]
at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:510) ~[?:?]
at org.apache.felix.scr.impl.inject.methods.BindMethod.invoke(BindMethod.java:42) ~[?:?]
at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:1809) ~[?:?]
at org.apache.felix.scr.impl.manager.DependencyManager.bindDependency(DependencyManager.java:1637) ~[?:?]
at org.apache.felix.scr.impl.manager.DependencyManager.bind(DependencyManager.java:1625) ~[?:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:301) ~[?:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:114) ~[?:?]
every thing seems to more or less works albeit some strange errors in openhab.log
another message I don’t understand I get this error:
Cannot add “ItemChannelLink” with key “GarageDoor2 → mqtt:topic:mqttbroker:garagedoors:GarageDoor2”. It exists already from provider “GenericItemChannelLinkProvider”! Failed to add a second with the same UID from provider “ManagedItemChannelLinkProvider”!
Do you have or had the “Simple Mode” on? That way an item is created for each channel automatically and the theitem is also linked automatically.
You migth need the delete such links and channels either via PaperUI or via the JSON stored database for those.