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

Connection with OpenHabian3 #115

Open rolob73 opened 1 year ago

rolob73 commented 1 year ago

Hi

I'm trying to integrate OpenHabian3 into Homebridge. But Homebridge will not start up while the plugin is activated, because it's waiting for open hab host to come online: [21/08/2022, 20:53:52] [openHAB2-Complete] Waiting for openHAB host (http://192.168.174.26) to come online...

My configuration in Homebridge:

        {
            "platform": "openHAB2-Complete",
            "host": "http://192.168.174.26",
            "port": "8080",
            "username": "admin",
            "password": "...",
            "accessories": [
                {
                    "name": "An items name, as shown in Homekit later",
                    "type": "switch",
                    "item": "Itemname-within-OpenHAB"
                }
            ]
        }

Version of OpenHabian3: 3.3.0 Version of Homebridge: 1.5.0 Version of Node.js in Homebridge: 16.17.0

Do you have any idea?

steilerDev commented 1 year ago

Have you verified, that the host (192.168.174.26) is reachable from your homebridge host?

Try to ping the host first, if that is successful, check if you can reach the API (curl http://192.168.174.26:8080/rest/items).

rolob73 commented 1 year ago

Hi Frank

Yes, I can ping my host and I can reach the API. If I’m using your link, I’m getting a list of all my items in OpenHabian 3. But I’m not sure about Username/Password: Do I have to use the password of the GUI or the password I’m using to reach OpenHabian3 by SSL? I’ve tried both with no success.

Best regards Roland

-- Sent from Canary (https://canarymail.io)

On Montag, Aug. 22, 2022 at 9:39 AM, Frank Steiler @. @.)> wrote:

Have you verified, that the host (192.168.174.26) is reachable from your homebridge host?

Try to ping the host first, if that is successful, check if you can reach the API (curl http://192.168.174.26:8080/rest/items).

— Reply to this email directly, view it on GitHub (https://github.com/steilerDev/homebridge-openhab2-complete/issues/115#issuecomment-1221970825), or unsubscribe (https://github.com/notifications/unsubscribe-auth/A2UHXHH2YBSPUW3VWE6UEVTV2MVDDANCNFSM57FNE7CA). You are receiving this because you authored the thread.Message ID: @.***>

steilerDev commented 1 year ago

Did you use any authentication credentials in your curl command? If not, I would try without authentication.

In general the tool is asking for your API credentials (https://www.openhab.org/docs/configuration/restdocs.html#authentication). In my OpenHAB installation, I disabled API credentials. I think this is done through 'Settings' -> 'API Security' -> 'Implicit User Roles', but I am not 100% sure on the latter.

rolob73 commented 1 year ago

New information: It seems to work now. It’s not syncing anything, because there is the message „unable to add accessory Spiegelschrank Bad: Error: Not configuring binary actor characteristic for Spiegelschrank Bad: Item type was not synced initially and is therefore not available, skipping“ in the log, but this seems to be a problem within OpenHabian3.

What I did to get it work: I removed all special characters from my password, I reactivated the „implicit user roles“ and I also activated in the advanced settings the option „basic authentificataion enable“. With this, homebridge can connect to OpenHabian3.

Thanks for your support.

Cheers.

-- Sent from Canary (https://canarymail.io)

On Mittwoch, Aug. 24, 2022 at 9:26 AM, Roland Obrist @. @.)> wrote: I switched off the Implicit User Roles in OpenHabian3, I tried to delete user/password from the hombridge configuration, I also changed the password and tried this one, everything with no success. I’ve also tried to add the port directly to the URL (192.168.174.26:8080) in the configuration, but this didn’t work also.

It’s still hanging on waiting for OpenHabian to come online.

When I’m trying the command "curl get 192.168.174.26:8080/rest/items“ on the terminal of homebridge, I’m getting this error message: {"error":{"message":"Authentication required","http-code":401}}

Maybe, this could help you?

-- Sent from Canary (https://canarymail.io)

On Mittwoch, Aug. 24, 2022 at 9:05 AM, Frank Steiler @. @.)> wrote:

Did you use any authentication credentials in your curl command? If no I would try without authentication.

In general the tool is asking for your API credentials (https://www.openhab.org/docs/configuration/restdocs.html#authentication). In my OpenHAB installation, I disabled API credentials. I think this is done through 'Settings' -> 'API Security' -> 'Implicit User Roles', but I am not 100% sure on the latter.

— Reply to this email directly, view it on GitHub (https://github.com/steilerDev/homebridge-openhab2-complete/issues/115#issuecomment-1225286966), or unsubscribe (https://github.com/notifications/unsubscribe-auth/A2UHXHDCRFQUD2JKEBZEQETV2XCUVANCNFSM57FNE7CA). You are receiving this because you authored the thread.Message ID: @.***>

rolob73 commented 1 year ago

I switched off the Implicit User Roles in OpenHabian3, I tried to delete user/password from the hombridge configuration, I also changed the password and tried this one, everything with no success. I’ve also tried to add the port directly to the URL (192.168.174.26:8080) in the configuration, but this didn’t work also.

It’s still hanging on waiting for OpenHabian to come online.

When I’m trying the command "curl get 192.168.174.26:8080/rest/items“ on the terminal of homebridge, I’m getting this error message: {"error":{"message":"Authentication required","http-code":401}}

Maybe, this could help you?

-- Sent from Canary (https://canarymail.io)

On Mittwoch, Aug. 24, 2022 at 9:05 AM, Frank Steiler @. @.)> wrote:

Did you use any authentication credentials in your curl command? If no I would try without authentication.

In general the tool is asking for your API credentials (https://www.openhab.org/docs/configuration/restdocs.html#authentication). In my OpenHAB installation, I disabled API credentials. I think this is done through 'Settings' -> 'API Security' -> 'Implicit User Roles', but I am not 100% sure on the latter.

— Reply to this email directly, view it on GitHub (https://github.com/steilerDev/homebridge-openhab2-complete/issues/115#issuecomment-1225286966), or unsubscribe (https://github.com/notifications/unsubscribe-auth/A2UHXHDCRFQUD2JKEBZEQETV2XCUVANCNFSM57FNE7CA). You are receiving this because you authored the thread.Message ID: @.***>

steilerDev commented 1 year ago

I'm getting conflicting messaging 😂 Is it currently working or not?

Unfortunately I currently can't verify this due to two reasons: I'm running plain openHAB (so not sure if openhabian is adding any logic) without any authentication locally....