Home Connect - automate start of washing cycle?

We have a Bosch washing machine connected to HA using Home Connect integration. In my Smart Home Nirvana I’d like to be able to load the machine, configure the cycle and enable Remote Control. Home Assistant should then start the washer when the price of electricity drops below a certain level.
I haven’t found a way to do this with the Home Connect integration! I can start the machine but it requires me to use any of the switch.tvattmaskin_program_* (tvattmaskin = Washing Machine) Controls that the integration generates, making it hard to automate.
There is a generic switch.tvattmaskin_power that I thought would work the way I want - i.e. just start the cycle - but that doesn’t do anything.

Have anyone managed to get an automation running this way with Home Connect?

Washer is a Bosch WAYH32I9SN.

I believe you need to use the put commands from the API.
If you open the developer tab where you created the API integration with HA on home connect page then there is a place where you can test API calls.

Look at the different endpoints there and see if there is one for starting the machine. I believe there is but I have never tried/used it.

EDIT:

There it is:

I believe these switches should actually have been sensors or binary sensors in the integration. It makes no sense that they are switches

1 Like

Thank you for your response. I have quickly read through the documentation and I can’t see a “just start” api call to simply start with the settings on the machine. All commands seems to require a LaundryCare.Washer.Program.* parameter.
Hmmm… I guess I have to set up different automations and arm them using a helper in HA…?

I believe the first issue is the communication with the API.
Do you have Node red installed, because either you have to create own API calls to get new bearer code or you can just use what the integration gives you, but that requires Node red.

Giving it some more thoughts I can see why Home Connect doesn’t allow me to do what I want. Basically I would like to:

  1. Load the machine
  2. Config the cycle settings
  3. Enable remote control
  4. Allow HA to start with the cycle settings

The flaw I can see is that someone may alter the settings on the machine between 3 and 4 so our delicate wool clothes would run in a 90° Cotton cycle…

There are endpoints to set the temperature and other settings also.

You could just “save” the settings when you enable the self start boolean (as I envision it) and before you start the machine then you just send these settings again to make sure it’s correct.

I just managed to change the program with this:

{
  "data": {
    "key": "LaundryCare.Washer.Program.Cotton",
    "options": [
      {
        "key": "LaundryCare.Washer.Option.SpinSpeed",
        "value": "LaundryCare.Washer.EnumType.SpinSpeed.RPM1400",
        "name": "Spin Speed",
        "displayvalue": "1400 rpm"
      },
      {
        "key": "LaundryCare.Washer.Option.Temperature",
        "value": "LaundryCare.Washer.EnumType.Temperature.GC60",
        "name": "Temperature",
        "displayvalue": "60°C"
      }
    ],
    "name": "Cotton"
  }
}

You can get the current selected program with the endpoint: GET /homeappliances/{haId}/programs/selected Get the program which is currently selected the you need to trim away everything else than what I have in the code block above to select a temperature.

Great ideas - Thank You!
Will see how I’ll implement this. I work as a software developer but HA’s automations have been a mystery from day one and NodeRED seems to be where everybody is moving for complex stuff.
I have some automations written in PHP running on a separate server that HA starts using REST calls and I guess I’ll implement this in the same way.

Many thanks and I wish you a happy new year!

I highly advice you to install Node red, because then this can all be working within a few minutes.
I have working sequences that can communicate with Home connect.

I don’t know for sure if we talking about the same but have look at this where Rep-Hueman commited.
Maybe this can help you.

I just browsed through the request and it seems to ask about something else.
Namely not controlling the machine but checking the progress of a running machine.

Since I was on my way I quickly read through the article, but now that I have some more time I see what you mean.

Hi Mattias, I know this is a rather old thread but I have been thinking about the same solution: turn on the washing machine, load it and then turn on remote control/start to start the program when the solar panels provide enough electricity. To actually start the desired program you can use the switches that are entities of the device. So to start the Auto 30 program I would switch switch.wasmachine_program_auto30 to On. So there is no default start option. Only the switches to start a specific program. BTW I haven’t figured out how to set the temperature of the programs without a specific temperature setting so I can’t help you with that.

Hey Jeroen,

Does this mean you have successfully started a washing cycle? Could you share the logic? A node red snippet would be greatly appreciated.