Yes, other users and myself have seen same problem the last few days. The Miele API servers have been down or at least malfunctioning in periods. It looks like the integration does not always recover properly after such an outage and a restart is necessary to recover all functions… It is a bit difficult to debug but I will try to improve the recovery mechanism.
The 400 error just indicates that the API did not accept the command at that specific moment. There is currently no retry mechanism in that area of the code. I chose the same approach as the typical TV remote. If your TV doesn’t react to a key press, you just press the same button again. It is perhaps not so safe to retry starting an oven for many minutes until the API eventually recovers. But I am open to suggestions…
Hello all.
Here also problems with the api the last 2 days, after a home assistant restart.
From my inexperienced point of view it seems as if Miele has changed the URL.
‘’’
Logger: homeassistant.setup
Source: helpers/network.py:207
First occurred: 14:00:23 (1 occurrences)
Last logged: 14:00:23
Error during setup of component miele
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 235, in _async_setup_component
result = await task
File “/config/custom_components/miele/init.py”, line 124, in async_setup
network.get_url(hass, allow_external=True, prefer_external=True),
File “/usr/src/homeassistant/homeassistant/helpers/network.py”, line 168, in get_url
request_host = _get_request_host()
File “/usr/src/homeassistant/homeassistant/helpers/network.py”, line 207, in _get_request_host
raise NoURLAvailableError
homeassistant.helpers.network.NoURLAvailableError
For my personal use (i use it to change the fan speed and lights of the cooking hood with the light switches), i think no retry is the best, you see it doesn’t work, and press again. Not ideal of course, but the alternative is probably that it will que up a lot of commands since i will try several times, and that doesn’t seem better.
I can’t seem to link my Miele@Home account. It says authorization failed but I am 100% sure I gave the correct e-mail and password for my Miele@Home account.
Hi, I had the same problem and I can’t log into my mobile app. I wrote to helpdesk and they asked me to change my password to my account, because there are any new password policies. I do It and I logged into my mobile Miele app. I tried to add the Miele integration in home assistant, but authorization failed. I again wrote to helpdesk. Second problem was that I used the ‘+’ sign at the end of my password. The helpdesk recommended to me delete the ‘+’ sign at the end of the password (You can do this easily within the mobile app: Profile → Profile settings → Account information → Change password). I do It and now It works. I wrote to helpdesk again, that this fix helped me and they answered: " Thank you very much for your feedback. That APP and API behave differently when accepting passwords was unknown to us until now. We will fix this as soon as possible."
I can help here after 3 MONTHS emails with miele support…
make you aware you can make queries to your machine via api Miele 3rd party API - API documentation. To do so you will need access-
Get your personal developer credentials here: https://developer.miele.com. Submitted the form and was waiting and waiting… so just send them an email with what you need and hopefully, they will send you the credentials. (they also send me 3 times the wrong credentials… anyway). Use those credentials to authorize in HA yaml
2022-06-22 16:22:52 ERROR (MainThread) [homeassistant.setup] Error during setup of component miele
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
result = await task
File "/config/custom_components/miele/__init__.py", line 153, in async_setup
hass.data[DOMAIN][DATA_DEVICES] = _to_dict(data_get_devices)
File "/config/custom_components/miele/__init__.py", line 109, in _to_dict
for item in items:
TypeError: 'NoneType' object is not iterable
The “new” integration works with HA 2206.6.7,
To migrate you should remove the “old” integration, restart HA and follow the instructions in the repo to install the new one. Same credentials will work so you can just leave the settings in configuration.yaml.
I did the migration. I can confirm that it works and it also has more features.
The migration is not 100% smooth and that is because as usual Home Assistant leaves behind garbage when you remove something.
When you remove the old Miele integration and restart Home Assistant BEFORE you even start adding the new integration to HA, all the old entities are left behind as Orphan devices.
The consequence of this is that all the new Miels device will be created with entity_id suffixed by _2
So the migration path is
Make a note of all the entities that belong to the old Miele integration
Remove the old Miele integration from Settings → Devices and Services → Integrations tab
Remove the old Miele custom component from HACS using the UI in HACS
Restart HA
Find all the old entities in the Developer Tools or the Settings Entities (not sure you can see them there)
Search for Miele and add the integration. Make sure to select the new astrandb one
Restart HA
Add the Miele Integration in Settings → Devices and Services → Integrations tab
When you are asked to login with the Miele account then it is the normal user name and password you use in the Miels app - not the developer credentials that you have in configuration.yaml
Done
EDIT: added the step to remove the old integration from HA before removing the component in HACS UI
One of the things I miss in the documentation is the information you need to use the integration in Home Assistant.
I bet most of you have a Miele washing machine and the first automation you want to do is to do an announcement or flash some light when the machine has completed a wash cycle.
What makes it even harder is that you cannot see what the status values are of the different sensors until you run through a cycle. And when you have done that and look at the Logbook and use those values you will fail to get the automation to work because the front end developers of Home Assistant forget what we use this information for and they beautify the information by capitalizing the values and changing underscore to spaces. You can only see the true values in the developer tools and there you have no history.
I should also state that the astrandb integration does not use the same state values as the old integration so that is another migration step you have to figure out
Here is a working example of an automation that announced that the washing machine cycle is complete
Note that the real state values are “running” and “program_ended” and not Running and Program Ended as the Logbook shows in a misunderstood attempt to be user friendly.
EDIT 1. The automation above actually does not work. And I have not found out why yet. This shows even more how much it is needed to document how to use things. And in the case of this integration each experiment requires you run an entire washing cycle just to see that things still fail. It is horrible to work this way
EDIT 2. If I test with the removing the from value and only having to: ‘off’ then I can get my automation triggered. So either there is a sporatic value between running and program_ended or one of the two values are not the right ones in HAs state machines. The original problem is that the automation does not trigger. The action works fine. It takes forever to test because you have to run a 45 min washing cycle each time
Yes I hate that “improvement” that the HA team made to the developer entities…they actually made it harder now rather than easier. So a backwards step for modest of us.
I recommend that you remove the integration from Settings->Integrations (after taking the notes). HA should then remove the entities that are created by the old integration. Then you can proceed to remove the integration from HACS.
Åke do you have an example automation for washing machine from your own installation that you know works? I have run out of dirty clothes for today. It is the triggers and the sensors names and values that I am interested in
The design philosophy of this integration has been to keep the internal logic as simple as possible. Just to expose the Miele API as entities in HA. It is a very difficult and never ending task to make the integration “better and more stable” than the underlying API.
There is a blueprint automation Miele log - Blueprint for Home Assistant · GitHub that can be used to log all state transitions for the miele sensors. That way you can follow what the API reports during a wash cycle.
A possible problem with your automation code is that there might never be a transition from “running” to “program_ended”. Try to remove from: running.
All supported states can be found here miele/const.py at main · astrandb/miele (github.com)
I understand if the clear text of states vs internal state names can be confusing. However, the clear text can be localized in UI according to each HA user’s perference while the internal name that is used for automations always stays the same.
The critique on the naming is the UI in HA and not your integration. It is good we can see a friendly name in the various cards in the Lovelace UI. What many of us are upset about is that the tools you use to define scripts, automations etc hide the real value and replace them with the friendly values. My wife will never look at the endless lists in e.g. the logbook. The logbook should show the real values. Or both. It could list the friendly and put the real value in paranthesis.
For your integration, you should add a couple of commonly used examples like mine (if it works without the from). It is the only Miele device I have with network so I do not know what good example there are for other devices. There is nothing that beats a good example. And the normally used values for sensors should be documented as well. Maybe I’ll submit a PR when I have learned more myself
Not sure what the problem is here, I’ve got a similar automation that works fine for my devices (washer-dryer and dishwasher). This is the one for the washer-dryer, the most complicated part is the translation of the various programs for the notification:
alias: Waschtrockner - Benachrichtigungen
description: Verschickt Benachrichtigungen, wenn der Waschtrockner ein Programm beendet.
trigger:
- platform: state
entity_id: sensor.waschtrockner_status
to: program_ended
from: running
condition: []
action:
- service: notify.everyone
data:
title: Waschtrockner
message: >-
{% set program_name =
iif(program[states("sensor.waschtrockner_program")],
program[states("sensor.waschtrockner_program")],
states("sensor.waschtrockner_program")) %} Ihre Wäsche ist fertig. Das
Programm »{{ program_name }}« wurde um {{ now().strftime('%-H:%M') }}
Uhr beendet.
variables:
program:
no_program: Kein Programm
cottons: Baumwolle
minimum_iron: Pflegeleicht
delicates: Feinwäsche
woollens: Wolle
silks: Seide
starch: Stärken
rinse: Spülen
drain_spin: Pumpen/Schleudern
curtains: Gardinen
shirts: Oberhemden
denim: Jeans
proofing: Imprägnieren
sportswear: Sportwäsche
automatic_plus: Automatic plus
outerwear: Outdoor
pillows: Kopfkissen
cool_air: Lüften kalt
warm_air: Lüften warm
rinse_out_lint: Flusen ausspülen
dark_garments: Dunkle Wäsche
separate_rinse_starch: Nur Spülen/Stärken
first_wash: Neue Textilien
cottons_hygiene: Baumwolle Hygiene
steam_care: Finish Dampf
freshen_up: Auffrischen
trainers: Sportschuhe
clean_machine: Maschine reinigen
down_duvets: Daunendecken
express_20: Express 20
down_filled_items: Daunen
cottons_eco: Baumwolle ECO
quick_power_wash: QuickPowerWash
eco_40_60: ECO 40-60
mode: queued
max: 10
This is not working. When adding the integration, HA asks me to make a connection with Miele. Which I do, and after that it errors. It gives a blank error notice with only a Oke option. And nothing works afterwards. This was already happening to me with the old one. Any idea how to fix it? Cant find any logs of it.