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

Howto start dishwasher #181

Open
Marcelh1 opened this issue Dec 29, 2024 · 20 comments
Open

Howto start dishwasher #181

Marcelh1 opened this issue Dec 29, 2024 · 20 comments

Comments

@Marcelh1
Copy link

Marcelh1 commented Dec 29, 2024

Any instruction how to start dishwasher is more than welcome :)
I know where to find "ConnectLife: Set value", but which entity to set? If I set any sensor value I get an error:

Actie connectlife.set_value kon niet worden uitgevoerd. Unknown error

@oyvindwe
Copy link
Owner

Due to safety regulations, you can only remote start appliances after enabling remote start physically on the appliance for each run.

Which property to set depends on the model. I haven't bothered to figure out that on my own dishwasher.

@Marcelh1
Copy link
Author

Marcelh1 commented Dec 29, 2024

Yes I know, since I also have the connectlife App. How will I be able to figure out what I need to do te perform a remote start? Or more easy to begin with, how can I enable the "child lock"?

action: connectlife.set_value
target:
  entity_id: sensor.vaatwasser_child_lock
data:
  value: 2

@oyvindwe
Copy link
Owner

I'd say you are on the right track. I'm not sure why you get that error message.

Which device is you dishwasher? In the mapping file, you can try to make the property a switch, e.g. if the property name is Child_lock, and "off" value is 1:

- property: Child_lock
  unavailable: 0
  switch:
    "off": 1
    "on": 2

Some devices have write-only properties to set state. You can also try:

- property: Child_lock
  unavailable: 0
  switch:
    "off": 1
    "on": 2
    command:
      name: Child_lock_cmd
      adjust: 1              # This will send 0 to disable and 1 to enable - remove to send 1 to disable and 2 to enable

@Marcelh1
Copy link
Author

Marcelh1 commented Jan 2, 2025

It works, thanks. It seems I needed to create: "015-dishwasher-60.3.yaml" for this. I can confirm I can change child lock with the switch, but it also reads back state from machine itself.

Now I will see if there is a way to remote start the machine. Which entity is used for this? When I remote start the machine from the App, these entities are updated:

Dishwasher Current program phase gewijzigd in Main wash
Dishwasher Device status gewijzigd in Running

I tryed changing these values, also played around with the Remote_control_monitoring_set_commands and Remote_control_monitoring_set_commands_actions. Also I tried with "Device status". No luck till now...

@oyvindwe
Copy link
Owner

oyvindwe commented Jan 2, 2025

Did you have to set using Child_lock_cmd?

For remote start - are you able to figure out which property changes when enabling remote start on the dishwasher?

@Marcelh1
Copy link
Author

Marcelh1 commented Jan 2, 2025

Yes, I needed to use Child_lock_cmd. When I enable remote start on the dishwasher and close the door, these settings change:

From:

sensor.vaatwasser_device_status = idle
sensor.vaatwasser_remote_control_monitoring_set_commands = 2
sensor.vaatwasser_remote_control_monitoring_set_commands_actions = 1
sensor.vaatwasser_current_program_phase = program_not_selected

To:

sensor.vaatwasser_device_status = idle
sensor.vaatwasser_remote_control_monitoring_set_commands = 2
sensor.vaatwasser_remote_control_monitoring_set_commands_actions = 2
sensor.vaatwasser_current_program_phase = program_selected

After a minute or so when not doing anything:
sensor.vaatwasser_current_program_phase = program_not_selected

Then, when I start the machine from the App:

sensor.vaatwasser_device_status = running
sensor.vaatwasser_current_program_phase = pre-wash

It seems the entity to really start the machine is not here?

@oyvindwe
Copy link
Owner

oyvindwe commented Jan 2, 2025

The _cmd properties are not listed in responses, so it could be another one of those.

Have you tried to set Device_status or Device_status_cmd to 2?

You could also install https://mitmproxy.org/, point your mobile phone to use that and inspect the traffic from the app. I haven't done this myself, but i found this how-to when using iPhone and Mac.

@Marcelh1
Copy link
Author

Marcelh1 commented Jan 2, 2025

Have you tried to set Device_status or Device_status_cmd to 2?

Yes, doesn't work. Will see if I can check with proxy...

@Marcelh1
Copy link
Author

Marcelh1 commented Jan 3, 2025

I have installed https://mitmproxy.org/, it also works since I'm able to see the traffic from my App, but I'm not sure to which messages to look at, besides it looks encoded.

@oyvindwe
Copy link
Owner

oyvindwe commented Jan 3, 2025

I installed mitmproxy myself, and it looks like the app does not connect to the same endpoints as the integration, but goes through Tuya. The request and response is Base64 encoded, but it seems to also be encrypted - see discussion here: https://gist.github.com/bahorn/160b4143badd1b6fae61cec629fce339

