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

multiple errors on login / trying to connect to TI9555X9 coffee maker #46

Open
Morg42 opened this issue Mar 11, 2024 · 2 comments
Open

Comments

@Morg42
Copy link

Morg42 commented Mar 11, 2024

Hi,

I've been running the singlekey branch for a while now without problems, owning a dishwasher which I can access over hcpy.

System is Devuan daedalus, Python 3.11.2

Now I added a coffee maker (S500 connect, TI9555X9DE/21) and hc-login goes awry...

First error is "missing scheme" on the fourth preauth URL, which I fixed by prepending singlekey_host. (inserting 2 lines before line 123.

Next error is "failed to fetch <Response [307]>", which I fixed by adding code 307 to line 127.

Next error is a relative url for the first return_url, which I again fixed by prepending singlekey_host (again inserting 2 lines before line 136.

The next error is (subtract 4 from linenumbers for inserted code lines):

return_url='https://singlekey-id.com/auth/connect/authorize/callback?client_id=[...]&redirect_uri=https%3A%2F%2Fapi.home-connect.com%2Fsecurity%2Foauth%2Fredirect_target&response_type=code&scope=openid%20email%20profile%20offline_access%20homeconnect.general&prompt=login&style_id=bsh_
hc_01&state=%7B%22session_id%22%3A%22[...]%22%7D&suppressed_prompt=login'
Traceback (most recent call last):
  File "/home/sh/src/hcpy/./hc-login", line 142, in <module>
    headers["RequestVerificationToken"] = r.cookies["X-CSRF-FORM-TOKEN"]
                                          ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/home/sh/.venvs/3.11/lib/python3.11/site-packages/requests/cookies.py", line 334, in __getitem__
    return self._find_no_duplicates(name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sh/.venvs/3.11/lib/python3.11/site-packages/requests/cookies.py", line 413, in _find_no_duplicates
    raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}")
KeyError: "name='X-CSRF-FORM-TOKEN', domain=None, path=None"

I'm guessing it's missing the X-CSRF-FORM-TOKEN cookie from the response. Response cookies include .AspNetCore.Antiforgery. and __Host-F8Mmt.
Why? What can I do? What might I have done wrong?

Anyone able to help? As far as I could see, @CRTified has a similar machine already working...?

@pmagyar
Copy link

pmagyar commented Apr 16, 2024

Hey @Morg42,
please take a look at https://github.com/hcpy2-0/hcpy.
We have forked this repo and continue to develop the software.

If you have any issues, your are welcome to create an issue in our repo.

@CRTified
Copy link

Hi, sorry for the lack of a response. I used to have this working with a coffee machine, but at that point the code was a mere PoC and not something that could be used productively. Since then, I didn't have time to dig into it any deeper, so I can't provide any recent insights.

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

No branches or pull requests

3 participants