pgerke / homebridge-freeathome-local-api

A Homebridge plugin that allows controlling you free@home setup using the local API provided by the System Access Point
MIT License
18 stars 2 forks source link

Authentication failure #6

Closed rubenstolk closed 2 years ago

rubenstolk commented 2 years ago

Describe The Bug: I tried to setup this plugin but it fails to authenticate with my bridge, throwing an error

To Reproduce: I simply installed the plugin, configured it with host, user and password and set tls to false.

Expected behavior: I've been using https://www.npmjs.com/package/homebridge-freeathome-local for some time with the same details and that one does not have authentication issues. (It has other issues, hence I'm hoping that this new plugin will make my life easier!)

Logs:

[6/16/2022, 10:08:26 PM] [free@home / local] Authentication information is missing or invalid.
[6/16/2022, 10:08:26 PM] [free@home / local] Device discovery failed Error: Authentication information is missing or invalid.
    at r.SystemAccessPoint.<anonymous> (/usr/lib/node_modules/homebridge-freeathome-local-api/node_modules/freeathome-local-api-client/dist/cjs/webpack:/freeathome-local-api-client/src/system-access-point.ts:363:15)
    at Generator.next (<anonymous>)
    at /usr/lib/node_modules/homebridge-freeathome-local-api/node_modules/freeathome-local-api-client/dist/cjs/index.js:1:155821
    at new Promise (<anonymous>)
    at n (/usr/lib/node_modules/homebridge-freeathome-local-api/node_modules/freeathome-local-api-client/dist/cjs/index.js:1:155566)
    at r.SystemAccessPoint.processRestResponse (/usr/lib/node_modules/homebridge-freeathome-local-api/node_modules/freeathome-local-api-client/dist/cjs/index.js:1:159405)
    at r.SystemAccessPoint.<anonymous> (/usr/lib/node_modules/homebridge-freeathome-local-api/node_modules/freeathome-local-api-client/dist/cjs/webpack:/freeathome-local-api-client/src/system-access-point.ts:173:17)
    at Generator.next (<anonymous>)
    at u (/usr/lib/node_modules/homebridge-freeathome-local-api/node_modules/freeathome-local-api-client/dist/cjs/index.js:1:155623)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[6/16/2022, 10:08:26 PM] [free@home / local] Unexpected response received
pgerke commented 2 years ago

Hi and thanks for bringing this to my attention!

Could it be that you are using the name of your user account instead of the user ID? The first you are using to authenticate to the web UI of the System Access Point and it is also used by the plugin you mentioned and it's predecessor, but it cannot be used with the local API. You need the user ID for that. The user ID is a guid that you can obtain from the free@home next app or from the System Access Point Swagger endpoint at http://{SysAP IP or Host}/swagger/users (it's the string beneath the user account name).

rubenstolk commented 2 years ago

Alright, tried it out, and it does work now! I'm facing one other issue but maybe we can create a separate issue:

Whenever I change the brightness of one of my dimmer lights, it says in the logs that it's changing the brightness to that value but immediately after it also changes it to 100%, hence my lights almost always go to full brightness...

pgerke commented 2 years ago

Happy to hear your issue is resolved.

The other issue sounds strange, doesn't happen on my setup. But let's discuss this in another issue.

Mischmasch44 commented 2 years ago

The user ID is a guid that you can obtain from the free@home next app or from the System Access Point Swagger endpoint at http://{SysAP IP or Host}/swagger/users (it's the string beneath the user account name).

Hi, I couldn't find the user ID anywhere in the free@home next app. The link http://{SysAP IP or Host}/swagger/users just outputs an error. Do I need to be the installer of the free@home system for that?

pgerke commented 2 years ago

free@home next App

You can find the local API options in the burger menu -> free@home Settings -> Locale API image

Swagger Endpoint

Works for me. Can you be a little more specific as to what error you are encountering? You don't need to be authenticated to use the endpoint. image

Mischmasch44 commented 1 year ago

Hi sorry for the late response,

You can find the local API options in the burger menu -> free@home Settings -> Locale API

Unfortunalty, I can't find the described submenu "Lokale API", as seen here: IMG_2431

Works for me. Can you be a little more specific as to what error you are encountering? You don't need to be authenticated to use the endpoint.

Or when I try reaching the endpoint, I only get an error message:

image

Maybe I'm overlooking something simple. Thanks for your help.

Mischmasch44 commented 1 year ago

So apparently I have the old Sys AP (6200 AP-101), which doesn't support the local API feature (german). Is there any other way to solve this problem? If not, I will probably have to return to Henry Spanka's version.

pgerke commented 1 year ago

I'm really sorry, but there is no workaround that I am aware of. Local API is only supported on SysAP 2.0 running firmware version 2.6.0 or newer. I know that is a major pain point among the SysAP version 1 owners who feel that they are being "punished" as the early adopters. I'm keeping my fingers crossed that Busch + Jäger comes around and if they do, I'll do my best to support SysAP v1 as well.

Mischmasch44 commented 1 year ago

Thanks for your effort :)

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.