I have no idea on how to extract the encryption key elements from the app.

@oyvindwe
Copy link
Owner

oyvindwe commented Jan 3, 2025

I figured out how to start and stop my dishwasher!

  • Property Actions
  • Values:
    • 0: none
    • 1: stop
    • 2: start
    • 3: pause
    • 4: open_door

pause and open_door do not work on my model, even though it opens the door at the end of drying phase.

I'm not sure how to expose this in a good way in HA though. This is a write-only property, so adding it to the mapping file doesn't really work. Also, it should only be enabled when remote start is enabled.

I hacked it in as a hard coded select entity to be able to play with it, but it is probably better to set these values using a service?

@Marcelh1
Copy link
Author

Marcelh1 commented Jan 4, 2025

That is great news! Yes I think a service makes most sense. Looking forward to implementation :)

Also, it should only be enabled when remote start is enabled.

Problaby nothing really happens if you would call this service without having remote start enabled?

@Monacoslo
Copy link

you can play with my hood too. I would be happy if I can control fan and light from HA (to use in automations). It does not require remote start enabled

@oyvindwe
Copy link
Owner

oyvindwe commented Jan 7, 2025

Problaby nothing really happens if you would call this service without having remote start enabled?

I haven't tried yet. Might get an error response, but I don't think it will break anything.

you can play with my hood too

For the hood you can try the set_value action (formerly service) on some of these sensors:

  • ActiveModeMotorLevel - try 0, 1, 2, 3, 4
  • ActiveModeMotorLevelSetting - try 0 (off) and 1 (on)
  • ActiveModeSetting - try 0 (inactive) and 1 (active)

I'm not sure if this should be an integration service action, entity service action or device action. Conceptually, device action looks like the best fit. Then it is also possible to define the action programatically, avoiding having to specify all variant of such services in services.yaml. The drawback is that when I tried this, I was not able to select the action in the developer tools action page.

I will be travelling most of the next 3 weeks, so unfortunately I won't have much time to work on this until after that.

@Marcelh1
Copy link
Author

Marcelh1 commented Jan 7, 2025

Thanks for the effort! Can you (in the meantime) perhaps share how you hardcoded this for testing?

@oyvindwe
Copy link
Owner

oyvindwe commented Jan 7, 2025

I made an attempt on implementing an integration service action set_action - see PR #183

The action can be called on any ConnectLife device.

The options are hard coded in services.yaml. I'm not sure if this is a good idea or not, and I haven't figured out how to add translation strings for the options.

@TheSimpleZ
Copy link
Contributor

TheSimpleZ commented Jan 11, 2025

This is amazing! I also tried it on my dishwasher with the same result as you, start/stop works. The other commands seem to do nothing. Now the only thing left for me to figure out is how to choose a program/mode and I'll be able to start my dishwasher automatically when the electricity price is low.

Random suggestion:
It would be nice if the start/stop/pause commands were exposed as buttons.
You could combine the door open/close status and the open_door command into a cover entity and set the device class to door.

I don't know if that would make things easier or harder for you, but it feels more natural to me to have buttons/entities for these commands rather than an action.

@Marcelh1
Copy link
Author

Marcelh1 commented Jan 11, 2025

I'm not sure about buttons, problably it really complicates.

In the meantime I was able to setup an automation which is checking the "remote start enabled" property (condition) when the door is being closed (trigger), then it calculates a delayed start time based on solar forecast (https://forecast.solar) taking into account the orientation of my solar panels, but it also makes sure it doesn't start later than specific time to ensure the dishwasher finishes before 18:00. The only thing I need to do in the morning is just enable "remote start enabled" and close the door 👍 HA will do the rest and will sent me notifications.

@oyvindwe
Copy link
Owner

It would be nice if the start/stop/pause commands were exposed as buttons.
You could combine the door open/close status and the open_door command into a cover entity and set the device class to door.

It is a bit complicated to add support for entities that combines more than one property in this integration. The mapping file framework have to be updated with support for cover entities, including link to the set_action service.

I have just merged PR #183, but it is only experimental for now, as it is available for any device, but the Actions property is hard coded, as well as the list of options presented on the Developer Tools -> Actions page. The service itself will accept any integer as a value.

For experimenting, I wonder if I should add a service to send a arbitrary set of key/values on any device.

@TheSimpleZ
Copy link
Contributor

It is a bit complicated to add support for entities that combines more than one property in this integration.

Understandable.

The mapping file framework have to be updated with support for cover entities, including link to the set_action service.

Great, thanks!

For experimenting, I wonder if I should add a service to send a arbitrary set of key/values on any device.

That would be very nice! Please do.

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

No branches or pull requests

4 participants