Giter Site home page Giter Site logo

home-assistant-miele's Introduction

Buy Me A Coffee

Donate with PayPal button

Home Assistant support for Miele@home connected appliances

Introduction

This project exposes Miele state information of appliances connected to a Miele user account. This is achieved by communicating with the Miele Cloud Service, which exposes both applicances connected to a Miele@home Gateway XGW3000, as well as those devices connected via WiFi Con@ct.

Prerequisite

HACS Install

We are now included in the default Repo of HACS. This is the recomanded way to install this integration.

  • Install HACS if you haven't yet, instructions to install HACS can be found here : https://hacs.xyz/docs/installation/prerequisites

  • Open the HACS component from your sidebar -> click integrations -> Search for Miele and install the Integration.

  • Enable the new platform in your configuration.yaml:

miele:
    client_id: <your Miele ClientID>
    client_secret: <your Miele ClientSecret>
    lang: <optional. en=english, de=german>
    cache_path: <optional. where to store the cached access token>
  • Restart Home Assistant.
  • The Home Assistant Web UI will show you a UI to configure the Miele platform. Follow the instructions to log into the Miele Cloud Service. This will communicate back an authentication token that will be cached to communicate with the Cloud Service.

Done. If you follow all the instructions, the Miele integration should be up and running. All Miele devices that you can see in your Mobile application should now be also visible in Home Assistant (miele.*). In addition, there will be a number of binary_sensors and sensors that can be used for automation.

Manual Installation of the custom component

  • Copy the content of this repository into your custom_components folder, which is a subdirectory of your Home Assistant configuration directory. By default, this directory is located under ~/.home-assistant. The structure of the custom_components directory should look like this afterwards:
- miele
    - __init__.py
    - miele_at_home.py
    - binary_sensor.py
    - light.py
    - sensor.py
  • Enable the new platform in your configuration.yaml:
miele:
    client_id: <your Miele ClientID>
    client_secret: <your Miele ClientSecret>
    lang: <optional. en=english, de=german>
    cache_path: <optional. where to store the cached access token>
    interval: <optional. the interval between miele polling updates>
  • Restart Home Assistant.
  • The Home Assistant Web UI will show you a UI to configure the Miele platform. Follow the instructions to log into the Miele Cloud Service. This will communicate back an authentication token that will be cached to communicate with the Cloud Service.

Done. If you follow all the instructions, the Miele integration should be up and running. All Miele devices that you can see in your Mobile application should now be also visible in Home Assistant (miele.*). In addition, there will be a number of binary_sensors and sensors that can be used for automation.

Questions

Please see the Miele@home, miele@mobile component discussion thread on the Home Assistant community site.

home-assistant-miele's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

home-assistant-miele's Issues

Light support in oven appliances

Hi,

According to the API docs ovens and combi ovens should support the light action.
I tried to modify light.py to add the device type and HA now gets the light entity for the appliance. It even shows the correct status if the light is on or off when toggled on the appliance itself but pressing it in HA does not work.

Have you fiddled around with this yourself? Any clues?

localize it

Some strings are hardcoded, like

def _map_key(key):
if key == "signalInfo":
return "Info"
elif key == "signalFailure":
return "Failure"
elif key == "signalDoor":
return "Door"

and
def _map_key(key):
if key == "status":
return "Status"
elif key == "programType":
return "Program Type"
elif key == "programPhase":
return "Program Phase"
elif key == "targetTemperature":
return "Target Temperature"
elif key == "temperature":
return "Temperature"
elif key == "remainingTime":
return "Remaining Time"
elif key == "elapsedTime":
return "Elapsed Time"
elif key == "startTime":
return "Start Time"

These should be localized. Right now, setting "lang: de" results in a weird mix of German strings provided by the Miele API, and the hardcoded English strings mentioned above. I'd be happy to provide German translations.

use server-sent events instead of polling

Currently, the server is polled every 5 seconds:

