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

Get Actions for Miele devices #232

Open
thetrebor opened this issue Mar 3, 2023 · 6 comments
Open

Get Actions for Miele devices #232

thetrebor opened this issue Mar 3, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@thetrebor
Copy link

Feature request

So if i'm reading the docs properly you can pass in a device ID to the /actions and /programs GET apis and get a list of the device programs which you would need for making custom cards. It's frustratingly hard to get this data outside of HASS but i can't seem to nudge the python scripts in the plugin to let me just do an authenticated GET

curl -X 'GET'
'https://api.mcs3.miele.com/v1/devices/000176461151/programs'
-H 'accept: application/json'

Would it be possible to add to the Services dropdown the ability to just do this GET on an ID so we can see the programs that are available on each device?

What version of the integration are you using?

miele-0-1-9

Anything in the logs that might be useful for us?

No response

Additional information

No response

@thetrebor thetrebor added the enhancement New feature or request label Mar 3, 2023
@thetrebor
Copy link
Author

i'm guessing we just need to add an option to set this entry to another endpoint like "programs":

        async with async_timeout.timeout(API_READ_TIMEOUT):
            res = await miele_api.request(
                "GET",
                f"/devices/{serial}/actions",
                agent_suffix=f"Miele for Home Assistant/{VERSION}",
            )

but there's so much configuration interdiction and constant swapping that im really not sure what the right spot is to inject the intent to talk to a different end point.

@astrandb
Copy link
Owner

astrandb commented Mar 4, 2023

If you look in the diagnostic download for your devices you can see if anything useful is reported on the /programs endpoint. Please test with the device in different states, such as power on, power off, delayed start enabled etc.
Personally I don't have access to any devices with program features so I cannot do any testing myself.
When I did my initial research I noted that the implementation in the API was not very consequent, to say the least.
If you can find out what and when the API reports reliably, we can have a discussion how to use that information in the integration.
There is no more documentation from Miele on this topic than what is published on their developer pages. I have asked...

@thetrebor
Copy link
Author

Yeah it appears the programs end point just returns [] or a 500 error.
The diagnostics similarly.

"programs": {
      "httpStatus": 500
    },
"programs": [],
{
        "appliance": "Microwave combination oven",
        "key": "stateProgramId",
        "raw": 0,
        "localized": ""
      },
      {
        "appliance": "Microwave combination oven",
        "key": "stateProgramType",
        "raw": 0,
        "localized": "Program"
      },
      {
        "appliance": "Microwave combination oven",
        "key": "stateProgramPhase",
        "raw": 0,
        "localized": ""
      },

and the logs are not helpful in that they don't display the ID used, just that one was used.

so is the only way to reverse engineer this to feed it program ids one at a time and see what it does?

@thetrebor
Copy link
Author

just to follow up I have a ticket in with Miele about the chaotic API responses. they're responding, but slowly

@ncd7
Copy link

ncd7 commented Aug 19, 2023

Any news on this? I'd be interested in doing that for dishwasher programs. The Google Home integration does show all possible programs in a bullet list so it must be available. Not sure if it would be different for microwaves vs dishwashers.
P.S. I have to say massive thank you to @astrandb because his integration is working SO reliably and really well!!

@AlexCherrypi
Copy link

I also would really appreciate this.
I would love to be able to select the program, temperature, TwinDos setting, max spinning speed, starting time etc. for my Miele washing machine.
I would love to completely ditch the miele app in favor of having everything accessible via homeassistant.

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

No branches or pull requests

4 participants