-
ContextContext is an object that indicates what actions belong to one another. It is attached to events and states. It is also passed along to service calls such that any resulting event/state shares the context. By looking at the history, we note that the first event with a specific context was the originating event that set the things in motion. Besides an
With voice we're introducing voice assistants. These are devices that take voice commands that will interact with Home Assistant. It is important that a user is able to track down which device initiated a command. Voice identification might help with this in the future, but it's not a guarantee to always be there nor would we block commands from non-identified users. We also see events fired from devices or in the case of ESPHome, services called from a device. In both cases it's not clear what the origin is. ProposalAdd a new ConsequencesWe add a new optional field We need to store this data in the database. Since the context is stored flattened in the events and states table, it will require adding a new column to both tables. ESPHome will need to set |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Here is an open question: we've been moving away from integrations firing events for things like motion detected in favor of new |
Beta Was this translation helpful? Give feedback.
-
Yes, it can only help when debugging
…On Wed, Oct 4, 2023, 01:51 Paulus Schoutsen ***@***.***> wrote:
Here is an open question: we've been moving away from integrations firing
events for things like motion detected in favor of new event entities. Do
we want to update the old events to include device_id in the context?
—
Reply to this email directly, view it on GitHub
<#978 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACOZ77DL5KUCQ5CWLE256DX5RNEDAVCNFSM6AAAAAA5RG46XKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TCNZZGE4DC>
.
You are receiving this because you are subscribed to this thread.Message
ID: <home-assistant/architecture/repo-discussions/978/comments/7179181@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
Can this be generalized also to automation not only voice triggers? Looking at automation trace we can see what actions it performed, say call service switch toggle. But looking at that switch logbook we only see state change from service call (sometimes with user name) but not the automation entity that actually triggered that action. So maybe extending context with entity_id would be better. Maybe it's not entity_id or device_id but both? The purpose stays the same: being able to track down source of action. |
Beta Was this translation helpful? Give feedback.
-
Discussed this proposal today, and agreed this is OK to move forward. ../Frenck |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if this is related, but I think it's also worth adding |
Beta Was this translation helpful? Give feedback.
Discussed this proposal today, and agreed this is OK to move forward.
../Frenck