async def refresh_devices(event_time):
_LOGGER.debug("Attempting to update Miele devices")
device_state = await client.get_devices(lang)
if device_state is None:
_LOGGER.error("Did not receive Miele devices")
else:
hass.data[DOMAIN][DATA_DEVICES] = _to_dict(device_state)
for device in DEVICES:
device.async_schedule_update_ha_state(True)
for component in MIELE_COMPONENTS:
platform = import_module(".{}".format(component), __name__)
platform.update_device_state()
register_services(hass)
interval = timedelta(seconds=5)
async_track_time_interval(hass, refresh_devices, interval)

As of v.1.0.3 of the Miele API introduced in August 2020, server-sent events are supported:
https://www.miele.com/developer/eventing.html

Try this:

curl -X GET "https://api.mcs3.miele.com/v1/devices/all/events" -H "accept: */*" -H "Authorization: Bearer DE_xxxx"

Still error during setup of component miele after deleting cache token.

Hi, I can't seem to get the integration working. I have deleted the .miele-token-cache but I don't get a pup-up to set everything up again. Any advise? Thanks.

Error during setup of component miele
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/setup.py", line 213, in _async_setup_component
result = await task
File "/home/homeassistant/.homeassistant/custom_components/miele/init.py", line 120, in async_setup
callback_url = "{}{}".format(get_url(hass), AUTH_CALLBACK_PATH)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/network.py", line 84, in get_url
request_host = _get_request_host()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/network.py", line 124, in _get_request_host
raise NoURLAvailableError
homeassistant.helpers.network.NoURLAvailableError

hard time installing the component

I have tried installing the component via HACS.
After rebooting, I see a notification in HA with a link to Miele.
I have to enter my Miele credentials for miele@home, but I always got a german error.

After removing the integration and reinstalling it, I dont get the notification to login to Miele anymore.
Also no entity or what so ever is present in HA.

Performing a manual installation gives me the same result.

(I have the miele client id and secret setup in configuration.yaml)

Do you have any tips how to install the integration?

Detected I/O inside the event loop

When our washing machine is started/running, this warning occurs.
Seems to be related to 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 71

[Feature request] Auto-DOS levels

Some washing machine models have consumables for the Auto-DOS feature

It would be great to see those sensors pulled into HA, so you can set alerts when the Ultraphase liquids are getting low.
These stats are available in the Miele app

Thanks for your work on this integration!

Error during setup of component miele

Hello, please excuse me, I know the error has already been edited here. However, I do not get this fixed. I have already tested my account through here: https://www.miele.com/developer/swagger-ui/swagger.html# I get my devices displayed. What else could it be?
Am grateful for any help.

Kind regards

Logger: homeassistant.setup
Source: helpers/network.py:123
First occurred: 18:25:14 (1 occurrences)
Last logged: 18:25:14

Error during setup of component miele
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 249, in _async_setup_component
    result = await task
  File "/config/custom_components/miele/__init__.py", line 121, in async_setup
    callback_url = "{}{}".format(get_url(hass), AUTH_CALLBACK_PATH)
  File "/usr/src/homeassistant/homeassistant/helpers/network.py", line 83, in get_url
    request_host = _get_request_host()
  File "/usr/src/homeassistant/homeassistant/helpers/network.py", line 123, in _get_request_host
    raise NoURLAvailableError
homeassistant.helpers.network.NoURLAvailableError

Added appliance not showing up

I have this working with a Miele dishwasher; however, when I added a dryer in the app I can’t get HA to see it (works fine in the app). What do I need to do to see this appliance?

Error during setup of component miele

Logger: homeassistant.setup
Source: custom_components/miele/miele_at_home.py:28
First occurred: 10:34:18 AM (1 occurrences)
Last logged: 10:34:18 AM

