ekutner / home-connect-hass

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

Missing events on oven appliance #336

Closed victory123 closed 9 months ago

victory123 commented 9 months ago

Hi,

I am missing the following events for my oven (BOSCH-HRG6769S6) in the integration:

Cooking_Oven_Event_PreheatFinished BSH_Common_Event_ProgramFinished BSH_Common_Event_AlarmClockElapsed

All of these should be in the API as they have been made available in the iobroker adapter, which is using the same API (https://github.com/iobroker-community-adapters/ioBroker.homeconnect).

As I am moving from iobroker to Home assistant it would be great if these events would also be there. I am using them to announce the info via voice assistant to different floors. Thanks in advance Victor

ekutner commented 9 months ago

If they are published by the API then they are there. Why do you think they are missing?

victory123 commented 9 months ago

Hi, simply put, because I just can't find and use them :-). Neither as any type of entity nor attribute in the integration. I can't find a trigger or define it with the published events in the integration. If you think they should be there maybe you can point me as to where to find and use them. Again thanks a lot Victor

ekutner commented 9 months ago

They would be published as events. You can use them to trigger automations or manually listen to them for debugging using the Developer Tools.

victory123 commented 9 months ago

Hi, I don't think that currently any events besides the BSH.Common.Status.OperationState are there.

Would you mind having a look at: https://github.com/ekutner/home-connect-hass/blob/ccdf73ae0a638f35134c6f9a695f4210c9e17e9b/custom_components/home_connect_alt/const.py#L70

I think it's a typo and should be ".Event." not ".event."

Thanks again Victor

ekutner commented 9 months ago

No, the generated regex is case insensitive, the events should be published. Please upload a debug log of when those events were supposed to be received. By the way, the events will be published as they are received from the HC API, which means with dots as separators, not underscores, for example: "Cooking.Oven.Event.PreheatFinished"

victory123 commented 9 months ago

Hi, you are absolutely right. Here the relevant excerpt from the debug log:

... 2024-02-14 09:18:22.919 DEBUG (MainThread) [home_connect_async.homeconnect] Received event from SSE stream: MessageEvent(type='EVENT', message='EVENT', data='{"haId":"BOSCH-HRG6769S6-68A40E7E5923","items":[{"displayvalue":"Event active","handling":"acknowledge","key":"Cooking.Oven.Event.PreheatFinished","level":"hint","name":"Preheating completed","timestamp":1707898702,"value":"BSH.Common.EnumType.EventPresentState.Present"}]}', origin='https://api.home-connect.com', last_event_id='BOSCH-HRG6769S6-68A40E7E5923') 2024-02-14 09:18:22.920 DEBUG (MainThread) [home_connect_async.callback_registery] Broadcasting event: Cooking.Oven.Event.PreheatFinished = BSH.Common.EnumType.EventPresentState.Present 2024-02-14 09:18:22.920 DEBUG (MainThread) [custom_components.home_connect_alt] Published event to Home Assistant event bus: Cooking.Oven.Event.PreheatFinished = BSH.Common.EnumType.EventPresentState.Present ...

The event is received from the API and seems to be published to the Homeassistant event bus.

But I can't see or use it anywhere. I can't trigger automations with that event as it won't show up in the available triggers in the UI based automations, nor can I define a trigger in i.e. automations.yaml as I don't have the entity there either (I do have a lot of others events there, mainly from the homematic integration i.e. image

I even tried it in Node Red by using the "events:all" Node.

I am sorry but I am lost...

I would be happy if you could share a concrete example of how you think I should use it or get access to it. I simply have been using in all other integrations some kind of entities to interact with. Thanks again Victor

victory123 commented 9 months ago

Hi, sorry for bothering you. I just found out that I have to use the event_type "home_connect_alt_event" and then I am able to listen for alle the events coming from the integration. It just wasn't clear to me from the FAQ that it's the event type mentioned there. Thanks a lot for you effort. Very nice and useful integration :-)

ekutner commented 9 months ago

Happy to hear that it all worked out