Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firmware 2.6.0 brings local API #37

Closed
mobilutz opened this issue Nov 23, 2020 · 25 comments
Closed

Firmware 2.6.0 brings local API #37

mobilutz opened this issue Nov 23, 2020 · 25 comments
Labels
enhancement New feature or request

Comments

@mobilutz
Copy link
Contributor

It seems, that with 2.6.0 the free@home SystemAccessPoints gets their own local API:
https://developer.eu.mybuildings.abb.com/fah_local/

Here the (german) changelog:
https://www.busch-jaeger.de/files/files_ONLINE/SysAP_ReleaseNotes_DE-EN_V11_2CKA000873B9732_BJE.pdf?download=1

Does that mean, that this API might not be needed anymore?

@henry-spanka
Copy link
Owner

Yeah seems like we can finally also implement virtual devices. Still it is easier to use this library than implementing everything on your own, so I am aiming to migrate this library to the new API. This way we also don't need to change anything in the homebridge plugin and just use this library as usual.

We should also keep the old API code in place for SysAps with versions < 2.6.0 for backwards compatibility.

@henry-spanka henry-spanka added the enhancement New feature or request label Nov 25, 2020
@henry-spanka
Copy link
Owner

@mobilutz Where did you find the firmware? I could only find the v2.5.0 firmware on the BJ website.

@foldericon
Copy link

SysAp v1

SysAp V2

@mobilutz
Copy link
Contributor Author

@mobilutz Where did you find the firmware? I could only find the v2.5.0 firmware on the BJ website.

I am not 100% sure, but through Google I found this forum:
https://www.freeathome-forum.de/community/neue-funktionen-updates/

@foldericon
Copy link

I just linked the product pages for each hardware revision where you can find the firmware download links.

@mobilutz
Copy link
Contributor Author

😦
It seems, that the free@home local API can only be used on SystemAccessPoint v2
https://developer.eu.mybuildings.abb.com/fah_local/prerequisites/

Screenshot 2020-11-28 at 12 50 50

@henry-spanka
Copy link
Owner

Hmm, a shame that the API is not available for the AP v1. I only have the v1 and I don't plan to upgrade as there isn't much of a benefit. Unfortunately that also means that I can not implement the new AP because I am unable to test it. Although I think the new API doesn't bring any benefits besides virtual devices.

@jannodeluxe
Copy link

@henry-spanka Could imagine local API could also follow for Sysap v1. Why not reaching out to ABB developer team asking for v2 sample?

@martin072
Copy link

martin072 commented Jan 1, 2021

Does an upgrade to 2.6.0 still work with your current library?

Update.... I've updated to 2.6.0, and unfortunately it broke :( Api is not starting

Jan 01 20:42:50 pihome systemd[1]: Started freeathome API Service.
Jan 01 20:42:54 pihome systemd[1]: freeathome-api.service: Main process exited, code=exited, status=1/FAILURE
Jan 01 20:42:54 pihome systemd[1]: freeathome-api.service: Failed with result 'exit-code'. 

@jclohmann
Copy link

There is a 2.6.0-Firmware for the Sysap v1 available on this page: https://www.busch-jaeger.de/produktuebersicht?tx_nlbjproducts_catalog%5Baction%5D=show&tx_nlbjproducts_catalog%5BcatBjeProdukt%5D=42726&tx_nlbjproducts_catalog%5Bcontroller%5D=CatStdArtikel&cHash=947308e3dfdc90b89eb854c601e0087a
The attached release notes mention the local API.

