ekutner / home-connect-hass

Alternative (and improved) Home Connect integration for Home Assistant
MIT License
549 stars 54 forks source link

Extra Service change_setting #185

Closed Rep-Hueman closed 1 year ago

Rep-Hueman commented 1 year ago

Create a request for an extra service for adjusting various settings via scripts

change_setting:
  name: Changes a setting
  description: Changes a setting on device
  fields:
    device_id:
      description: The ID of the appliance to changes a setting on
      name: device_id
      required: true
      selector:
        device:
          integration: home_connect_alt
    key:
      name: Option key
      description: >
        The ENUM key of an option which is available for the current setting
      example: ConsumerProducts.CoffeeMaker.Setting.CupWarmer
      required: true
      selector:
        text:
    value:
      name: Option value
      description: >
        An allowed value for the specified option
      example: True
      required: true
      selector:
        text:

Describe alternatives you've considered

Just like this old integration has. https://github.com/DavidMStraub/homeassistant-homeconnect

ekutner commented 1 year ago

Good suggestion. Added in 0.6.0-b3 note that my appliance doesn't ave any settable settings so I can't fully test it

Rep-Hueman commented 1 year ago

I test it but .... get error on de Power select

select.siemens_cm876g0b6_68a40e68524c_bsh_common_setting_powerstate (not enabled)

This entity is no longer being provided by the home_connect_alt integration. If the entity is no longer in use, delete it in settings.

The power cannot turn on now..

ekutner commented 1 year ago

When adding the service I noticed that HC now sets most settings to read only, so the control is not added when it is in that state. Please check two things:

  1. Install a previous version of the integration and check if changing the power switch actually works.
  2. Test the actual service by calling it.

If #1 works then please press the Home Connect Debug button and attach your log file here

Rep-Hueman commented 1 year ago
  1. I go back to 0.6.0-b2 the switch is working now..
  2. the new service i cannot test it is in 0.6.0-b3...

the error in 0.6.0-b3 is .. Don't show controls for read only settings

ekutner commented 1 year ago

Please attach the logs of both the old and new versions after pressing the debug button

Rep-Hueman commented 1 year ago

To test the new change_setting service i manually copied the files (init.py, services.py, services.yaml) from 0.6.0-b3 to version 0.6.0-b2.

The new service works! (test with BSH.Common.Setting.ChildLock and ConsumerProducts.CoffeeMaker.Setting.CupWarmer)

I'm going to create a debug log here this afternoon if you want for de error with the power switch in 0.6.0-b3

ekutner commented 1 year ago

The service is not related to the UI controls. If it works in b2 it should also work in b3. As for the UI controls that went away in b3, I need the log, but make sure you press the Home Connect Debug button before sending it

knights1 commented 1 year ago

Can confirm that in b3 turning on appliances (eg my dishwasher) does not work.

ekutner commented 1 year ago

Doesn't work how? Did it work before? Debug log + debug button...

Rep-Hueman commented 1 year ago

UI controls that went away in b3

Log file b2 powerstate working Log file b3 powerstate not working

home-connect-hass-0.6.1-b2 home-assistant_2023-03-22T18-17-24.441Z.log home-connect-hass-0.6.1-b3 home-assistant_2023-03-22T18-29-20.819Z.log

0.6.1-b3 select.siemens_cm876g0b6_68a40e68524c_bsh_common_setting_powerstate (not enabled)

Schermafbeelding 2023-03-22 192735
ekutner commented 1 year ago

Thanks. Please add log_mode: 7 to the home_connect_alt section in configuration.yaml, restart and upload a new log for b3.

Rep-Hueman commented 1 year ago

Ok here you have the new log

home-connect-hass-0.6.1-b3 home-assistant_2023-03-22T21-51-26.512Z.log

ekutner commented 1 year ago

Thanks. I believe b4 should fix this. In particular, try to see what happens if you restart HA will a program is running, at least on my appliance the control access mode is read only so the control will be unavailable, but then it should become available when the program finishes (or at least when you select a new one).

Rep-Hueman commented 1 year ago

Yes works perfectly now with b4! I'm going to test the ovens extensively next week.

If I can test something for you, let me know.

ekutner commented 1 year ago

Great. There seems to be a new behavior where the access mode to Settings is changing back and forth from read-only to read-write. I want to make sure these changes are properly captured by the integration. The expected behavior is that Settings change their state to "unavailable" when they are in read only mode and become available again when they are in read-write mode. If you restart HA while a setting is in read-only mode a HA entity will NOT be created for it, which means it needs to be created after it changes to read-write. These scenarios need to be tested.