tommasomarchionni / homebridge-openHAB

Homebridge plugin for openHAB
Apache License 2.0
49 stars 18 forks source link

item not a widget #4

Closed walmer-bolfet closed 8 years ago

walmer-bolfet commented 8 years ago

I have only one OpenHab item in my json config file (though many more in openhab). This item is a relay switch connected to a raspberry pi that works well in OpenHab (it uses a rules to execute bash commands to turn on and off the relay). When I run Homebridge, Homebridge seems to fetch the OpenHab devices and connects to the sitemap without error, but when it loads accessories, this error appears 8 times:

   [openHAB] Platform - The widget ' ' is not an item.

Homebridge then reports it is running, and I can use the MiLight Platform and accessories, but there is nothing there for Openhab. I am not sure how to address this. Any help would be appriciated.

BTW - I will eventually try to connect to my Zigbee and Z-wave devices that are controlled by a rooted Wink Hub via Bash commands executed with OpenHab rules. Most of these items are Number items with Rules controlling Bash commands telling the Wink Hub what to do. If there is more I need to know to continue with this approach, that would also be appriciated.

jdwhite commented 8 years ago

I also got this error with the widget name of space, and also got errors for every Frame and Group name in my sitemap. The homebridge-openHAB parser seems to have difficulty with items that are defined inside Frame {} or Group {} blocks, which for me is everything. Homebridge wasn't seeing any of my 30+ items. My solution was pull out all the items from my default sitemap and make a homebridge.sitemap file that just contained the items without any framing or grouping.

walmer-bolfet commented 8 years ago

Thanks,

That approach would seem to render the OpenHab interface useless. Am I wrong on that, or is it possible to use 2 sitemaps with openhab? I still have very much on OpenHab that will never be used with Homebridge.

BTW - I think I found a work-around by using the Homebridge-AppleScript add-on to execute my bash scripts instead of trying to get them executed through OpenHab.

jdwhite commented 8 years ago

Useless? Not at all. OpenHAB supports multiple sitemaps, the default being default.sitemap. You might use multiple sitemaps for different buildings (sites), or have a sitemap for testing. Or, in my case, a sitemap that I tell Homebridge to use. See the OpenHAB docs on how to specify alternate sitemaps. The only (minor) annoyance is having to touch two files (one for OpenHAB web/app interface, one for Homebridge) when I add items to OpenHAB, but that's minor price to pay for having HomeKit integration.

snizzleorg commented 8 years ago

Indeed homekitbridge only supports a flat sitemap. so an additional sitemap has to be created. Which makes perfect sense given that openhab can do a lot more than homekitbridge (at least at the moment)

tommasomarchionni commented 8 years ago

Now from this version (0.1.21) the plugin supports every type of sitemap. I have added a new option "skipItem" in customAttr to avoid load item in Homekit catalog, let me know if it works.

mblong commented 8 years ago

Initially none of the items from my default openHAB sitemap were recognized. With this update, basically all were added to the iOS apps, even though I had not entered their characteristics in config.json.

tommasomarchionni commented 8 years ago

Yes! All the items of the selected sitemap are loaded by default. If you want to skip an item You should add the item's name and the relative skipItem attribute to true in customAttr section.