Home Assistant Community

Home Connect: alpha testers wanted

#1

Following up on this thread, I shared an early preview of the Home Connect integration. The main purpose of sharing this is to get feedback from people brave enough to try it out with their real-life appliances. I played around quite a bit with the API simulator but it has its quirks.

So, if you are willing to help, please have a look at the Github repository and give it a try. Please use this thread to report success and the repository’s issues to report problems or to make suggestions. Pull requests are welcome!

6 Likes
Home Connect
#2

Hi,

I’ve been using IFTTT for my Washing machine and Dryer but since that lacks a lot of information I really appreciate this!
I just tested your code and the integration registration(oauth process) works flawless and my initial tests with my dryer seems OK. I will run more test later.
Of course this is alpha but if your device is offline when you start HA it will throw errors in the log:

2018-12-04 15:55:48 ERROR (SyncWorker_15) [custom_components.homeconnect] Error while executing <bound method HomeConnectAppliance.get_status of HomeConnectAppliance(hc, haId='SIEMENS-WT4HW569DN-************', vib='WT4HW569DN', brand='Siemens', type='Dryer', name='Dryer', enumber='WT4HW569DN/03', connected=False)>. Retry #1
2018-12-04 15:55:48 ERROR (SyncWorker_15) [custom_components.homeconnect] <bound method HomeConnectAppliance.get_status of HomeConnectAppliance(hc, haId='SIEMENS-WT4HW569DN-************', vib='WT4HW569DN', brand='Siemens', type='Dryer', name='Dryer', enumber='WT4HW569DN/03', connected=False)> {'key': 'SDK.Error.HomeAppliance.Connection.Initialization.Failed', 'description': 'HomeAppliance is offline'}
2018-12-04 15:55:48 ERROR (SyncWorker_15) [custom_components.homeconnect] <bound method HomeConnectAppliance.get_programs_active of HomeConnectAppliance(hc, haId='SIEMENS-WT4HW569DN-************', vib='WT4HW569DN', brand='Siemens', type='Dryer', name='Dryer', enumber='WT4HW569DN/03', connected=False)> {'key': 'SDK.Error.HomeAppliance.Connection.Initialization.Failed', 'description': 'HomeAppliance is offline'}
2018-12-04 15:55:48 ERROR (SyncWorker_15) [custom_components.homeconnect] Error while executing <bound method HomeConnectAppliance.get_programs_active of HomeConnectAppliance(hc, haId='SIEMENS-WT4HW569DN-************', vib='WT4HW569DN', brand='Siemens', type='Dryer', name='Dryer', enumber='WT4HW569DN/03', connected=False)>. Retry #1
2018-12-04 15:55:48 ERROR (SyncWorker_15) [custom_components.homeconnect] <bound method HomeConnectAppliance.get_programs_active of HomeConnectAppliance(hc, haId='SIEMENS-WT4HW569DN-************', vib='WT4HW569DN', brand='Siemens', type='Dryer', name='Dryer', enumber='WT4HW569DN/03', connected=False)> {'key': 'SDK.Error.HomeAppliance.Connection.Initialization.Failed', 'description': 'HomeAppliance is offline'}

It also throws error on the Washer on HA startup even thou it was online. Looks like because there is no active program.

2018-12-04 15:55:50 ERROR (SyncWorker_15) [custom_components.homeconnect] Error while executing <bound method HomeConnectAppliance.get_programs_active of HomeConnectAppliance(hc, haId='SIEMENS-WMH6W649DN-68A40E060F58', vib='WMH6W649DN', brand='Siemens', type='Washer', name='Washing machine', enumber='WMH6W649DN/09', connected=True)>. Retry #1
2018-12-04 15:55:50 ERROR (SyncWorker_15) [custom_components.homeconnect] <bound method HomeConnectAppliance.get_programs_active of HomeConnectAppliance(hc, haId='SIEMENS-WMH6W649DN-*********', vib='WMH6W649DN', brand='Siemens', type='Washer', name='Washing machine', enumber='WMH6W649DN/09', connected=True)> {'key': 'SDK.Error.NoProgramActive', 'description': 'There is no program active'}

