HAOS OpenAI Extension
Articolo

HAOS OpenAI Extension brings Home Assistant history to Assist responses

HAOS OpenAI Extension allows Assist to consult Home Assistant history and compare devices, within the limits of Recorder.

A custom integration forhomeAssistant allows the voice assistant to also answer questions about events that have already occurred at home. Is calledHAOS OpenAI Extensionand adds Recorder history consultation tools to the OpenAI conversational agent already configured in Assist. The project, presented incommunityof Home Assistant, allows you to reconstruct when a device changed state, how long it remained active and how it compares to other devices. It does not introduce a new agent and does not require an additional API key.

How HAOS OpenAI Extension works

The extension provides the agent with read-only tools to query the historical data stored by Recorder and compare entities. Before sending the results to the language model, Home Assistant calculates the number of events, durations and temporal boundaries of the queries. The goal is to provide answers based on the recorded states, rather than asking the model to reconstruct the steps independently.

The project works with the official OpenAI conversation integration and can be used even when Alexa requests are already forwarded to the same agent. Does not initiate periodic history queries in the background. Searches are limited to entities exposed to the active Assist assistant, so as to respect the perimeter of the devices that the user has chosen to make accessible.

History questions and device comparisons

Possible prompts include questions such as “When was the garage door last closed?” or “How long was it open yesterday?” The extension also allows comparisons between entities, for example identifying which light remained on the longest during the day. Periods expressed in natural language are recognized, including today, yesterday and last week.

The questions cover the latest ones at most240 hours, equivalent to 10 days, and only to the extent that Recorder actually retained the data. The counting considers real state transitions: repeated recordings of the same state, for example after a reboot, are not interpreted as new events. When history is absent or incomplete, the tools return coverage indicators that signal the limit of the response.

HAOS OpenAI Extension corpo

Installation with HACS and configuration of Assist

To install the extension you need to download it via HACS, restart Home Assistant and addHAOS OpenAI Extensionfrom Settings → Devices and services → Add integration. The add repository to HACS button alone does not complete the installation: downloading, restarting and configuring the integration remain necessary steps.

In the OpenAI conversation agent already in use, you need to keep Assist and device control enabled, then expose the entities whose history you want to query to Assist. At this point you can formulate a historical question and verify in the conversation track that the chronology or comparison tool has actually been invoked. There is no provision for configuring a separate agent.

History, privacy and security limits

The accuracy of the answers depends on the data available in Recorder: if an interval was not recorded or is no longer stored, the extension cannot reconstruct it. The developer also clarifies that the selected mode of an air conditioner is not equivalent to a measurement of the actual running time of the compressor. This is an important distinction when asking about durations or comparisons based on entity states.

The tools added by the extension are read-only, but this does not eliminate any control commands already present in the conversational agent. To ask about the status of the garage door without making it available to operate, the developer suggests exposing an appropriate binary sensor, leaving the motorized cover and related controls unexposed.

Finally, the extension does not transform the existing cloud agent into a local system: the historical data retrieved and sent to the agent can be processed by its provider. Alexa also has a practical limitation, because the time allowed to respond is short and slow queries can time out. The project was shared in the Home Assistant community, where the author invites you to report problems by indicating the version of the integration and relevant traces, after removing private information and credentials.

DS

Dario Scarfina

Founder and author of TecnologiaDigitale.net

Founder of TecnologiaDigitale.net. Passionate about technology, cybersecurity, artificial intelligence, smart home and digital innovation.

View author profile

Commenti

Ancora nessun commento. Sii il primo a partecipare.

L'email non verrà pubblicata. Il commento sarà visibile solo dopo approvazione.