home-connect-hass: API call for active program 404 results in excessive number of API calls

Keep getting BLOCKED due to excessive number of API calls

I think this is due to the call for the active program for a coffee machine getting 404 and the component constantly retrying. See attached debug log.

Version of the custom_component

0.6.3

Debug log

2023-06-25 21:06:03.329 DEBUG (MainThread) [home_connect_async.api] HTTP GET /api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/programs/active (try=1 count=663) [404]
2023-06-25 21:06:03.330 DEBUG (MainThread) [home_connect_async.api] API call failed with code=404 error=SDK.Error.NoProgramActive
2023-06-25 21:06:03.330 DEBUG (MainThread) [home_connect_async.appliance] Failed to load active programs with error code=404 key=SDK.Error.NoProgramActive
2023-06-25 21:06:03.331 DEBUG (MainThread) [home_connect_async.api] 
HTTP GET /api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/programs/available (try=1 count=664)

2023-06-25.log

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 2
  • Comments: 28 (22 by maintainers)

Most upvoted comments

@pbvdven I’m afraid that’s not going to be possible.

@pbvdven well, he didn’t reach out and I’m not sure he understands how Home Assistant works. Keeping the sensors and options up-to-date requires API calls when certain statuses change. However, if he has any constructive suggestions how to avoid that I’m happy to learn.

Thanks. I’ll take a look at it but it will have to wait until I return from my vacation towards the end of August.

You can upload a full debug log for at least 48h

Here you go - most of the “surplus” calls are for child lock (448 times), sabbath mode (16 times, but basically every time the oven is used), PowerState (637 times), TemperatureUnit (56) Appreciate it’s difficult getting the current state of the appliances - that’s why I was wondering whether there was any way of caching/throttling some calls for the “basic” settings such as child lock.

2023-07-08 HOME_CONNECT.LOG

Thanks for responding so quickly - have deleted and re-added the machine but still get the 404 error and a lot of API calls.

Back story is I have an automation which turns the machine on, waits for ready state then changes the selected program to espresso using the select program service (but does not actually run the program)

I think the problem is when the machine is turned on, the “active program” is cleaning which when you query the API for details it says no program active as the cleaning function has finished but no program is active (as the machine isn’t brewing coffee). "uri":"/api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/programs/active","value":"ConsumerProducts.CoffeeMaker.Program.CleaningModes.ApplianceOnRinsing"}]}. and then when the machine is properly turned on, the component queries the machine again for the active program

2023-06-27 19:34:15.730 DEBUG (MainThread) [home_connect_async.api] HTTP GET /api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/settings/BSH.Common.Setting.PowerState (try=1 count=2584) [200]
2023-06-27 19:34:15.732 DEBUG (MainThread) [home_connect_async.appliance] Loaded 2 Settings
2023-06-27 19:34:15.732 DEBUG (MainThread) [home_connect_async.callback_registery] Broadcasting event: Events.PROGRAM_SELECTED = ConsumerProducts.CoffeeMaker.Program.Beverage.Espresso
2023-06-27 19:34:15.818 DEBUG (MainThread) [home_connect_async.callback_registery] Broadcasting event: Events.DATA_CHANGED = None
2023-06-27 19:34:15.858 DEBUG (MainThread) [home_connect_async.callback_registery] Broadcasting event: BSH.Common.Root.SelectedProgram = ConsumerProducts.CoffeeMaker.Program.Beverage.Espresso
2023-06-27 19:34:15.858 DEBUG (MainThread) [home_connect_async.api] 
HTTP GET /api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/programs/active (try=1 count=2585)

2023-06-27 19:34:15.902 DEBUG (MainThread) [home_connect_async.api] HTTP GET /api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/programs/active (try=1 count=2585) [404]
2023-06-27 19:34:15.903 DEBUG (MainThread) [home_connect_async.api] API call failed with code=404 error=SDK.Error.NoProgramActive
2023-06-27 19:34:15.903 DEBUG (MainThread) [home_connect_async.appliance] Failed to load active programs with error code=404 key=SDK.Error.NoProgramActive

Later on when the program selection changes, the component again queries for the active program

