steilerDev / homebridge-openhab2-complete

A homebridge plugin for openHAB, that has the expectation to fully support all Services offered by Apple's Homekit Accessory Protocol (HAP)
GNU General Public License v3.0
52 stars 16 forks source link

Plug-in not working in Homebridge #1

Closed rbeniers closed 5 years ago

rbeniers commented 5 years ago

After installation of the plug-in and adding the necessary changes to the config file, Homebridge will not start anymore.

O get the following message in the log file: [openHAB2] SSE - Error fetching updates: TypeError: Cannot read property 'name' of undefined at Sse.manageValue (/homebridge/node_modules/homebridge-openhab2/src/services/sse.ts:72:64) at EventSource.es.addEventListener (/homebridge/node_modules/homebridge-openhab2/src/services/sse.ts:57:14) at EventSource.emit (events.js:182:13) at _emit (/homebridge/node_modules/eventsource/lib/eventsource.js:242:17) at parseEventStreamLine (/homebridge/node_modules/eventsource/lib/eventsource.js:257:9) at IncomingMessage. (/homebridge/node_modules/eventsource/lib/eventsource.js:217:11) at IncomingMessage.emit (events.js:182:13) at addChunk (_stream_readable.js:283:12) at readableAddChunk (_stream_readable.js:264:11) at IncomingMessage.Readable.push (_stream_readable.js:219:10) at HTTPParser.parserOnBody (_http_common.js:122:22) at Socket.socketOnData (_http_client.js:442:20) at Socket.emit (events.js:182:13) at addChunk (_stream_readable.js:283:12) at readableAddChunk (_stream_readable.js:264:11) at Socket.Readable.push (_stream_readable.js:219:10)

Can somebody help me to fix this?

steilerDev commented 5 years ago

Hi @rbeniers ,

I am pretty sure you are using the other available openHAB2 plugin. Try asking for help there, or try this plugin ;)

Regards,

Frank

P.S.: Always post your configuration files together with a problem, that helps us help you

steilerDev commented 5 years ago

If not you have either installed or specified the wrong plugin in your config.

rbeniers commented 5 years ago

You were right, sorry. I had to remove the other one.

Now I have your plug-in working, but it will not show an accessory. The log-file says: [openHAB2-Complete] Initializing openHAB2-Complete platform... [1/24/2019, 8:53:05 PM] [openHAB2-Complete] OpenHAB2 REST Plugin Loaded - Version 0.2.0 [1/24/2019, 8:53:05 PM] [openHAB2-Complete] Unable to add accessory Reserve wallplug: Error: Item does not exist!, skipping

I copied this name of the accessory from openHAB and pasted in the config file. Do I have to use another name from OpenHAB?

steilerDev commented 5 years ago

Could you please post your config.json from Homebridge and your .items file from openHAB where the item is configured?

rbeniers commented 5 years ago

The config.json from Homebridge:

{ "bridge": { "name": "Homebridge", "username": "0E:4B:BC:64:6E:B7", "port": 51826, "pin": "349-90-213" }, "description": "This is an example configuration file. You can use this as a template for creating your own configuration file containing devices you actually own.", "accessories": [], "platforms": [ { "platform": "openHAB2-Complete", "host": "http://10.0.1.10", "port": "7070", "accessories": [ { "name": "Fibaro wallplug", "type": "switch", "item": "Reserve wallplug" } ] } ] }

I cannot find the .items from openHAB on my Synology NAS. I even had the file explorer to find it and it also could not find it. Do you know how I can find/reach this file on my Synology NAS?

steilerDev commented 5 years ago

Where did you define the Item? Within PaperUI? Because within the text configuration there are no spaces allowed within the item name.

One of my items e.g. is defined like this

Switch AZ_A_Kaffeemaschine "Arbeitszimmer Kaffeemaschine" {channel="homematic:HmIP-FSM16:OEQ0610217:000B9709B24AE9:2#STATE"}