Some other feedback.
It looks like it creates one entity per program. It would be nice to see a “program” entity and update it according to running program.
It looks like it write to logs and updates all entities on one entity change. For example if I open the door all entities gets updated even though they where not changed.

Really great work so far and I’m happy to see the progress! Keep it up!

#3

Hi!

First of all, congratulations!

Today I configured the Home Connect plugging with some appreciations. I’m running HA 0.81.6 with python 3.6.

The HA log file is blowing up with this errors, similar as shown in latest post.

2018-12-04 17:18:59 ERROR (SyncWorker_0) [custom_components.homeconnect] <bound method HomeConnectAppliance.get_programs_active of HomeConnectAppliance(hc, haId='BOSCH-SMV88TX26E-68A40E014D9B', vib='SMV88TX26E', brand='Bosch', type='Dishwasher', name='Lavavajillas', enumber='SMV88TX26E/17', connected=True)> {'key': 'SDK.Error.NoProgramActive', 'description': 'There is no program active'}
2018-12-04 17:18:59 ERROR (SyncWorker_0) [custom_components.homeconnect] Error while executing <bound method HomeConnectAppliance.get_programs_active of HomeConnectAppliance(hc, haId='BOSCH-SMV88TX26E-68A40E014D9B', vib='SMV88TX26E', brand='Bosch', type='Dishwasher', name='Lavavajillas', enumber='SMV88TX26E/17', connected=True)>. Retry #1
2018-12-04 17:18:59 ERROR (SyncWorker_0) [custom_components.homeconnect] <bound method HomeConnectAppliance.get_programs_active of HomeConnectAppliance(hc, haId='BOSCH-SMV88TX26E-68A40E014D9B', vib='SMV88TX26E', brand='Bosch', type='Dishwasher', name='Lavavajillas', enumber='SMV88TX26E/17', connected=True)> {'key': 'SDK.Error.NoProgramActive', 'description': 'There is no program active'}
2018-12-04 17:19:00 ERROR (SyncWorker_0) [custom_components.homeconnect] <bound method HomeConnectAppliance.get_status of HomeConnectAppliance(hc, haId='BOSCH-WAYH890ES-68A40E0432F0', vib='WAYH890ES', brand='Bosch', type='Washer', name='Lavadora', enumber='WAYH890ES/09', connected=False)> {'key': 'SDK.Error.HomeAppliance.Connection.Initialization.Failed', 'description': 'HomeAppliance is offline'}
2018-12-04 17:19:00 ERROR (SyncWorker_0) [custom_components.homeconnect] Error while executing <bound method HomeConnectAppliance.get_status of HomeConnectAppliance(hc, haId='BOSCH-WAYH890ES-68A40E0432F0', vib='WAYH890ES', brand='Bosch', type='Washer', name='Lavadora', enumber='WAYH890ES/09', connected=False)>. Retry #1
2018-12-04 17:19:00 ERROR (SyncWorker_0) [custom_components.homeconnect] <bound method HomeConnectAppliance.get_status of HomeConnectAppliance(hc, haId='BOSCH-WAYH890ES-68A40E0432F0', vib='WAYH890ES', brand='Bosch', type='Washer', name='Lavadora', enumber='WAYH890ES/09', connected=False)> {'key': 'SDK.Error.HomeAppliance.Connection.Initialization.Failed', 'description': 'HomeAppliance is offline'}
2018-12-04 17:19:00 ERROR (SyncWorker_0) [custom_components.homeconnect] <bound method HomeConnectAppliance.get_programs_active of HomeConnectAppliance(hc, haId='BOSCH-WAYH890ES-68A40E0432F0', vib='WAYH890ES', brand='Bosch', type='Washer', name='Lavadora', enumber='WAYH890ES/09', connected=False)> {'key': 'SDK.Error.HomeAppliance.Connection.Initialization.Failed', 'description': 'HomeAppliance is offline'}
2018-12-04 17:19:00 ERROR (SyncWorker_0) [custom_components.homeconnect] Error while executing <bound method HomeConnectAppliance.get_programs_active of HomeConnectAppliance(hc, haId='BOSCH-WAYH890ES-68A40E0432F0', vib='WAYH890ES', brand='Bosch', type='Washer', name='Lavadora', enumber='WAYH890ES/09', connected=False)>. Retry #1
2018-12-04 17:19:00 ERROR (SyncWorker_0) [custom_components.homeconnect] <bound method HomeConnectAppliance.get_programs_active of HomeConnectAppliance(hc, haId='BOSCH-WAYH890ES-68A40E0432F0', vib='WAYH890ES', brand='Bosch', type='Washer', name='Lavadora', enumber='WAYH890ES/09', connected=False)> {'key': 'SDK.Error.HomeAppliance.Connection.Initialization.Failed', 'description': 'HomeAppliance is offline'}
2018-12-04 17:19:07 WARNING (MainThread) [homeassistant.setup] Setup of homeconnect is taking over 10 seconds.
#4

