HAOS OpenAI Extension – Recorder history and device comparisons for Home Assistant Assist

Hi all,

I’ve put together HAOS OpenAI Extension, a custom integration that adds read-only history tools to Home Assistant’s existing Assist API.

It is built to work with the official OpenAI conversation integration, including Alexa requests already forwarded to that conversation agent.

The aim is to let Assist answer questions about what happened earlier, using recorded Home Assistant data.

How it works

The integration gives the conversation agent tools to query Recorder history and compare entities. Home Assistant calculates event counts, durations and time boundaries before returning results to the language model.

It uses your existing conversation agent. There is no separate agent or additional API key to configure in this integration.

Features

  • Questions such as “When was the garage door last closed?” and “How long was it open yesterday?”
  • Cross-entity comparisons such as “Which light was on for the longest time today?”
  • Natural time periods, including today, yesterday and last week.
  • History queries within the most recent 240 hours / 10 days, subject to retained Recorder data.
  • Genuine state-transition counting, without treating repeated same-state records after restarts as new events.
  • Coverage flags for missing or unavailable history.
  • Read-only queries restricted to entities exposed to the active Assist assistant.
  • No background history polling.

Installation

Add this repository to HACS

The button adds the repository to HACS; download, restart and integration setup are still required.

  1. Download HAOS OpenAI Extension through HACS.
  2. Restart Home Assistant.
  3. Go to Settings → Devices & services → Add integration and add HAOS OpenAI Extension.
  4. Keep Assist/device control enabled in your existing OpenAI conversation agent.
  5. Expose the entities you want queried to Assist and try a history question. The conversation trace should show the history or comparison tool being called.

Things to know

Answers depend on what Recorder actually retained. Missing history is flagged, and selected climate mode is not a measurement of compressor runtime.

The extension’s tools are read-only, but your existing conversation agent may still have its usual device-control tools. For status-only questions about a garage door, expose an appropriate binary sensor while keeping the actuating cover and related controls unexposed.

This does not make the existing cloud conversation agent local: queried history returned to that agent can be processed by its provider. Alexa also has a short response deadline, so slow queries may time out.

Source and feedback

HAOS OpenAI Extension on GitHub

Please share useful question examples here, or report an issue with the integration version and relevant trace details. Remove private device history, prompts and credentials before posting.

Hopefully this helps make Assist more useful for understanding what has been happening around the home!

My other Home Assistant projects