Closed bsoener closed 3 years ago
Does no one have an idea what this can be? When I do method 2, it works strangely enough
Hi, It shouldn't matter which method you used.
I am in the process of creating a guided setup which would get rid of most manual actions and should prevent any wrongly retrieved tokens. If this persists please add the Homebridge logging preferably with debug mode enabled.
Guided setup process is now available in the newest version.
Update was performed yesterday evening. Today the washing machine runs but the plugin shows the device is offline? Do I need to update my tokens again?
Please paste your log information. Then I can see how the plugin has stored your tokens or if it uses your config as last resort.
Because now I cannot see if you maybe only have a token set and no refresh token.
Could you open settings? If you have an incomplete token, the setup should guide you to login to Miele to retrieve the token.
{
"name": "Miele@Home",
"clientID": "729ec637-4a22-4694-9f12-5e837160xxxx",
"clientSecret": "pIzmliEmaTYDCZzgu94nem2f1r7Axxxx",
"token": "DE_733dcdd4badb9804132a68b58944xxxx",
"refreshToken": "DE_2d9170f8405a2ad8171467e70c99xxxx",
"language": "de",
"pollInterval": 60,
"platform": "Miele@home"
},
[07/02/2021, 16:49:07] [Homebridge UI] [homebridge-mieleathome] Incoming Request: /is_token_stored [07/02/2021, 16:49:07] [Homebridge UI] [homebridge-mieleathome] Valid token already available in persistent storage. [07/02/2021, 16:49:18] [Homebridge UI] [homebridge-mieleathome] Terminating child process... [07/02/2021, 16:49:18] [Homebridge UI] [homebridge-mieleathome] Child process ended
Have my tokens at the end intentionally provided with xxx
Please also dump the part of the log where the plugin attempts to connect to Miele. This should appear after pollInterval (60s). Then also the initialisation part where the plugin logs itself initialising. The token and refreshToken mentioned in your config are obsolete with the latest version. I think the plugin did not manage to refresh earlier due to connection problems.
In the log I only see this part. That means I would have to reconfigure the token again?
No, I see you somehow again have a capital "H" in your config. If you only see the logging that you see, it means the whole plugin did not load. You really should see the platform plugin loading and attempting to connect to the cloud. Please correct "H" in "h" for the platform name.
I do not understand though that when you press "Save" in settings, it should have saved the correct name.
{
"name": "Miele@home",
"clientID": "729ec637-4a22-4694-9f12-5e837160xxxx",
"clientSecret": "pIzmliEmaTYDCZzgu94nem2f1r7Axxxx",
"token": "DE_733dcdd4badb9804132a68b58944xxxx",
"refreshToken": "DE_2d9170f8405a2ad8171467e70c99xxxx",
"language": "de",
"pollInterval": 60,
"platform": "Miele@home"
},
Has been modified and restarted. Unfortunately, it shows me in the Homekit that my Miele device is offline.
Please paste your complete log, as the problem is the whole plugin is not even loaded when that is really the only logging you see. So it is not even touching any code of the plugin yet.
Please verify how many platform are loaded and if the Miele@home platform is loaded when you reboot Homebridge.
You should see something similar to:
[2/7/2021, 8:57:01 PM] Loaded config.json with 0 accessories and 2 platforms. [2/7/2021, 8:57:01 PM] --- [2/7/2021, 8:57:03 PM] Loaded plugin: homebridge-config-ui-x@4.36.0 [2/7/2021, 8:57:03 PM] Registering platform 'homebridge-config-ui-x.config' [2/7/2021, 8:57:03 PM] --- [2/7/2021, 8:57:03 PM] Loaded plugin: homebridge-mieleathome@0.0.0-development [2/7/2021, 8:57:03 PM] Registering platform 'homebridge-mieleathome.Miele@home' [2/7/2021, 8:57:03 PM] --- [2/7/2021, 8:57:03 PM] Loading 2 platforms... [2/7/2021, 8:57:03 PM] [Miele@home] Initializing Miele@home platform... [2/7/2021, 8:57:03 PM] [Miele@home] Finished initializing platform: Miele@home [2/7/2021, 8:57:03 PM] [Miele@home] Loading accessory data from cache: Washer dryer [2/7/2021, 8:57:03 PM] [Miele@home] Executed didFinishLaunching callback [2/7/2021, 8:57:03 PM] [Miele@home] Token loaded from persistent storage.
[30/01/2021, 12:35:50] --- [30/01/2021, 12:35:50] Loaded plugin: homebridge-mieleathome@2.1.2 [30/01/2021, 12:35:50] Registering platform 'homebridge-mieleathome.Miele@home' [30/01/2021, 12:35:50] ---
unfortunately I only see this as Miele plugin in the log
That is an old log. Please reboot your Homebridge server and check the log. If you do not see "Initializing Miele@home" something very awkward is wrong outside of the code of this plugin.
As you just updated the plugin, you have to reboot Homebridge in order for the new version to take effect.
which command do i have to enter?
sudo journalctl -f -au homebridge?
Feb 07 21:24:08 raspberrypi homebridge[29823]: [07/02/2021, 21:24:08] [Miele@home] Token loaded from persistent storage. Feb 07 21:24:08 raspberrypi homebridge[29823]: [07/02/2021, 21:24:08] [HarmonyHub] DidFinishLaunching Feb 07 21:24:08 raspberrypi homebridge[29823]: [07/02/2021, 21:24:08] [HarmonyHub] (HarmonyHub)INFO - Loading activities... Feb 07 21:24:08 raspberrypi homebridge[29823]: [07/02/2021, 21:24:08] [Miele@home] Miele API request https://api.mcs3.miele.com/v1/devices?language=de failed with status 401: "Unauthorized".
Easiest is using the Homebridge Config UI-X. Upper right corner there is button with tooltip: "restart".
So it seems somehow your token is invalid (maybe it did not refresh automatically?). Since it says: "Unauthorized". Can you remove the configuration from config.json? This triggers the settings to re-create the token via the guided setup process. Go into the config and remove the Miele@home complete section.
Feb 07 21:24:08 raspberrypi homebridge[29823]: [07/02/2021, 21:24:08] [Miele@home] Miele API request https://api.mcs3.miele.com/v1/devices?language=de failed with status 401: "Unauthorized".
What I do not understand, before the update it did not work. I have set the tokens correctly. Then I saw that yesterday evening an update was out. This morning my washing machine is running but still shows my Homekit that it is offline....
"before the update it did not work." So can I conclude it never worked? As you say "before the update .. " and "still shows offline"
This is understandable as it says: "Unauthorised". Please realise that when there is a token available on disk, the plugin will always use that one. It will not use the one in your config, that is only used the very first startup.
Please trigger setup by removing the Miele@home complete config section via the "config" tab in Config-UI-X.
On the homebridge configuration editor you mean?
{
"name": "Miele@home",
"clientID": "729ec637-4a22-4694-9f12-5e837160xxxx",
"clientSecret": "pIzmliEmaTYDCZzgu94nem2f1r7Axxxx",
"token": "DE_733dcdd4badb9804132a68b58944xxxx",
"refreshToken": "DE_2d9170f8405a2ad8171467e70c99xxxx",
"language": "de",
"pollInterval": 60,
"platform": "Miele@home"
},
the tokens were recreated 1 week before the update. Are just not so old.
Yes, remove that complete block, that will trigger the setup when you enter settings.
Please realise that when there is a token available in the persistent storage plugin database (like your log explains), the plugin will always use that one. It will not use the one in your config, that is only used the very first startup. Therefore, these tokens might not be old, but are neglected as there is already one on disk available.
A probable explanation of what happens is as follows:
ok. will set up the token again. report then
Yes please since I strongly believe every time you thought you refreshed the tokens, it actually did not and remained stuck to the database token.
It still remains a mystery though why the previous token did not auto refresh, but that could be for many reasons (server of for longer than 10min or so right at the time the token expired, or,....)
08/02/2021, 15:57:13] [Miele@home] Token loaded from persistent storage. [08/02/2021, 15:57:13] [Miele@home] Discovered device: id: 00013925xxxx, name: Trockner, model: TMV840WP [08/02/2021, 15:57:13] [Miele@home] Ignoring unsupported device. Device: "Trockner" with raw type value: 2. [08/02/2021, 15:57:13] [Miele@home] Discovered device: id: 00011912xxxx, name: Waschmaschine, model: WMV960 [08/02/2021, 15:57:13] [Miele@home] Registering new accessory: Waschmaschine
Edit:
[08/02/2021, 16:11:36] [Miele@home] 000119122xxx: Ignoring request to set device to HomeKit value 1. Miele action "Start" (1) not allowed in current device state. Allowed Miele process actions:
Have now made the settings and requested the token again. Everything has also worked wonderfully. Unfortunately, the Miele washing machine shows offline. I do not know what to do.
After 60s it should mention a poll request to get the status of your washing machine.
Could you enable debug logging via the config UI and restart Homebridge to activate it. Then you should see it polling every 60s for status. This gives me more insight why it shows offline.
The "not allowed" is there because Miele does not allow you to remote start this device. That is normal behavior.
where exactly do I enable debug?
Via UI: "Homebridge Settings" -> "debug mode". Or start Homebridge with -D
option.
Do not forget to restart Homebridge afterwards to activate it.
What exactly do you mean with "offline" as I see the plugin is correctly discovering devices.
the plugin detects my washing machine as offline although it is on and running.
I really need debug logging for that as I do not recognize that problem and my washer dryer is working fine.
What exactly is offline? In red text "unreachable" or normal text "Off"/"Aus" or really exactly "offline" (as that I have never seen in HomeKit before). Are you sure there isn't another Washing machine tile hidden somewhere and you are looking at a device from some previous homebridge install?
What is also very probable, is that your washing machine is simply not connected to internet. What does your Miele app say? If it shows there offline also, you need to fix the washing machine's connection with internet.
Hi. So now it works. I uninstalled it completely and reconfigured everything and it works now. Thanks for your effort and especially for providing the plugin.
How is it actually when I have a washing machine and a dryer that run simultaneously. Is then only one window displayed in the Homekit or are there 2?
In the upcoming version I added support for dryers. When I release it you should see a second water tap which represents your dryer.
By the way, I have not encounters a similar problem myself, but I think what you can try next time is to delete the accessory cache in homebridge settings -> advanced.
Dryer supported in latest release v2.4.0. I will close this issue for now.
First of all thank you for providing for the app. Have configured and set up the method 1. what I noticed today is that now my Miele wash does but at the homkekit app as is turned off? thanks for the help.