Thanks for the feedback and the kind words.

Indeed these errors should be silenced as this is normal behaviour. In general at the moment the component is much too verbose in the log and I should start to tone it down.

It looks like it creates one entity per program. It would be nice to see a “program” entity and update it according to running program.

Indeed the logic of the API is: 1. select program 2. start program. So at first I tried to implement it like that. The trouble is that HA doesn’t allow components to create input_select entities programmatically (at leat I didn’t find out how), so this would only work by making the program selection a service and having the user manually add an input_select and an automation calling this service. That didn’t seem very user friendly.

In principle one could indeed add an additional sensor with a string value holding the name of the currently running program, but it would just contain the name of the switch that is currently ‘on’. So it seems a bit redundant, no? Anyway it could also be straightforwardly added manually with a template sensor.

It looks like it write to logs and updates all entities on one entity change. For example if I open the door all entities gets updated even though they where not changed.

The fact that this shows up in the logs as warnings is of course something that should disappear as well. But internally, that’s indeed what it does; but it does not lead to additional API calls or increased CPU usage. Basically it works like this: For each appliance, there is a separate thread listening to server-sent events from the API notifying of state changes. If a new event is received, all the information contained in it is cached in memory; then HA is instructed to update all the entities associated to this appliance, using the cached event information (that may contain updates on multiple entities). It is precisely the entities’ update methods that determine whether the event changed anything about this entity.

#5

For controlling the machines a input_select would be useful as you say but to fetch the status it would be nice with a machine.status sensor that would contain the running program or other state. It could also have other attributes like temperature and progress state gathered in one entity.

I’ve done some more tests now and this is what I found so far.

  1. Washing machine door gets the state “unavailable” when program starts and the door gets locked.
[custom_components.homeconnect] {'BSH.Common.Status.RemoteControlActive': {'timestamp': 1544003308, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WMH6W649DN-************/status/BSH.Common.Status.RemoteControlActive', 'value': True, 'level': 'hint'}, 'BSH.Common.Status.LocalControlActive': {'timestamp': 1544003308, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WMH6W649DN-*******/status/BSH.Common.Status.LocalControlActive', 'value': False, 'level': 'hint'}, 'BSH.Common.Status.OperationState': {'timestamp': 1544003307, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WMH6W649DN-************/status/BSH.Common.Status.OperationState', 'value': 'BSH.Common.EnumType.OperationState.Run', 'level': 'hint'}, 'BSH.Common.Status.DoorState': {'timestamp': 1544003307, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WMH6W649DN-************/status/BSH.Common.Status.DoorState', 'value': 'BSH.Common.EnumType.DoorState.Locked', 'level': 'hint'}, 'BSH.Common.Status.RemoteControlStartAllowed': {'value': False}, 'LaundryCare.Washer.Option.Temperature': {'timestamp': 1544003180, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WMH6W649DN-************/programs/selected/LaundryCare.Washer.Option.Temperature', 'value': 'LaundryCare.Washer.EnumType.Temperature.GC40', 'level': 'hint'}, 'BSH.Common.Root.ActiveProgram': {'timestamp': 1544003186, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WMH6W649DN-************/programs/active', 'value': 'LaundryCare.Washer.Program.Cotton', 'level': 'hint'}, 'BSH.Common.Option.RemainingProgramTime': {'timestamp': 1544003547, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WMH6W649DN-************/programs/active/BSH.Common.Option.RemainingProgramTime', 'unit': 'seconds', 'value': 9300, 'level': 'hint'}, 'BSH.Common.Option.ProgramProgress': {'timestamp': 1544003547, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WMH6W649DN-************/programs/active/BSH.Common.Option.ProgramProgress', 'unit': '%', 'value': 3, 'level': 'hint'}}
  1. The program process in “unavailable” if there is no program running or if the process is below 1%. Should be 0% or off.
  2. Remaining progress time will stay as the last updated value even thou there is no program running.