(I haven't tried to update my device using the image yet.)

@henry-spanka
Copy link
Owner

Does an upgrade to 2.6.0 still work with your current library?

Update.... I've updated to 2.6.0, and unfortunately it broke :( Api is not starting

Jan 01 20:42:50 pihome systemd[1]: Started freeathome API Service.
Jan 01 20:42:54 pihome systemd[1]: freeathome-api.service: Main process exited, code=exited, status=1/FAILURE
Jan 01 20:42:54 pihome systemd[1]: freeathome-api.service: Failed with result 'exit-code'. 

Sorry to hear that. Maybe they removed the old (unofficial) API. Please start the API in debug mode and post the log here.

@guckykv
Copy link

guckykv commented Jan 3, 2021

Hi! I'm running at 2.6.0 (.8089) (on Sysap v2) and the library works fine.

Jan 03 13:01:33 raspberrypi freeathome-api[20041]: 1/3/2021, 1:01:33 PM - INFO: Received SASL Challenge
Jan 03 13:01:33 raspberrypi freeathome-api[20041]: 1/3/2021, 1:01:33 PM - INFO: Sent SASL Challenge Response
Jan 03 13:01:33 raspberrypi freeathome-api[20041]: 1/3/2021, 1:01:33 PM - INFO: Received SASL Login Confirmation
Jan 03 13:01:33 raspberrypi freeathome-api[20041]: 1/3/2021, 1:01:33 PM - INFO: Successfully Authenticated
Jan 03 13:01:33 raspberrypi freeathome-api[20041]: 1/3/2021, 1:01:33 PM - INFO: Announced Capabilities to System Access Point
Jan 03 13:01:33 raspberrypi freeathome-api[20041]: 1/3/2021, 1:01:33 PM - INFO: Requested Master Data Structure from System Access Point
Jan 03 13:01:35 raspberrypi freeathome-api[20041]: 1/3/2021, 1:01:35 PM - INFO: Received Master Update from System Acccess Point
Jan 03 13:01:36 raspberrypi freeathome-api[20041]: 1/3/2021, 1:01:36 PM - INFO: Sent Subscription Request
Jan 03 13:01:36 raspberrypi freeathome-api[20041]: 1/3/2021, 1:01:36 PM - INFO: [192.168.X.X:58328]: Websocket connection established

I only got some

Jan 03 13:02:16 raspberrypi freeathome-api[20041]: 1/3/2021, 1:02:16 PM - INFO: [192.168.X.X:58334]: Command not understood
Jan 03 13:02:17 raspberrypi freeathome-api[20041]: 1/3/2021, 1:02:17 PM - INFO: [192.168.X.X:58334]: Command not understood

but I ignore them.

@martin072
Copy link

Did not have time to check it further, not at home for a while now. I did had a chance to look at the REST Api and Web Socket, and it seems to work really nice.

Here is some documentation about it:
https://developer.eu.mybuildings.abb.com/fah_local/samples/

@martin072
Copy link

martin072 commented Jan 21, 2021

Question, maybe not related to this repository, but I also had similar websocket issues a long time ago with this repository;

I am using the 2.6.0 sysap version with the REST api and web socket (as per BJ docu. example).
The REST Api (example's with cURL) works ok, albeit sometime very slow (takes around 15-30 seconds before a response is received and the action is completed when using the cURL method. Not sure why, its not always..

Main concern is the web socket, it seems to disconnect all the time, and not sure why. See Syslog below..

Jan 21 19:12:36 pihome systemd[1]: freeathome_ws.service: Main process exited, code=exited, status=1/FAILURE
Jan 21 19:12:36 pihome systemd[1]: freeathome_ws.service: Failed with result 'exit-code'.
Jan 21 19:12:46 pihome systemd[1]: freeathome_ws.service: Service RestartSec=10s expired, scheduling restart.
Jan 21 19:12:46 pihome systemd[1]: freeathome_ws.service: Scheduled restart job, restart counter is at 363.
Jan 21 19:12:46 pihome systemd[1]: Stopped Busch and Jaeger Free at home websocket Service.
Jan 21 19:12:46 pihome systemd[1]: Started Busch and Jaeger Free at home websocket Service.
Jan 21 19:15:27 pihome systemd[1]: freeathome_ws.service: Main process exited, code=exited, status=1/FAILURE
Jan 21 19:15:27 pihome systemd[1]: freeathome_ws.service: Failed with result 'exit-code'.
Jan 21 19:15:37 pihome systemd[1]: freeathome_ws.service: Service RestartSec=10s expired, scheduling restart.
Jan 21 19:15:37 pihome systemd[1]: freeathome_ws.service: Scheduled restart job, restart counter is at 364.
Jan 21 19:15:37 pihome systemd[1]: Stopped Busch and Jaeger Free at home websocket Service.
Jan 21 19:15:37 pihome systemd[1]: Started Busch and Jaeger Free at home websocket Service.
Jan 21 19:18:28 pihome systemd[1]: freeathome_ws.service: Main process exited, code=exited, status=1/FAILURE
Jan 21 19:18:28 pihome systemd[1]: freeathome_ws.service: Failed with result 'exit-code'.
Jan 21 19:18:38 pihome systemd[1]: freeathome_ws.service: Service RestartSec=10s expired, scheduling restart.
Jan 21 19:18:38 pihome systemd[1]: freeathome_ws.service: Scheduled restart job, restart counter is at 365.
Jan 21 19:18:38 pihome systemd[1]: Stopped Busch and Jaeger Free at home websocket Service.
Jan 21 19:18:38 pihome systemd[1]: Started Busch and Jaeger Free at home websocket Service.
Jan 21 19:21:32 pihome systemd[1]: freeathome_ws.service: Main process exited, code=exited, status=1/FAILURE
Jan 21 19:21:32 pihome systemd[1]: freeathome_ws.service: Failed with result 'exit-code'.
Jan 21 19:21:42 pihome systemd[1]: freeathome_ws.service: Service RestartSec=10s expired, scheduling restart.
Jan 21 19:21:42 pihome systemd[1]: freeathome_ws.service: Scheduled restart job, restart counter is at 366.
Jan 21 19:21:42 pihome systemd[1]: Stopped Busch and Jaeger Free at home websocket Service.
Jan 21 19:21:42 pihome systemd[1]: Started Busch and Jaeger Free at home websocket Service.
Jan 21 19:24:19 pihome systemd[1]: freeathome_ws.service: Main process exited, code=exited, status=1/FAILURE

It's a python script as per example that ABB provides. When running it from the command line, it exits at an unexpected (no reason) disconnect..

Any idea's anyone?

@martin072
Copy link

Latest update to 2.6.1 seems to solve the above issues, and the websocket is very stable.

On another machine I am also running Homebridge with the free@home plugin, however, that seems to be a lot more unstable, and in order to get communications back again I need to either login in free@home, or restart the homebridge.

[2/13/2021, 1:04:38 PM] [free@home] SysAp did not respond in time: 0007/odp0000/1
[2/13/2021, 1:04:38 PM] [free@home] If this issue persists please try to login as the API user in the free@home UI. The SysAp might disable websocket notifications if the connection is idle for too long.
[2/13/2021, 1:04:38 PM] [free@home] See: https://github.com/henry-spanka/homebridge-freeathome#tips--tricks

@henry-spanka
Would it be possible to implement at least a choice of how to connect the websocket? in the API you can now authenticate a user , and therefore it will not require the tips/tricks as re-login again.

If you like, i can try to assist you as I have version 2.6.1 and possible a spare raspberry to fiddle around with..

@henry-spanka
Copy link
Owner

Is this still relevant?

@morningstar83
Copy link

Hmm, a shame that the API is not available for the AP v1. I only have the v1 and I don't plan to upgrade as there isn't much of a benefit. Unfortunately that also means that I can not implement the new AP because I am unable to test it. Although I think the new API doesn't bring any benefits besides virtual devices.

Hi Henry. I also have Sys App v1 and don't want to upgrade to v2 since I just finished my house 4 years ago 😜 Do you have a solution for Sys App v1? I have you free@home bridge running and are able to control actuators once. What is missing is the status update. I need to reconnect to home bridge in order to have the correct status. Can this be solved with additionally installing your API? Thanks in advance. Best Regards, STeF

@henry-spanka
Copy link
Owner

henry-spanka commented Oct 3, 2022

Hi @morningstar83. What firmware do you use?

I am running it very stable. There is some issue I couldn't find a solution for but a workaround. The SysAp does not send any updates sometimes which is what you are experiencing.

Log in with the API user into the SysAp and just control a accessory (e.g. turn light on and off). Then logout and restart the API. The connection should then be stable until you restart the SysAp.

@morningstar83
Copy link

Hi @morningstar83. What firmware do you use?

I am running it very stable. There is some issue I couldn't find a solution for but a workaround. The SysAp does not send any updates sometimes which is what you are experiencing.

Log in with the API user into the SysAp and just control a accessory (e.g. turn light on and off). Then logout and restart the API. The connection should then be stable until you restart the SysAp.

Hi @henry-spanka yesterday I updated to latest version V3.1.0. With log in into SysAp you mean "Home Owner" or "Configuration"? I guess "Home Owner" since you suggested to simply switch an actuator. I don't have different (API) users, just one Admin. And what do you mean with restart the API after logout? You mean home bridge plugin?

@henry-spanka
Copy link
Owner

Hi,
yeah, version 3.X has some breaking changes. I already have it running locally but did not fix it in upstream yet to preserve backwards compatibility.

I will get on it this week post here once a new version has been released.

@henry-spanka
Copy link
Owner

please update the npm package. I have released a new version.

@morningstar83
Copy link

Hi, yeah, version 3.X has some breaking changes. I already have it running locally but did not fix it in upstream yet to preserve backwards compatibility.

I will get on it this week post here once a new version has been released.

Hi. How are you coming along with the release for v3.x? ;)

@henry-spanka
Copy link
Owner

Hi. It is already released. Please update the freeathome-api package to v1.1.2.

@morningstar83
Copy link

morningstar83 commented Oct 13, 2022

Got it working. Thanks a a lot :)

@mobilutz
Copy link
Contributor Author

Is this still relevant?

I will close this issue, as I don't see any need to act upon the local API.
I just updated my SystemAccessPointv1 to 2.6.4 yesterday, and this package still works as expected.

I think I will try >=v3 in a couple of weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants