DavidMStraub / homeassistant-homeconnect

Custom component for Home Assistant to connect appliances supporting the Home Connect standard
MIT License
117 stars 29 forks source link

remote_control_active and remote_control_start_allowed missing from Home Connect #99

Closed badguy99 closed 3 years ago

badguy99 commented 4 years ago

Partner issue to https://github.com/home-assistant/core/issues/38228

To add remote_control_active and remote_control_start_allowed sensors or switches.

I did have a look at the code to see if I could work out where to add it in and raise a pull request, but it was too complicated for me.

DavidMStraub commented 4 years ago

It's actually not complicated! If you want to give it a shot:

zufivan commented 4 years ago

Hi all, someone can help me? I will try to have device attributes but I didn't understand how to configure, for me is good to have more sensor… Following some question:

  1. In wich file I need to add “device_state_attributes” for “ HomeConnectPowerSwitch”?
  2. On const.py I add this: (is it ok?) BSH_START_ALLOWED = "BSH.Common.Status.RemoteControlStartAllowed"
  3. How I can take Take the values of them from the status dictionary Many thanks Ivan
badguy99 commented 4 years ago

I'm looking at this at the moment, but looking at the Home Connect docs, a different list of devices support remote control active status Vs remote control start allowed state, and I'm trying to cover all devices. I am thinking, as they are states, so read only items, not set-able, they may be best as sensors rather than switches, or switch attributes.

DavidMStraub commented 4 years ago

According to the docs, it's a boolean state, so it has to be a binary sensor, not a sensor (and certainly not a switch).

There need to be two binary sensors: one for BSH.Common.Status.RemoteControlStartAllowed and one for BSH.Common.Status.RemoteControlActive. It has to be set on each child class of HomeConnectDevice which one of the sensors is present and then handled in the get_entity_info method such that the sensors can be created in binary_sensor.py. Probably best to rename HomeConnectBinarySensor to HomeConnectDoorBinarySensor and have a new child class for the two new sensors.

zufivan commented 4 years ago

Hi David, Thanks for your answer, but I'm not a developer, is too complicate for me. Regards Ivan

quinten94b commented 4 years ago

Hi David,

I'm kind of in the same situation as zufivan. Is it possible to add the remote_control_active and allow status back in the home connect beta integration or even the core home connect integration? Or point me in a way to do it myself, since higher programming languages are not my strongest skill.

My goal is to control/start appliances like a dishwasher, washingmachine, ... on solar power. When my solar panels produce enough energy or a battery is full enough to carry the load of the appliances. Without the smart control status, I have to toggle a manual input_bool in HA every time I activate smart control, to simulate smart control.

Best regards, Quinten

DavidMStraub commented 4 years ago

I don't know if I'll have time for this, but if you want to give it a shot, here is how you could do it:

Feel free to submit a work-in-progress PR along these lines, then I can help pointing you in the right direction.

quinten94b commented 4 years ago

Hi David,

I would love to do that, I allready tried for messing around with other integrations but I'm really lost with higher programming languages. Ask me anything about automation and building up a logic control in a low level language (PLC). But messing around in an API, working with python is like trying to read chinees.

badguy99 commented 3 years ago

I'm still thinking about this. But I'm also snowed under with the day job. Realistically I probably won't get to look at this properly for a while - probably until next year. Having said that, if it is still open next year, work have said they want to give us time for a hackathon again, so I might then get a week to work on it, instead of the day job...

badguy99 commented 3 years ago

Finally got the hackathon day at work - I've put up https://github.com/home-assistant/core/pull/45610 for review.