Hope this helps. Keep it up!

#6

Also the dryer program process does not work. Stays as unavailable. It doesnt seem to be included in the json received from the API so thats most likely the reason.

[custom_components.homeconnect] {'BSH.Common.Status.RemoteControlActive': {'timestamp': 1544014011, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WT4HW569DN-************/status/BSH.Common.Status.RemoteControlActive', 'value': True, 'level': 'hint'}, 'BSH.Common.Status.LocalControlActive': {'timestamp': 1544014011, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WT4HW569DN-************/status/BSH.Common.Status.LocalControlActive', 'value': False, 'level': 'hint'}, 'BSH.Common.Status.OperationState': {'timestamp': 1544014007, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WT4HW569DN-************/status/BSH.Common.Status.OperationState', 'value': 'BSH.Common.EnumType.OperationState.Run', 'level': 'hint'}, 'BSH.Common.Root.ActiveProgram': {'timestamp': 1544014007, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WT4HW569DN-************/programs/active', 'value': 'LaundryCare.Dryer.Program.Cotton', 'level': 'hint'}, 'BSH.Common.Option.RemainingProgramTime': {'timestamp': 1544015452, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WT4HW569DN-************/programs/active/BSH.Common.Option.RemainingProgramTime', 'unit': 'seconds', 'value': 11100, 'level': 'hint'}, 'BSH.Common.Status.DoorState': {'timestamp': 1544014005, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WT4HW569DN-************/status/BSH.Common.Status.DoorState', 'value': 'BSH.Common.EnumType.DoorState.Closed', 'level': 'hint'}, 'BSH.Common.Root.SelectedProgram': {'timestamp': 1544001935, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WT4HW569DN-************/programs/selected', 'value': 'LaundryCare.Dryer.Program.Cotton', 'level': 'hint'}, 'LaundryCare.Dryer.Option.DryingTarget': {'timestamp': 1544001936, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WT4HW569DN-************/programs/selected/LaundryCare.Dryer.Option.DryingTarget', 'value': 'LaundryCare.Dryer.EnumType.DryingTarget.CupboardDryPlus', 'level': 'hint'}, 'BSH.Common.Status.RemoteControlStartAllowed': {'timestamp': 1544001933, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WT4HW569DN-************/status/BSH.Common.Status.RemoteControlStartAllowed', 'value': False, 'level': 'hint'}}
1 Like
#8

I have the same issue with the Siemens WT4H8Y78NL Dryer. RemainingProgramTime and progress is not included in the json.

#9

The RemainingProgramTime is actually included for me(see above) but for example my Washing machine have ProgramProcess in the json. See below.

'BSH.Common.Option.ProgramProgress': {'timestamp': 1544015465, 'handling': 'none', 'uri': '/api/homeappliances/SIEMENS-WMH6W649DN-68A40E060F58/programs/active/BSH.Common.Option.ProgramProgress', 'unit': '%', 'value': 15, 'level': 'hint'},
#10

This is what I get back from the API.

{‘BSH.Common.Status.OperationState’: {‘timestamp’: 1544012180, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/status/BSH.Common.Status.OperationState’, ‘value’: ‘BSH.Common.EnumType.OperationState.Run’, ‘level’: ‘hint’}, ‘BSH.Common.Status.DoorState’: {‘timestamp’: 1544012076, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/status/BSH.Common.Status.DoorState’, ‘value’: ‘BSH.Common.EnumType.DoorState.Closed’, ‘level’: ‘hint’}, ‘BSH.Common.Status.RemoteControlStartAllowed’: {‘timestamp’: 1544012172, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/status/BSH.Common.Status.RemoteControlStartAllowed’, ‘value’: True, ‘level’: ‘hint’}, ‘BSH.Common.Status.RemoteControlActive’: {‘timestamp’: 1544012081, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/status/BSH.Common.Status.RemoteControlActive’, ‘value’: True, ‘level’: ‘hint’}, ‘BSH.Common.Status.LocalControlActive’: {‘timestamp’: 1544012081, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/status/BSH.Common.Status.LocalControlActive’, ‘value’: False, ‘level’: ‘hint’}, ‘BSH.Common.Root.ActiveProgram’: {‘timestamp’: 1544012179, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/programs/active’, ‘value’: ‘LaundryCare.Dryer.Program.Cotton’, ‘level’: ‘hint’}}

#11

So it looks like different machines supports different level of information.

#12

Yes, looks like it. But the Home Connect app does show both Remaining time and a progress bar. So the model I use should support it.

#13

Yeah thats interesting. Not sure if that needs to be specified when subscribing for callbacks but I guess @DavidMStraub can answer that one.

1 Like
#14

Hmm, wierd. when I start the dryer with the Home Connect App. I do get the RemainingProgramTime and ProgramProgress data back from the API in Hass. Looks like both of those items don’t get returned every update we get from the API. For me it took a few minutes till I got all of the data.

2018-12-05 13:59:21 WARNING (Thread-15) [custom_components.homeconnect] Update triggered on Droger
2018-12-05 13:59:21 WARNING (Thread-15) [custom_components.homeconnect] [<Entity Droger Door: off>, <Entity Droger Remaining Program Time: 7260>, <Entity Droger Program Progress: None>, <Entity Droger Program Cotton: on>, <Entity Droger Program Synthetic: off>, <Entity Droger Program Mix: off>]
2018-12-05 13:59:21 WARNING (Thread-15) [custom_components.homeconnect] {‘BSH.Common.Status.OperationState’: {‘timestamp’: 1544018178, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/status/BSH.Common.Status.OperationState’, ‘value’: ‘BSH.Common.EnumType.OperationState.Run’, ‘level’: ‘hint’}, ‘BSH.Common.Status.DoorState’: {‘value’: ‘BSH.Common.EnumType.DoorState.Closed’}, ‘BSH.Common.Status.RemoteControlStartAllowed’: {‘value’: True}, ‘BSH.Common.Status.RemoteControlActive’: {‘value’: True}, ‘BSH.Common.Status.LocalControlActive’: {‘value’: False}, ‘LaundryCare.Dryer.Option.DryingTarget’: {‘timestamp’: 1544018159, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/programs/selected/LaundryCare.Dryer.Option.DryingTarget’, ‘value’: ‘LaundryCare.Dryer.EnumType.DryingTarget.IronDry’, ‘level’: ‘hint’}, ‘BSH.Common.Root.ActiveProgram’: {‘timestamp’: 1544018178, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/programs/active’, ‘value’: ‘LaundryCare.Dryer.Program.Cotton’, ‘level’: ‘hint’}, ‘BSH.Common.Option.RemainingProgramTime’: {‘timestamp’: 1544018361, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/programs/active/BSH.Common.Option.RemainingProgramTime’, ‘unit’: ‘seconds’, ‘value’: 60, ‘level’: ‘hint’}, ‘BSH.Common.Option.ProgramProgress’: {‘timestamp’: 1544018361, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/programs/active/BSH.Common.Option.ProgramProgress’, ‘unit’: ‘%’, ‘value’: 50, ‘level’: ‘hint’}}
2018-12-05 13:59:21 WARNING (Thread-15) [custom_components.homeconnect] Entity update triggered on <Entity Droger Door: off>
2018-12-05 13:59:21 WARNING (Thread-15) [custom_components.homeconnect] Entity update triggered on <Entity Droger Remaining Program Time: 7260>
2018-12-05 13:59:21 WARNING (Thread-15) [custom_components.homeconnect] Entity update triggered on <Entity Droger Program Progress: None>
2018-12-05 13:59:21 WARNING (SyncWorker_9) [custom_components.binary_sensor.homeconnect] Updated, new state: False
2018-12-05 13:59:21 WARNING (SyncWorker_11) [custom_components.sensor.homeconnect] Updated, new state: 60
2018-12-05 13:59:21 WARNING (Thread-15) [custom_components.homeconnect] Entity update triggered on <Entity Droger Program Cotton: on>
2018-12-05 13:59:21 WARNING (Thread-15) [custom_components.homeconnect] Entity update triggered on <Entity Droger Program Synthetic: off>
2018-12-05 13:59:21 WARNING (SyncWorker_13) [custom_components.sensor.homeconnect] Updated, new state: 50
2018-12-05 13:59:21 WARNING (SyncWorker_4) [custom_components.switch.homeconnect] Updated, new state: True
2018-12-05 13:59:21 WARNING (Thread-15) [custom_components.homeconnect] Entity update triggered on <Entity Droger Program Mix: off>
2018-12-05 13:59:21 WARNING (SyncWorker_7) [custom_components.switch.homeconnect] Updated, new state: False
2018-12-05 13:59:21 WARNING (SyncWorker_10) [custom_components.switch.homeconnect] Updated, new state: False
2018-12-05 14:00:21 WARNING (Thread-15) [custom_components.homeconnect] Update triggered on Droger
2018-12-05 14:00:21 WARNING (Thread-15) [custom_components.homeconnect] [<Entity Droger Door: off>, <Entity Droger Remaining Program Time: 60>, <Entity Droger Program Progress: 50>, <Entity Droger Program Cotton: on>, <Entity Droger Program Synthetic: off>, <Entity Droger Program Mix: off>]
2018-12-05 14:00:21 WARNING (Thread-15) [custom_components.homeconnect] {‘BSH.Common.Status.OperationState’: {‘timestamp’: 1544018178, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/status/BSH.Common.Status.OperationState’, ‘value’: ‘BSH.Common.EnumType.OperationState.Run’, ‘level’: ‘hint’}, ‘BSH.Common.Status.DoorState’: {‘value’: ‘BSH.Common.EnumType.DoorState.Closed’}, ‘BSH.Common.Status.RemoteControlStartAllowed’: {‘value’: True}, ‘BSH.Common.Status.RemoteControlActive’: {‘value’: True}, ‘BSH.Common.Status.LocalControlActive’: {‘value’: False}, ‘LaundryCare.Dryer.Option.DryingTarget’: {‘timestamp’: 1544018159, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/programs/selected/LaundryCare.Dryer.Option.DryingTarget’, ‘value’: ‘LaundryCare.Dryer.EnumType.DryingTarget.IronDry’, ‘level’: ‘hint’}, ‘BSH.Common.Root.ActiveProgram’: {‘timestamp’: 1544018178, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/programs/active’, ‘value’: ‘LaundryCare.Dryer.Program.Cotton’, ‘level’: ‘hint’}, ‘BSH.Common.Option.RemainingProgramTime’: {‘timestamp’: 1544018421, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/programs/active/BSH.Common.Option.RemainingProgramTime’, ‘unit’: ‘seconds’, ‘value’: 0, ‘level’: ‘hint’}, ‘BSH.Common.Option.ProgramProgress’: {‘timestamp’: 1544018421, ‘handling’: ‘none’, ‘uri’: ‘/api/homeappliances/SIEMENS-WT4H8Y78NL-68A40E150913/programs/active/BSH.Common.Option.ProgramProgress’, ‘unit’: ‘%’, ‘value’: 0, ‘level’: ‘hint’}}
2018-12-05 14:00:21 WARNING (Thread-15) [custom_components.homeconnect] Entity update triggered on <Entity Droger Door: off>

#15

That’s indeed strange, but I’m afraid we can only consume what the event stream throws at us. I’m not aware of any way to influence that. What should definitely be fixed is that currently the program progress remains at 100% after a completed program even if a new program runs that doesn’t update the program progress.

#16

Yes I think that is a good idea. There are some exceptions to handle when the data received is not complete or “correct”.

#17

The thing is that it looks like you have defined the different programs manually in the code(correct me if I’m wrong) and it all my programs does not seem to be there. This also feels like a lot of maintenance when new devices with other programs comes along.

#18

I agree that this is very inelegant. In fact I initially polled the device for the available programs before creating the switches. It turned out this didn’t work because it required the device to be switched on and connected during HA startup, which one cannot assume. Unfortunately, the API does not expose the available programs for unconnected devices.

The maintenance I think it not so much the problem as all existing programs should be listed in the API docs (https://developer.home-connect.com/docs/dryer/supported_programs_and_options etc.), but indeed if your device does not support some features (e.g. oven without Pizza setting) there will be a switch that has no effect.

#19

Hi,

I just tried you custom component and when I try to authorize the component I get the following error:

https://i.imgur.com/r1In8Km.png

Log Details (ERROR)
Mon Dec 10 2018 14:58:28 GMT+0100 (Midden-Europese standaardtijd)

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 390, in start
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py", line 366, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 106, in impl
    return await handler(request)
  File "/usr/src/app/homeassistant/components/http/static.py", line 66, in staticresource_middleware
    return await handler(request)
  File "/usr/src/app/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
    return await handler(request)
  File "/usr/src/app/homeassistant/components/http/ban.py", line 67, in ban_middleware
    return await handler(request)
  File "/usr/src/app/homeassistant/components/http/auth.py", line 107, in auth_middleware
    return await handler(request)
  File "/usr/src/app/homeassistant/components/http/view.py", line 115, in handle
    result = await result
  File "/config/custom_components/homeconnect/__init__.py", line 123, in get
    self.hc.get_token(str(request.url))
  File "/config/deps/lib/python3.6/site-packages/homeconnect/api.py", line 95, in get_token
    client_secret=self.client_secret)
  File "/usr/local/lib/python3.6/site-packages/requests_oauthlib/oauth2_session.py", line 187, in fetch_token
    state=self._state)
  File "/usr/local/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/clients/web_application.py", line 174, in parse_request_uri_response
    response = parse_authorization_code_response(uri, state=state)
  File "/usr/local/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 221, in parse_authorization_code_response
    raise InsecureTransportError()
oauthlib.oauth2.rfc6749.errors.InsecureTransportError: (insecure_transport) OAuth 2 MUST utilize https.

Any idea?

#20

@jeffrysteegmans, can you give the solution in https://github.com/DavidMStraub/homeassistant-homeconnect/issues/3 a try?

#21

i did the auth in my hassio UI but if i start my coffeemachine nothing happens.

if i start my machine manually, it is working and i can get my coffee via the buttons in the UI

2018-12-12 23:06:41 WARNING (MainThread) [homeassistant.loader] You are using a custom component for homeconnect which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2018-12-12 23:06:44 ERROR (SyncWorker_3) [custom_components.homeconnect] <bound method HomeConnectAppliance.get_programs_active of HomeConnectAppliance(hc, haId='SIEMENS-XXXXXXX', vib='XXXXXXX', brand='Siemens', type='CoffeeMaker', name='Kaffeevollautomat', enumber='XXXXXX/03', connected=True)> {'key': 'SDK.Error.NoProgramActive', 'description': 'There is no program active'}
2018-12-12 23:06:45 ERROR (SyncWorker_3) [custom_components.homeconnect] Error while executing <bound method HomeConnectAppliance.get_programs_active of HomeConnectAppliance(hc, haId='SIEMENS-TXXXXXXXXXXX', vib='TI909701HC', brand='Siemens', type='CoffeeMaker', name='Kaffeevollautomat', enumber='XXXXXX3', connected=True)>. Retry #1
2018-12-12 23:06:45 ERROR (SyncWorker_3) [custom_components.homeconnect] <bound method HomeConnectAppliance.get_programs_active of HomeConnectAppliance(hc, haId='SIEMENS-XXXXX', vib='TXXXXXXX', brand='Siemens', type='CoffeeMaker', name='Kaffeevollautomat', enumber='XXXXXC/03', connected=True)> {'key': 'SDK.Error.NoProgramActive', 'description': 'There is no program active'}


2018-12-13 00:10:08 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.2967527792] Received {'type': 'call_service', 'domain': 'switch', 'service': 'turn_on', 'service_data': {'entity_id': 'switch.kaffeevollautomat'}, 'id': 16}
2018-12-13 00:10:08 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=switch, service=turn_on, service_data=entity_id=switch.kaffeevollautomat>
2018-12-13 00:10:08 DEBUG (SyncWorker_4) [custom_components.switch.homeconnect] tried to switch on Kaffeevollautomat
2018-12-13 00:10:08 DEBUG (SyncWorker_4) [requests_oauthlib.oauth2_session] Invoking 0 protected resource request hooks.
2018-12-13 00:10:08 DEBUG (SyncWorker_4) [requests_oauthlib.oauth2_session] Adding token {'id_token': 'xxx', 'access_token': 'xxx', 'expires_in': 81336.79819726944, 'scope': ['Dryer-Settings', 'Washer-Control', 'Dryer-Monitor', 'Settings', 'IdentifyAppliance', 'Washer-Settings', 'CoffeeMaker', 'Washer', 'Hob-Settings', 'Oven-Monitor', 'Hood-Control', 'WasherDryer-Monitor', 'Oven-Settings', 'CoffeeMaker-Monitor', 'Monitor', 'Hob-Monitor', 'WasherDryer-Control', 'Dishwasher-Control', 'Dishwasher', 'Dryer-Control', 'CleaningRobot-Control', 'WasherDryer', 'Dishwasher-Settings', 'Hood', 'Dryer', 'FridgeFreezer-Monitor', 'CleaningRobot-Settings', 'Dishwasher-Monitor', 'CoffeeMaker-Settings', 'FridgeFreezer-Settings', 'CleaningRobot-Monitor', 'CoffeeMaker-Control', 'Washer-Monitor', 'Hood-Monitor', 'Hood-Settings', 'WasherDryer-Settings'], 'refresh_token': 'xxx', 'token_type': 'Bearer', 'expires_at': 1544737302.7981973} to request.
2018-12-13 00:10:08 DEBUG (SyncWorker_4) [requests_oauthlib.oauth2_session] Requesting url https://api.home-connect.com/api/homeappliances/SIEMENS-TI909701HC-68A40E07D5B7/settings/BSH.Common.Setting.PowerState using method PUT.
2018-12-13 00:10:08 DEBUG (SyncWorker_4) [requests_oauthlib.oauth2_session] Supplying headers {'Content-Type': 'application/vnd.bsh.sdk.v1+json', 'Authorization': 'Bearer xxx'} and data {"data": {"key": "BSH.Common.Setting.PowerState.On"}}
2018-12-13 00:10:08 DEBUG (SyncWorker_4) [requests_oauthlib.oauth2_session] Passing through key word arguments {}.
2018-12-13 00:10:08 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.2967527792] Sending {'id': 16, 'type': 'result', 'success': True, 'result': None}