Miele@home, miele@mobile component

Hi Hendrik,

Had the same problem. base_url is apparently deprecated. I replaced line 111 that used to read
callback_url = ‘{}{}’.format(hass.config.api.base_url, AUTH_CALLBACK_PATH)
by
callback_url = ‘{}{}’.format(get_url(hass), AUTH_CALLBACK_PATH)

You need to define get_url, so at the top of the init script I added a line that imports it like this:
from homeassistant.helpers.network import get_url

I’ve added this last line at the end of the block that imports a bunch of other functions that starts on line 13.

Good luck,
Kim

Hi,

I’m trying to configure again the miele integration, but when I try to link the account I get this error

2021-04-12 19:16:54 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for miele doing I/O at custom_components/miele/miele_at_home.py, line 141: token = self._session.fetch_token(
2021-04-12 19:16:54 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/srv/homeassistant/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/srv/homeassistant/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/ban.py", line 74, in ban_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/auth.py", line 129, in auth_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/view.py", line 128, in handle
    result = handler(request, **request.match_info)
  File "/home/homeassistant/.homeassistant/custom_components/miele/__init__.py", line 241, in get
    result = self.oauth.get_access_token(request.query["code"])
  File "/home/homeassistant/.homeassistant/custom_components/miele/miele_at_home.py", line 141, in get_access_token
    token = self._session.fetch_token(
  File "/srv/homeassistant/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py", line 336, in fetch_token
    r = self.request(
  File "/srv/homeassistant/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py", line 515, in request
    return super(OAuth2Session, self).request(
  File "/srv/homeassistant/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/homeassistant/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/srv/homeassistant/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/srv/homeassistant/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/srv/homeassistant/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/srv/homeassistant/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1266, in _send_request
    self.putrequest(method, url, **skips)
  File "/srv/homeassistant/lib/python3.8/site-packages/urllib3/connection.py", line 214, in putrequest
    return _HTTPConnection.putrequest(self, method, url, *args, **kwargs)
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/util/async_.py", line 150, in protected_loop_func
    check_loop()
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/util/async_.py", line 139, in check_loop
    raise RuntimeError(
RuntimeError: I/O must be done in the executor; Use `await hass.async_add_executor_job()` at custom_components/miele/miele_at_home.py, line 141: token = self._session.fetch_token(

I’m experiencing the same issue, Luca. Have you raised an issue on the repo for this?

Hi Paul, I saw that there is already an issue opened 3 days ago

Luca

1 Like

@Luca_Montinari , @amplustestis
Did you delete the file “.miele-token-cache” in your config directory?

Yes, I deleted the file “.miele-token-cache”, but I get the error

I have also had trouble with the integration lately, it doesn’t work, tried deleting the token, but when i try to link the account again i get " 500 Internal Server Error

Server got itself in trouble"

@mamoel, I haven’t been able to get a token successfully yet and so there is no cached token file in the config folder.

Very strange. The plugin didn’t cause any problems here for months.
My hass is running in Docker. I don’t know if this makes a difference.

I don’t think it makes a different. Mine is running on Odroid N2. I think this is an issue with the integration itself.

I am getting a 500 Internal Server error too, like @ATWindsor when I try to link the account.

Miele changed the link to the overview “capabilities by device”: link

Hello guys,
that integration is running well on my side. I made it work with
My environment:

  • Home assistant in docker Version core-2021.5.1
    Installationstyp Home Assistant Container
    Entwicklung false
    Supervisor false
    Docker true
    Virtuelle Umgebung false
    Python-Version 3.8.9
    Betriebssystemfamilie Linux
    Betriebssystem-Version 5.8.0-1019-raspi
    CPU-Architektur armv7l

I’m using the gateway xgw3000 which is connected to miele and is working with the android miele app. I registered at miele and got the developer infos which I put into the configuration.yaml:

miele:
client_id: 24e881cd-2bc4-4xxxxxxxxxx
client_secret: EbXA8VSuGxxxxxxxxxxxxxxxx
lang: de

I had installed the miele integration from hacs 1.12.3 / 20210429001005

So far so good.
I have a dishwasher installed here and what I’m missing are 2 things / entities:

  • a selection of program
  • a switch to start the diswasher in “remote control” mode.

how could that be added?
The only things / entities found for dishwasher is:

Geschirrspüler Küche miele.geschirrspuler_kuche
Geschirrspüler Küche Door binary_sensor.geschirrspuler_kuche_door
Geschirrspüler Küche Elapsed Time sensor.geschirrspuler_kuche_elapsed_time
Geschirrspüler Küche Failure binary_sensor.geschirrspuler_kuche_failure
Geschirrspüler Küche Info binary_sensor.geschirrspuler_kuche_info
Geschirrspüler Küche Program ID sensor.geschirrspuler_kuche_program_id
Geschirrspüler Küche Remaining Time sensor.geschirrspuler_kuche_remaining_time
Geschirrspüler Küche Start Time sensor.geschirrspuler_kuche_start_time
Geschirrspüler Küche Status sensor.geschirrspuler_kuche_status

What should be added is something like a switch.start_geschirrspueler for the “MobileStart” function.

I can test test test for you if you like

Thank you in advance.

1 Like

What happens, if you try something like this in the developer tools section:


This should send the “START” command to your dishwasher (if supported).

Hi there, I have just installed the miele integration but when i try to configure it by linking my Miele account it fails and says “check your access date” before redirecting me back to the account linking sign in page again. could someone let me know f this is a known issue and how I might get around it?

Edit: Ok figured it out and found the Miele api link, then generated the client id and secret, entered them in to my config.yaml and restarted HA…sensors are there…now I just need to read some of the automatons from this thread.
thanx Chris

hi. how did you fix it? what’s the new api link? I try to authenticate and I no longer have access. did miele change anything?

Hi,

Look up above in this thread until you find the link to the Miele API link. Then go there and make your account to link home assistant app. Then in the Miele site you will be given your user name and access token. Copy these in to the home assistant Miele config and it should just work.

Hi there, I renew my Miele token, by requesting a new one, and still get the error message : oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired)

any advice about that? Is there a token cache in HA?
I removed and reinstalled the whole integration as well.
Many thanks for your help
V.

There is a file .miele-token-cache (with dot in front of it) in your config-directory. Have you deleted that, before renewing the token?

1 Like

Thanks, I missed this file. After I deleted it, I was able to restart the relink of the new token.

No more error on HA side :slight_smile: now i’m not able to link the token to developer.miele.com, but it’s another story.