The equivalent configuration for this plugin would then be

"platforms": [
  {
    "platform": "openHAB2-Complete",
    "host": "http://10.0.1.10",
    "port": "7070",
    "accessories": [
      {
        "name": "Wallplug",
        "type": "switch",
        "item": "AZ_A_Kaffeemaschine"
      }
    ]
  }
]

The error in your log tells me that the plugin cannot find an item with the name Reserve wallplug.

For file locations on your Synology see the official openHAB documentation

rbeniers commented 5 years ago

Hi,

Yes I defined he item in Paper UI. I will change the name with a new without spaces. Hopefully this will work.

On my NAS there is directory /volume1/public/openHAB2/conf/ but this one is empty. So there is no .items file.

Regards,

Roger

Van: Frank Steiler notifications@github.com Verzonden: zaterdag 26 januari 2019 14:32 Aan: steilerDev/homebridge-openhab2-complete homebridge-openhab2-complete@noreply.github.com CC: rbeniers r.beniers@home.nl; Mention mention@noreply.github.com Onderwerp: Re: [steilerDev/homebridge-openhab2-complete] Plug-in not working in Homebridge (#1)

Where did you define the Item? Within PaperUI? Because within the text configuration there are no spaces allowed within the item name.

One of my items e.g. is defined like this

Switch AZ_A_Kaffeemaschine "Arbeitszimmer Kaffeemaschine" {channel="homematic:HmIP-FSM16:OEQ0610217:000B9709B24AE9:2#STATE"}

The equivalent configuration for this plugin would then be

"platforms": [ { "platform": "openHAB2-Complete", "host": "http://10.0.1.10", "port": "7070", "accessories": [ { "name": "Wallplug", "type": "switch", "item": "AZ_A_Kaffeemaschine" } ] } ]

The error in your log tells me that the plugin cannot find an item with the name Reserve wallplug.

For file locations on your Synology see the official openHAB documentation https://www.openhab.org/docs/installation/synology.html#configuration

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/steilerDev/homebridge-openhab2-complete/issues/1#issuecomment-457831317 , or mute the thread https://github.com/notifications/unsubscribe-auth/AshB1r59GSmGPEMBGtU7cQZc0zZGNYc-ks5vHFi4gaJpZM4aRrER . https://github.com/notifications/beacon/AshB1nRBkHql2QWJHMoaPqPVbeM40wd3ks5vHFi4gaJpZM4aRrER.gif

steilerDev commented 5 years ago

Let me know if that worked, if not I will set up a test instance of openHAB in order to try to reproduce your steps.

rbeniers commented 5 years ago

HI Frank,

That solved the problem (Reserve_Wallplug), thanks!

Regards,

Roger

Van: Frank Steiler notifications@github.com Verzonden: zaterdag 26 januari 2019 17:37 Aan: steilerDev/homebridge-openhab2-complete homebridge-openhab2-complete@noreply.github.com CC: rbeniers r.beniers@home.nl; Mention mention@noreply.github.com Onderwerp: Re: [steilerDev/homebridge-openhab2-complete] Plug-in not working in Homebridge (#1)

Let me know if that worked, if not I will set up a test instance of openHAB in order to try to reproduce your steps.

— You are receiving this because you were mentioned. Reply to this email directly, https://github.com/steilerDev/homebridge-openhab2-complete/issues/1#issuecomment-457845176 view it on GitHub, or https://github.com/notifications/unsubscribe-auth/AshB1rK5RJG-iSrksqf2JLkst6H4jdSKks5vHIQrgaJpZM4aRrER mute the thread. https://github.com/notifications/beacon/AshB1qzsKi4sM5JZ6DsVVI5zw38_zH8Mks5vHIQrgaJpZM4aRrER.gif

steilerDev commented 5 years ago

Perfect! If there is anything else, just open a new issue and look out for new releases this week, there is a lot of stuff I am currently putting into this project ;)