Error during setup of component miele
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py", line 477, in request
url, headers, data = self._client.add_token(
File "/usr/local/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 198, in add_token
raise TokenExpiredError()
oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
result = await task
File "/config/custom_components/miele/init.py", line 145, in async_setup
data_get_devices = await client.get_devices(lang)
File "/config/custom_components/miele/miele_at_home.py", line 47, in get_devices
home_devices = await self._get_devices_raw(lang)
File "/config/custom_components/miele/miele_at_home.py", line 28, in _get_devices_raw
devices = await self.hass.async_add_executor_job(func)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py", line 496, in request
token = self.refresh_token(
File "/usr/local/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py", line 446, in refresh_token
self.token = self._client.parse_request_body_response(r.text, scope=self.scope)
File "/usr/local/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 421, in parse_request_body_response
self.token = parse_token_response(body, scope=scope)
File "/usr/local/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 431, in parse_token_response
validate_token_parameters(params)
File "/usr/local/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 441, in validate_token_parameters
raise MissingTokenError(description="Missing access token parameter.")
oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.

Supported languages?

In the config, there is: lang: <optional. en=english, de=german>. Are these only two supported?
Where should I look for to add translation for other language?

Still Error during setup of component miele

Hi,

A while ago I made an issue with the exact same problem. I have seen that it should be solved, so I updated it but I still can't get it to work. I have a feeling that I'm doing something wrong. Does anyone have any advice for me to get it working? Many thanks.

Logger: homeassistant.setup
Source: helpers/network.py:123
First occurred: 15:55:24 (1 occurrences)
Last logged: 15:55:24

Error during setup of component miele
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/setup.py", line 248, in _async_setup_component
result = await task
File "/home/homeassistant/.homeassistant/custom_components/miele/init.py", line 121, in async_setup
callback_url = "{}{}".format(get_url(hass), AUTH_CALLBACK_PATH)
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/network.py", line 83, in get_url
request_host = _get_request_host()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/network.py", line 123, in _get_request_host
raise NoURLAvailableError
homeassistant.helpers.network.NoURLAvailableError

Device name

According to the API, a device name can be set. For example (Upper machine or First floor machine).

This integration seems to support miele.action, and according to the table of actions, it should be possible to set the name of the device like this:

{
    'entity_id': 'miele.clothes_dryer',
    'body': {'deviceName': 'Villő'}
}

Tried that in Home Assistant, no error and no log entry - but I don't see the name anywhere appearing (restarted HA after running the action). Could it be possible that the deviceName field from the API is not being parsed?

Callback Failing

Version
core-2021.4.0
supervisor-2021.03.9
Operating System : Home Assistant OS 5.13

Config:

miele:
  client_id: xxxxx
  client_secret: xxxx

Trying to set up first time, and receive 500 Internal Server Error with the call back. http://10.1.1.100:8123/api/miele/callback?code=US_xxxx&state=login

There is no token sitting in the root.

Tested the clientid and secret in the api swagger, and authorizes fine.

Raw Logs:

2021-04-08 13:12:07 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-08 13:12:07 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 74, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 129, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 128, in handle
    result = handler(request, **request.match_info)
  File "/config/custom_components/miele/__init__.py", line 241, in get
    result = self.oauth.get_access_token(request.query["code"])
  File "/config/custom_components/miele/miele_at_home.py", line 141, in get_access_token
    token = self._session.fetch_token(
  File "/usr/local/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py", line 336, in fetch_token
    r = self.request(
  File "/usr/local/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py", line 515, in request
    return super(OAuth2Session, self).request(
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/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 "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 214, in putrequest
    return _HTTPConnection.putrequest(self, method, url, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 150, in protected_loop_func
    check_loop()
  File "/usr/src/homeassistant/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(

[Feature Request] Energy (and water) consumption sensor

Could be nice enabling an energy sensor compatible with the new Home assistant Energy dashboard.
Miele Api provides energy information under the "ecoFeedback" json object.

the ecoFeedback object returns the amount of water and energy used by the current running program up to the present moment. Furthermore it returns a forecast for water and energy consumption for a selected program.

Do you want me to add GitHub actions?

Sorry for not following the issue template

If you want, I can add some advanced CI to your repo in a PR. Let me know if you want that.

  • Do you want to enable auto-formatting?
  • Do you want packaged or independent (I recommend packaged because I can send updates)?

Error adding entities for domain fan with platform miele

On home assistant startup this error occurs for my Miele cooker hood:

Error adding entities for domain fan with platform miele
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 322, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 429, in _async_add_entity
    capabilities=entity.capability_attributes,
  File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 512, in capability_attributes
    attrs[ATTR_PRESET_MODES] = self.preset_modes
  File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 637, in preset_modes
    return preset_modes_from_speed_list(self.speed_list)
  File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 683, in preset_modes_from_speed_list
    return [
  File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 686, in <listcomp>
    if speed.lower() in _NOT_SPEEDS_FILTER and speed.lower() != SPEED_OFF
AttributeError: 'int' object has no attribute 'lower'

I think this is supposed to make the cooker hood fan a fan entity, however no entity seems to be created.
Also, the Miele.Action service for the fan doesn't seem to work. It worked fine before 2021.4.*
I don't think it is a connection failure, because the Cooker Hood sensors work fine.

On startup also this message occurs, i don't know if it is related:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 285, in async_update_ha_state
    raise NoEntitySpecifiedError(
homeassistant.exceptions.NoEntitySpecifiedError: No entity id specified for entity Cooker hood

Won't set up correctly when using DuckDNS

So, when I try to use the Miele integration it won't work and I get the error down below. I'm still new to HA so I would appreciate some help to get this solved.

Source: helpers/network.py:123
First occurred: 22:33:24 (1 occurrences)
Last logged: 22:33:24

Error during setup of component miele

Traceback (most recent call last):
 File "/usr/src/homeassistant/homeassistant/setup.py", line 255, in _async_setup_component

    result = await task
  File "/config/custom_components/miele/__init__.py", line 121, in async_setup
    callback_url = "{}{}".format(get_url(hass), AUTH_CALLBACK_PATH)
  File "/usr/src/homeassistant/homeassistant/helpers/network.py", line 83, in get_url
    request_host = _get_request_host()
  File "/usr/src/homeassistant/homeassistant/helpers/network.py", line 123, in _get_request_host
    raise NoURLAvailableError
homeassistant.helpers.network.NoURLAvailableError```

no remaining time entity

Hi there,

I tried the new integration, but I don’t get entites for the remaining time.
Is there something wront or am I looking at the wrong spot…?

here is the dishwasher:

{
  "000105104xxx": {
    "ident": {
      "type": {
        "key_localized": "Gerätetyp",
        "value_raw": 7,
        "value_localized": "Geschirrspüler"
      },
      "deviceName": "",
      "deviceIdentLabel": {
        "fabNumber": "000105104xxx",
        "fabIndex": "64",
        "techType": "G7565",
        "matNumber": "10992350",
        "swids": [
          "4921",
          "20492",
          "25166",
          "4465",
          "25318",
          "4928",
          "20475",
          "25266",
          "4875",
          "20366",
          "20462"
        ]
      },
      "xkmIdentLabel": {
        "techType": "EK037",
        "releaseVersion": "03.65"
      }
    },
    "state": {
      "ProgramID": {
        "value_raw": 1,
        "value_localized": "Intensiv",
        "key_localized": "Programmbezeichnung"
      },
      "status": {
        "value_raw": 5,
        "value_localized": "In Betrieb",
        "key_localized": "Status"
      },
      "programType": {
        "value_raw": 0,
        "value_localized": "Programm",
        "key_localized": "Programmart"
      },
      "programPhase": {
        "value_raw": 1795,
        "value_localized": "Reinigen",
        "key_localized": "Programmphase"
      },
      "remainingTime": [***
        2,
        24
      ],
      "startTime": [
        0,
        0
      ],
      "targetTemperature": [
        {
          "value_raw": -32768,
          "value_localized": null,
          "unit": "Celsius"
        },
        {
          "value_raw": -32768,
          "value_localized": null,
          "unit": "Celsius"
        },
        {
          "value_raw": -32768,
          "value_localized": null,
          "unit": "Celsius"
        }
      ],
      "temperature": [
        {
          "value_raw": -32768,
          "value_localized": null,
          "unit": "Celsius"
        },
        {
          "value_raw": -32768,
          "value_localized": null,
          "unit": "Celsius"
        },
        {
          "value_raw": -32768,
          "value_localized": null,
          "unit": "Celsius"
        }
      ],
      "signalInfo": false,
      "signalFailure": false,
      "signalDoor": false,
      "remoteEnable": {
        "fullRemoteControl": true,
        "smartGrid": false,
        "mobileStart": true
      },
      "light": 2,
      "elapsedTime": [
        0,
        0
      ],
      "spinningSpeed": {
        "unit": "U/min",
        "value_raw": null,
        "value_localized": null,
        "key_localized": "Schleuderdrehzahl"
      },
      "dryingStep": {
        "value_raw": null,
        "value_localized": "",
        "key_localized": "Trockenstufe"
      },
      "ventilationStep": {
        "value_raw": null,
        "value_localized": "",
        "key_localized": "Lüfterstufe"
      },
      "plateStep": [],
      "ecoFeedback": {
        "currentWaterConsumption": {
          "unit": "l",
          "value": 4
        },
        "currentEnergyConsumption": {
          "unit": "kWh",
          "value": 0.3
        },
        "waterForecast": 0.5,
        "energyForecast": 0.7
      },
      "batteryLevel": null
    }
  }
...

configuration.yaml:
miele:

client_id: 7cc5649a-af44-4ee3-bf74-b0axxxxxxxxx
    client_secret: pZdgX2qXQo2MmXExL3aDSR7bTTxxxxxxxxx
    language: de

21bd3db25b748096472af28de99a22fa536455ef

Log:

2020-11-30 15:21:34 INFO (MainThread) [custom_components.miele.config_flow] Successfully authenticated
2020-11-30 15:21:34 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.miele
2020-11-30 15:21:34 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.miele
2020-11-30 15:21:34 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.miele entity: sensor.dishwasher_000105104XXX_program_id
2020-11-30 15:21:34 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.miele entity: sensor.dishwasher_000105104XXX_elapsed
2020-11-30 15:21:34 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.miele entity: sensor.dishwasher_000105104XXX_finish_time
2020-11-30 15:21:34 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.miele entity: sensor.dishwasher_000105104XXX_light
2020-11-30 15:21:34 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.miele entity: sensor.dishwasher_000105104XXX_program_phase
2020-11-30 15:21:34 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.miele entity: sensor.dishwasher_000105104XXX_program_type
2020-11-30 15:21:34 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.miele entity: sensor.dishwasher_000105104XXX_spinning_speed
2020-11-30 15:21:34 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.miele entity: sensor.dishwasher_000105104XXX_start
2020-11-30 15:21:34 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.miele entity: sensor.dishwasher_000105104XXX
2020-11-30 15:21:35 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.miele entity: binary_sensor.dishwasher_000105104XXX_full_remote_control
2020-11-30 15:21:35 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.miele entity: binary_sensor.dishwasher_000105104XXX_signal_door
2020-11-30 15:21:35 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.miele entity: binary_sensor.dishwasher_000105104XXX_signal_failure
2020-11-30 15:21:35 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.miele entity: binary_sensor.dishwasher_000105104XXX_signal_info

As you can see the remainint time is there in Miele API, but the integration doesn't create an entity for it.
I have no clue...
Maybe you could look into that problem.
Thx

Sebastian

Cant finishe async setup error

I have the following problem, since the update I get this error message.

I reinstall the module, delete the cache, check DuckDNS,
nothing helped

Since the update, the entitys remaning time, starttime. etc. are also gone.

I reinstall the module x times. Test with beta version 0.9.1 also doesnt work´.

Error message:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 248, in _async_setup_component
result = await task
File "/config/custom_components/miele/init.py", line 150, in async_setup
data_get_devices = await client.get_devices(lang)
File "/config/custom_components/miele/miele_at_home.py", line 52, in get_devices
for home_device in home_devices:
TypeError: 'coroutine' object is not iterable

Add ProgramID

Washing machines, Tumbly dryers, dishwashers etc. support ProgramID.

"state": {
      "ProgramID": {
        "value_raw": 28,
        "value_localized": "Economy",
        "key_localized": "Program Id"
      },

The value of „value_localized“ can also be „SaniPlus“, „Sensor Wash“, „Pots & Pans“, „QuickPowerWash“, „China & Crystal“, „Normal“, „Extra Quiet“ etc., so that‘s more interesting than the „programType“ property, which always has „Automatic Program“.

Sensors for consumables

Would it be possible to add sensors for consumables?
For example in the app the percent status displayed for the Miele UltraPhase 1 and 2 detergent levels is shown:
kép
It would be great to have these in Home Assistant because combined with state history, it could be seen the actual consumption over time, something the original app doesn't have.

TypeError: 'coroutine' object is not iterable

I've just installed the component according to the instructions and added my credentials.
A token is generated and stored, so that works fine.

When initializing the integration, the error log lists:
'''
Error during setup of component miele
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
result = await task
File "/config/custom_components/miele/init.py", line 145, in async_setup
data_get_devices = await client.get_devices(lang)
File "/config/custom_components/miele/miele_at_home.py", line 53, in get_devices
for home_device in home_devices:
TypeError: 'coroutine' object is not iterable
'''

Oven Start Time is offset not absolute time

It is currently 20:58 and I've just set my Miele H6860BP oven to come on at 7AM in the morning to preheat ready to bake bread when I get up.

sensor.oven_start_time is currently 10:02

So this field is clearly the time until the program starts, not the time at which the program starts.

Entity inconsistency between HA and Miele API documentation

thx for this excellent Miele integration ;-)

While setting up my lovelance UI for my Miele G6865 Dishwasher I observed that the following entities are available in Home Assistant:

Bildschirmfoto 2021-01-25 um 17 52 07

In addition these attributes are available:
Bildschirmfoto 2021-01-25 um 17 52 59
Bildschirmfoto 2021-01-25 um 17 54 13

the following entities do not get any data, every:

sensor.geschirrspuler_target_temperature_0
sensor.geschirrspuler_temperature_0
sensor.geschirrspuler_temperature_1
sensor.geschirrspuler_temperature_2

which is consistent with the official Miele API documentation

Bildschirmfoto 2021-01-25 um 19 56 42

Looks like the Home Assistant Miele integration should not set up sensor for these temperature in this case.

In addition, I observed that some Miele dishwashers report energy (german: energie) and water (german: wasser) usage. With additional sensors

sensor.geschirrspuler_wasser
sensor.geschirrspuler_energie

My dishwasher collects the same information and shows this on the dishwasher display. But it does not show up in the official Miele API description neither in the Home Assistant integration.

Any idea how we can correct this?

Error handling

Great component, thank you!

When there's any internet connection problem, the log of Home Assistant starts to fill with task exceptions.
I am not using debug mode. It should be handled to mute these kinds of errors from the log, one single informative line would be enough, something like "timed out connecting to miele servers"

2021-03-12 19:46:04 ERROR (MainThread) [custom_components.miele.miele_at_home] Failed to retrieve Miele devices: HTTPSConnectionPool(host='api.mcs3.miele.com', port=443): Max retries exceeded with url: /v1/devices?language=en (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f4f1ac80ac0>: Failed to establish a new connection: [Errno 110] Operation timed out'))
2021-03-12 19:46:04 ERROR (MainThread) [custom_components.miele] Did not receive Miele devices
2021-03-12 19:46:08 ERROR (MainThread) [custom_components.miele.miele_at_home] Failed to retrieve Miele devices: HTTPSConnectionPool(host='api.mcs3.miele.com', port=443): Max retries exceeded with url: /v1/devices?language=en (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f4f1a67f730>: Failed to establish a new connection: [Errno 110] Operation timed out'))
2021-03-12 19:46:08 ERROR (MainThread) [custom_components.miele] Did not receive Miele devices
2021-03-12 20:00:16 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 445, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 440, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.8/http/client.py", line 1347, in getresponse
    response.begin()
  File "/usr/local/lib/python3.8/http/client.py", line 307, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.8/http/client.py", line 268, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/local/lib/python3.8/socket.py", line 669, in readinto
    return self._sock.recv_into(b)
  File "/usr/local/lib/python3.8/ssl.py", line 1241, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/local/lib/python3.8/ssl.py", line 1099, in read
    return self._sslobj.read(len, buffer)
TimeoutError: [Errno 110] Operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 531, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.8/site-packages/urllib3/packages/six.py", line 735, in reraise
    raise value
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 447, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 353, in _raise_timeout
    raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.mcs3.miele.com', port=443): Read timed out. (read timeout=None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/miele/__init__.py", line 161, in refresh_devices
    device_state = await client.get_devices(lang)
  File "/config/custom_components/miele/miele_at_home.py", line 47, in get_devices
    home_devices = await self._get_devices_raw(lang)
  File "/config/custom_components/miele/miele_at_home.py", line 28, in _get_devices_raw
    devices = await self.hass.async_add_executor_job(func)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py", line 515, in request
    return super(OAuth2Session, self).request(
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.mcs3.miele.com', port=443): Read timed out. (read timeout=None)

500 Internal Server Error

After upgrading to 2021.4.3 i had issues with the Miele add'on. After som trial and error i uninstalled the addon completely. Now i am unable to link the addon again at Miele. I have renewed the client activation, but every time when i link fro HA I end up with the "500 Internal Server Error". Any good ideas?

Did not recieve Miele devices

For a long time now, the error below shows up frequently in HA.

Would it be an option to:

  • Increase timeout for the call to Miele Cloud? Maybe Miele Cloud sometiems is just too slow?
  • Try multiple times before raising an error?
Logger: custom_components.miele
Source: custom_components/miele/__init__.py:171
Integration: Miele@home (documentation, issues)
First occurred: October 14, 2021, 14:18:43 (4 occurrences)
Last logged: October 14, 2021, 18:50:55

Did not receive Miele devices

After HA update Miele token_expired

Hello,

after my update from core 2021.5.5 -> 2021.7.4 my Miele integration has trouble.

  • re-installed miele integration via HACS
  • created new Miele Client ID and Client Secret, working fine in the Miele swagger

But I still get his error message:


Logger: homeassistant.setup
Source: custom_components/miele/miele_at_home.py:28
Integration: miele (documentation, issues)
First occurred: 15:21:52 (1 occurrences)
Last logged: 15:21:52

Error during setup of component miele
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 477, in request
    url, headers, data = self._client.add_token(
  File "/usr/local/lib/python3.9/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 198, in add_token
    raise TokenExpiredError()
oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired) 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 249, in _async_setup_component
    result = await task
  File "/config/custom_components/miele/__init__.py", line 146, in async_setup
    data_get_devices = await client.get_devices(lang)
  File "/config/custom_components/miele/miele_at_home.py", line 47, in get_devices
    home_devices = await self._get_devices_raw(lang)
  File "/config/custom_components/miele/miele_at_home.py", line 28, in _get_devices_raw
    devices = await self.hass.async_add_executor_job(func)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 496, in request
    token = self.refresh_token(
  File "/usr/local/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 446, in refresh_token
    self.token = self._client.parse_request_body_response(r.text, scope=self.scope)
  File "/usr/local/lib/python3.9/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 429, in parse_request_body_response
    self.token = parse_token_response(body, scope=scope)
  File "/usr/local/lib/python3.9/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 425, in parse_token_response
    validate_token_parameters(params)
  File "/usr/local/lib/python3.9/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 435, in validate_token_parameters
    raise MissingTokenError(description="Missing access token parameter.")
oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.

Any hints what this is about?

Unable to install Miele integration using HACS

Description Value
Installation method Supervisor
Home Assistant version core-2021.9.1 & core-2021.8.1
Supervisor version supervisor-2021.08.1

Issue

I am unable to install the integration using HACS. It is not part of the HACS selection/integration list.

Steps to reproduce

  1. Installed HACS from directions on hacs.xyz
  2. Restart Home Assistant
  3. Clear cache / browser data
  4. Open HACS UI -> Integration -> Add Integration
  5. The Miele integration is not part of the selection/integration list.

Miele HACS

Error: No entity id specified for entity Cooker hood

I'm getting the following error every few seconds in the logs and I no longer see the cooker hood fan.

File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 270, in async_update_ha_state
raise NoEntitySpecifiedError(homeassistant.exceptions.NoEntitySpecifiedError: No entity id specified for entity Cooker hood ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved

I think (but I can't be sure) this started happening after updating from Python 2 to 3 - so maybe I broke something.
I've tried remove the addon, deleting the entities and installing again, but I get the same error.
Any ideas? Thanks

Starting Dishwasher using Remote Control

Thanks heaps for the integration!

I have a miele dishwasher that has support for remote control start. I can get the dishwasher to start fine from the miele@home app when the machine is in the remote start mode.

I have tried to call the miele.action with the following service data, but can't get it to work. I also can't see anything in the logs.

{
    'entity_id': 'miele.dishwasher',
    'body': { "processAction": 1 }
}

I'm sure im missing something silly!

Cheers.
Dave.

Did not receive Miele devices

Since I updated to the new Home Assistant Core Version (core-2021.4.6), I get following error massage.

Logger: custom_components.miele
Source: custom_components/miele/init.py:167
Integration: Miele@home (documentation, issues)
First occurred: 6:23:21 (1 occurrences)
Last logged: 6:23:21

Cheers
Vic

No devices are added

Once setup is complete I can see entities added, but no real devices are assembled from the entities.

Is this OK and I should build devices manually out of entities?

Error while changing light

When trying to change the light of a Miele cooker hood this error occurs:

Error executing service: <ServiceCall miele.action (c:): device_id=000xxxxxxxx, body=light=2>
Error executing service: <ServiceCall miele.action (c: device_id=000xxxxxxxxx, body=light=1>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1496, in catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
    await handler.job.target(service_call)
  File "/config/custom_components/miele/__init__.py", line 211, in _action_service
    await _apply_service(service, MieleDevice.action, body)
  File "/config/custom_components/miele/__init__.py", line 206, in _apply_service
    await service_func(device, *service_func_args)
  File "/config/custom_components/miele/__init__.py", line 336, in action
    await self._client.action(self.unique_id, action)
  File "/config/custom_components/miele/miele_at_home.py", line 71, in action
    result = await self._session._session.put(
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 602, in put
    return self.request('PUT', url, data=data, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py", line 515, in request
    return super(OAuth2Session, self).request(
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/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 "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 214, in putrequest
    return _HTTPConnection.putrequest(self, method, url, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 150, in protected_loop_func
    check_loop()
  File "/usr/src/homeassistant/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 71: result = await self._session._session.put(

Additional info in Washing Machine Info/Failure and Clothes Dryer Info/Failure

Integration provides 4 binary sensors with device class problem:

  • binary_sensor.washing_machine_info
  • binary_sensor.washing_machine_failure
  • binary_sensor.clothes_dryer_info
  • binary_sensor.clothes_dryer_failure

Is it possible to add message attribute to these sensors which will shows that machines shows at screen?

Error during setup of component miele with Home Assistant 2021.4.x

When I update to 2021.4.x my Home Assistant , the Miele integration not work, this is the error log:

Logger: homeassistant.setup
Source: custom_components/miele/miele_at_home.py:52
First occurred: 6:51:41 (1 occurrences)
Last logged: 6:51:41

Error during setup of component miele
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 240, in _async_setup_component
result = await task
File "/config/custom_components/miele/init.py", line 145, in async_setup
data_get_devices = await client.get_devices(lang)
File "/config/custom_components/miele/miele_at_home.py", line 52, in get_devices
for home_device in home_devices:
TypeError: 'coroutine' object is not iterable

After update to 2021.4.1, miele integration gives errors at start and while running

Error during startup:

Logger: homeassistant.bootstrap
Source: bootstrap.py:392
First occurred: 13:27:51 (1 occurrences)
Last logged: 13:27:51

Waiting on integrations to complete setup: miele

and

Logger: homeassistant.bootstrap
Source: bootstrap.py:392
First occurred: 13:27:51 (1 occurrences)
Last logged: 13:27:51

Waiting on integrations to complete setup: miele

Error during runtime:

Logger: homeassistant
Source: helpers/entity.py:455
First occurred: 13:29:14 (62 occurrences)
Last logged: 13:33:45

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/miele/__init__.py", line 174, in refresh_devices
    platform.update_device_state()
  File "/config/custom_components/miele/binary_sensor.py", line 49, in update_device_state
    device.async_schedule_update_ha_state(True)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 455, in async_schedule_update_ha_state
    self.hass.async_create_task(self.async_update_ha_state(force_refresh))
AttributeError: 'NoneType' object has no attribute 'async_create_task'

Consumables status

I've got an WSG 633 washing machine which has two containers for detergents. Would be perhaps be possible to include the status of these?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.