2023-06-27 19:34:20.353 DEBUG (MainThread) [home_connect_async.api] HTTP PUT /api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/programs/selected (try=1 count=2592) [204]
2023-06-27 19:34:40.925 DEBUG (MainThread) [home_connect_async.homeconnect] Received event from SSE stream: MessageEvent(type='KEEP-ALIVE', message='KEEP-ALIVE', data='', origin='https://api.home-connect.com', last_event_id='SIEMENS-CT836LEB6-ABCDEFGHIJKL')
2023-06-27 19:35:35.926 DEBUG (MainThread) [home_connect_async.homeconnect] Received event from SSE stream: MessageEvent(type='KEEP-ALIVE', message='KEEP-ALIVE', data='', origin='https://api.home-connect.com', last_event_id='SIEMENS-CT836LEB6-ABCDEFGHIJKL')
2023-06-27 19:36:30.925 DEBUG (MainThread) [home_connect_async.homeconnect] Received event from SSE stream: MessageEvent(type='KEEP-ALIVE', message='KEEP-ALIVE', data='', origin='https://api.home-connect.com', last_event_id='SIEMENS-CT836LEB6-ABCDEFGHIJKL')
2023-06-27 19:36:46.333 DEBUG (MainThread) [home_connect_async.homeconnect] Received event from SSE stream: MessageEvent(type='STATUS', message='STATUS', data='{"haId":"SIEMENS-CT836LEB6-ABCDEFGHIJKL","items":[{"handling":"none","key":"BSH.Common.Status.LocalControlActive","level":"hint","timestamp":1687891005,"uri":"/api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/status/BSH.Common.Status.LocalControlActive","value":true}]}', origin='https://api.home-connect.com', last_event_id='SIEMENS-CT836LEB6-ABCDEFGHIJKL')
2023-06-27 19:36:46.334 DEBUG (MainThread) [home_connect_async.callback_registery] Broadcasting event: BSH.Common.Status.LocalControlActive = True
2023-06-27 19:36:48.818 DEBUG (MainThread) [home_connect_async.homeconnect] Received event from SSE stream: MessageEvent(type='STATUS', message='STATUS', data='{"haId":"SIEMENS-CT836LEB6-ABCDEFGHIJKL","items":[{"handling":"none","key":"BSH.Common.Status.OperationState","level":"hint","timestamp":1687891008,"uri":"/api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/status/BSH.Common.Status.OperationState","value":"BSH.Common.EnumType.OperationState.ActionRequired"}]}', origin='https://api.home-connect.com', last_event_id='SIEMENS-CT836LEB6-ABCDEFGHIJKL')
2023-06-27 19:36:48.819 DEBUG (MainThread) [home_connect_async.api] 
HTTP GET /api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/programs/active (try=1 count=2593)

2023-06-27 19:36:49.057 DEBUG (MainThread) [home_connect_async.api] HTTP GET /api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/programs/active (try=1 count=2593) [404]
2023-06-27 19:36:49.058 DEBUG (MainThread) [home_connect_async.api] API call failed with code=404 error=SDK.Error.NoProgramActive
2023-06-27 19:36:49.059 DEBUG (MainThread) [home_connect_async.appliance] Failed to load active programs with error code=404 key=SDK.Error.NoProgramActive
2023-06-27 19:36:49.059 DEBUG (MainThread) [home_connect_async.api] 
HTTP GET /api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/programs/selected (try=1 count=2594)

2023-06-27 19:36:49.098 DEBUG (MainThread) [home_connect_async.api] HTTP GET /api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/programs/selected (try=1 count=2594) [200]
2023-06-27 19:36:49.108 DEBUG (MainThread) [home_connect_async.appliance] Loaded 4 Options for selected/ConsumerProducts.CoffeeMaker.Program.Beverage.Espresso
2023-06-27 19:36:49.109 DEBUG (MainThread) [home_connect_async.appliance] Loaded data for selected Program
2023-06-27 19:36:49.109 DEBUG (MainThread) [home_connect_async.api] 
HTTP GET /api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/programs/available (try=1 count=2595)

2023-06-27 19:36:49.157 DEBUG (MainThread) [home_connect_async.api] HTTP GET /api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/programs/available (try=1 count=2595) [409]
2023-06-27 19:36:49.158 DEBUG (MainThread) [home_connect_async.api] API call failed with code=409 error=SDK.Error.ProgramNotAvailable
2023-06-27 19:36:49.159 DEBUG (MainThread) [home_connect_async.appliance] Failed to load available programs with error code=409 key=SDK.Error.ProgramNotAvailable
2023-06-27 19:36:49.160 DEBUG (MainThread) [home_connect_async.api] 
HTTP GET /api/homeappliances/SIEMENS-CT836LEB6-ABCDEFGHIJKL/settings (try=1 count=2596)

on another note, there does seem to be a lot of calls for available programs : any chance you could cache the data?

debug log attached… 2023-06-27.log

I have a similar problem with this add on and a dishwasher. I get blocked almost every day 😐