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

Home control unit #542

Open
iobrokerneu opened this issue Sep 22, 2024 · 26 comments
Open

Home control unit #542

iobrokerneu opened this issue Sep 22, 2024 · 26 comments

Comments

@iobrokerneu
Copy link

Hello,
is there a possibility to add the new Homematic IP central unit as well? This is about the Home Control Unit.

Best regards,
Sascha.

@hahn-th
Copy link
Owner

hahn-th commented Nov 16, 2024

I am not able to make any tests or reverse engineering because I don't own the device. I have no idea how and whether the connection works at all.

If somebody could do some research and tell me what to do, I could implement it.

@dietzm
Copy link
Contributor

dietzm commented Nov 30, 2024

I tried hmip_generate_auth_token.py with my HCU and it does not work.

  1. connectionRequest REST request seems to work
    Response Code: 200 Date: Sat, 30 Nov 2024 19:34:11 GMT Content-Length: 0 Connection: keep-alive Server: TRA Tra-Request: d71fc58e746e9232f7ad3b3c620779ee Tra-Gateway: rewz Tra-Location: DE Tra-Version: 1.0

  2. requestAuthToken does always return INVALID REQUEST, even after pressing the button on the HCU

  3. The button on the HCU seems to have a different behavior: when you press the button the App shows the message "Remote access enabled for 5 minutes, to create new users"

Any tips what I can test or how I can capture/decrypt the communication ?

@Apollon77
Copy link

I can propose Charles proxy:

  • install charles proxy
  • prepare SSL decryption https://www.charlesproxy.com/documentation/using-charles/ssl-certificates/ (works best on iOs, Andrroid s a it difficult)
  • setup as proxy for the Wifi connection
  • verify that it works by e.g. getting a webpage and if you see GET/POST requests in proxy then all good ... if you only see "CONNECT" then ssl do not work and needs to get fixed
  • start the Homematic app and do a "pairing" ... look at whats there and if you like provide the charles file (saved session)

I would also be interested in seeing it :-)

@hahn-th
Copy link
Owner

hahn-th commented Dec 7, 2024

I have created a PR in HomeAssistant (home-assistant/core#132537) to bump homematicip to latest version. I think you should be able to use the HCU after that in HomeAssistant.

#543

@dietzm
Copy link
Contributor

dietzm commented Dec 7, 2024

@hahn-th the PR fixes the token generation only to make hmip_generate_auth_token.py work !
There are some more updates needed for the hm_cli.py to work (I'm just about to add those)
I also missed to remove sys.path settings from hmip_generate_auth_token.py which I used for debugging on my system.

@hahn-th
Copy link
Owner

hahn-th commented Dec 7, 2024

Okay. Tell me when you're ready.
Are the lots of changes necessary?

@hahn-th hahn-th reopened this Dec 7, 2024
@dietzm
Copy link
Contributor

dietzm commented Dec 7, 2024

I just created the new PR. I added the accesspoint-id to all headers and created a new device type ACCESS_POINT.
My tests using hm_cli and pytest worked fine.
Please note that I can not test with the old HAP accesspoint anymore. I hope that the additional header does not impact it.

@dietzm
Copy link
Contributor

dietzm commented Dec 7, 2024

hm, some aio tests seem to fail.

@dietzm
Copy link
Contributor

dietzm commented Dec 7, 2024

ok, all done

@bonsaijogi
Copy link

if someone could briefly explain how to install the new version in HA, that would be really great :)

@hahn-th
Copy link
Owner

hahn-th commented Dec 15, 2024

HI all, you can try this branch https://github.com/hahn-th/core/tree/issue_121841 to test connection to new HCU.
See here: https://developers.home-assistant.io/docs/development_environment for infos on how to do that.

Thanks!

@bonsaijogi
Copy link

So this new version is only for developers, if I understand correctly, not for us normal users, right?

@hahn-th
Copy link
Owner

hahn-th commented Dec 15, 2024

If you tell me it is working, because you have testet it, it gets available for all users. I need someone to try it out from the HCU perspective

@bonsaijogi
Copy link

Unfortunately I can't tell you that because I have no idea. I thought version 1.1.5 could be integrated into the existing installation, but apparently it's more complicated than that ;)

