How to show the item for OH1 binding

Hi,

I’m setting up OH 2.0 beta 4, and use MyQ binding (OH1 binding). I set the sitemap and item same as https://github.com/openhab/openhab/wiki/Chamberlain-MyQ-Binding
The binding seems to work fine. My question is, how do I add a thing? I don’t see the item or thing for MyQ binding from the UI. Right now, I cannot view the status or control it from Paper UI or classic UI or other UI out of box from OpenHAB 2.0.

Below is the log

14:14:14.554 [INFO ] [marthome.event.ItemStateChangedEvent] - GarageDoorString changed from NULL to Closed
14:14:14.556 [INFO ] [marthome.event.ItemStateChangedEvent] - GarageDoorShutter changed from NULL to 100
14:14:14.557 [INFO ] [marthome.event.ItemStateChangedEvent] - GarageDoorSwitch changed from NULL to OFF
14:14:14.558 [INFO ] [marthome.event.ItemStateChangedEvent] - GarageDoorContact changed from NULL to CLOSED

2 Likes

You can not add it as Thing Item in OH2.

For OH1 Bindings, you still need to add it same as you would into an items file. So define it your items and add to a sitemap to use it.

I do add items and sitemaps as in MyQ binding’s wiki.
The item is (from the wiki)

Switch GarageDoorSwitch “Garage Door Open” {myq=“0”}
Contact GarageDoorContact “Garage Door [%s]” {myq=“0”}
String GarageDoorString “Garage Door [%s]” {myq=“0”}
Rollershutter GarageDoorShutter “Garage Door Open” {myq=“0”}

The sitemap is (from the wiki)

Switch item=GarageDoorSwitch
Text item=GarageDoorString
Text item=GarageDoorContact
Switch item=GarageDoorShutter

From the log, it recognizes the items. But I just don’t see them on UI.

I must miss something. But I don’t know where to start to investigate.

To see your manually created items in Paper UI, check out:

You will not be able to control them via Paper UI, just view them as items.

To change the default sitemap in BasicUI (and/or ClassicUI): go in PaperUI > Configuration > Services > UI > BasicUI > Configure

See also:

BR,
Dim

Thanks.

To wrap it up, I made this changes:

  1. disable Item Linking from Configuration/System. There’ll be a new tab Item in Configuration.
  2. Create a _default.sitemap in conf/sitemaps (not to use myq.sitemap).
    The content is
    sitemap _default label="My Home Automation" {
     Frame label="MyQ" {
         Switch item=GarageDoorSwitch
         Text item=GarageDoorString
         Text item=GarageDoorContact
         Switch item=GarageDoorShutter
     }
    

}

The name after sitemap in the content must match the file name before .sitemap.

_default is the name used by classic ui and basic ui. It can be changed in Configuration/Services/Basic UI or Configuration/Services/Classic UI.

But it seems I can only control or view the status from Classic UI or Basic UI. By setting the sitemap that way, it excludes the things for OH2.

Mao (and all),

I recently moved from 1.8 to 2.0 … and think I’ve gotten my head around things. However, getting myq to work in my 2.0 setup has proven difficult. It must be a config/setup issue, but despite reading a lot of threads, I can’t seem to get the door to operate. (Never had an issue with 1.8 … and the door via the myq app still works fine.)

Some details:

  1. I installed the myq binding via PaperUI
  2. I followed the steps Mao indicated above.
  3. The right credentials are in services/myq.cfg.
  4. Using the basic UI, the switch, contact, status are shown and the switch can be turned on/off.
  5. In the event log, I see the commands being received for the garage door… but the door does not open/close.

Any help / suggestions for how to debug would be appreciated.

Thx,
b-man

Do you by any chance see this error or similar thing in the log? What I’m interested in is whether it’s connecting to the server successfully.

2017-01-22 01:10:27.112 [ERROR] [nhab.binding.myq.internal.MyqBinding] - Could not connect to MyQ service
java.io.IOException: Null response from MyQ server
at org.openhab.binding.myq.internal.MyqData.request(MyqData.java:186)[191:org.openhab.binding.myq:1.9.0.b4]
at org.openhab.binding.myq.internal.MyqData.getGarageData(MyqData.java:103)[191:org.openhab.binding.myq:1.9.0.b4]
at org.openhab.binding.myq.internal.MyqBinding.poll(MyqBinding.java:202)[191:org.openhab.binding.myq:1.9.0.b4]
at org.openhab.binding.myq.internal.MyqBinding.access$1(MyqBinding.java:194)[191:org.openhab.binding.myq:1.9.0.b4]
at org.openhab.binding.myq.internal.MyqBinding$1.run(MyqBinding.java:374)[191:org.openhab.binding.myq:1.9.0.b4]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)[:1.8.0_102]
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)[:1.8.0_102]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)[:1.8.0_102]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)[:1.8.0_102]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)[:1.8.0_102]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)[:1.8.0_102]
at java.lang.Thread.run(Unknown Source)[:1.8.0_102]

I was seeing the “Could not connect to MyQ service” a couple of days ago, but I am not seeing it now. (I’m not sure if that means something is fixed or if it means it is not even trying anymore.)

I just rebooted the Pi to view the logs. Very little is in the log. It shows the binding being installed and that is about it. Thoughts?

2017-02-16 07:48:44.971 [DEBUG] [org.openhab.core.karaf ] - ServiceEvent REGISTERED - {org.openhab.core.karaf.internal.FeatureInstaller, org.osgi.service.cm.ConfigurationListener}={misc=restdocs, component.name=org.openhab.addons, remote=true, service.config.category=system, service.config.description.uri=system:addons, felix.fileinstall.filename=file:/var/lib/openhab2/etc/org.openhab.addons.cfg, service.config.label=Add-on Management, service.pid=org.openhab.addons, binding=myq,wemo,zwave, ui=classic,basic,paper,habpanel,habmin, transformation=map,regex,xslt,exec,javascript,scale,xpath,jsonpath, component.id=134, package=expert, legacy=true, service.id=261, service.bundleid=167, service.scope=bundle} - org.openhab.core.karaf
2017-02-16 07:48:57.012 [DEBUG] [core.karaf.internal.FeatureInstaller] - Installed ‘openhab-binding-myq’

I cannot tell what’s happening. But I would suggest:

  1. collect all the logging from myq binding. You can do that by
    "log:set trace org.openhab.binding.myq.internal"
    These will give you all the logging about what’s myq binding is doing and what data is it.
  2. It seems like myq binding stops working. Otherwise, it should keep polling the server (trying to connect or getting status from it). You should see the exception if it fails to connect to the server.
  3. If myq binding works and connects to the server successfully, I suggest you double check the item configuration.
    If you set the log level to trace in step 1, you should see something like
    [TRACE] [openhab.binding.myq.internal.MyqData] - Received MyQ JSON:
    And if there is no error after that, I think it means the connection is successful.

It seems like the binding won’t be able to connect to the server at the moment because the protocol is changed. You can check it out here. Chamberlain MyQ Binding

Hi Mao,

Sorry for the slow response, I’ve been away and only got back to looking at this now. Thanks for the link to the other thread - I used Scooter/Scott’s update and the binding works properly now.

Did you get it working? (Your last post in the other thread indicated you were still having issues.)

Thanks again - much appreciated!

b-man

No. We should follow up on the other thread about this issue.