@hahn-th
Copy link
Owner

hahn-th commented Dec 15, 2024

At the end it is like that. I would like to add to the documentation of HASS, that the HCU is supported. But I can't tell you, if it is true.
I hope somebody is testing the branch from above and tells me, that everything is working.

@iobrokerneu
Copy link
Author

I would like to test it, but I’m just a regular user and don’t have a developer account. However, I must admit that I don’t understand how to install the regular version in Home Assistant.

@iobrokerneu
Copy link
Author

@hahn-th
Hello everyone,
Are there any new updates on this? How can the entity be installed, and does it work with the HCU?

Best regards,
Sascha

@WaldoPepper
Copy link

I have bought a HCU (firmware version 1.2.6) recently and can participate in testing. I have a Home Assistant running, too. I use my Homematic IP AP for several years now with the REST API in combination with Node-RED and it (almost ;-) never failed me....

@hahn-th
Copy link
Owner

hahn-th commented Jan 15, 2025

Hi @WaldoPepper, when this PR home-assistant/core#133269 is merged it should work.

@WaldoPepper
Copy link

I started with an attempt to generate the access token, unfortunately to no avail:

image

At this point I have a plain box, LAN-only (no Wifi), online mode without remote access, admin account only, no PIN.

Is there a certain way I have to interact with the hardware during token generation? I remember that with the AP there was some "button-pressing" involved...

@iobrokerneu
Copy link
Author

Hi, could you try pressing the button directly on the HCU and then establishing the connection?

There is a button on top of the HCU that can be pressed for this purpose.

@WaldoPepper
Copy link

Progress: found out, that the remote access ("Fernzugriff") has to be activated:

image

After doing this, I was able to generate the token (call for button pressing came as expected :-)

image

Listing the devices I have connected succeeded:

image

After doing this, I deactivated the remote access and another attempt to list the devices failed:

image

This leaves me behind with some mixed feelings about the HCU: I was hoping for a truly local solution, including API access, but it seems the access is still using the eQ-3 homematic servers.

But otherwise I highly regard your efforts for creating this adoption, I appreciate it very much...

@iobrokerneu
Copy link
Author

That’s definitely good news. I’d love to test it as well, but I’m already stuck because I don’t know how to install the “homematicip-rest-api.

@WaldoPepper
Copy link

First, you need a running Python environment (on Windows I would recommend Anaconda). If you have this installed, "git clone" the repository or, if you are unfamiliar with git, just download the zip file:

image

Unpack the zip.

Open an "Anaconda Prompt" from the Windows StartMenu and enter the folder <folder_you_unpacked_it_to>\homematicip-rest-api\src\homematicip\cli.

It is good practice to create an "environment" to collect all the prerequisites you need for using the API, so call e.g. conda create -n hm_api python=3. This creates the environment and populates it (among others) with he latest python interpreter. Conda instructs you after creation, how to activate the environment (something along the lines of conda activate ....

You need the API python wrapper, so in your now activated environment do pip install homematicip. After this finishes, do a pip list and see if version 1.1.6 of the homematicip wrapper is installed.

You are now ready to proceed as shown in the screenshots above.

@iobrokerneu
Copy link
Author

Thank you for the explanation.

Unfortunately, I find it a bit too complicated. I can imagine that many more people would test or use it if it could be easily installed via HACS.

Is there a reason why it doesn’t work through HACS in Home Assistant?

@hahn-th
Copy link
Owner

hahn-th commented Jan 15, 2025

There is another PR for bumping homematicip to 1.1.6 (home-assistant/core#135649) which gets merged this morning. With next version of HomeAssistant it should work.
It is risky to update the dependency without running any testcases, because there could possibly other changes which breaks your environment. So just wait a view days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants