I’m good at gluing things together that I don’t understand … Anyway my goal is to insert things that are announced with assist_satellite.announce into the history of voice assist, so if I miss a detail I can ask for it to be repeated. This led to finding the conversation Id for voice assist burried in the debug log and copying it into all automations that might announce something. And, it worked, for 5 minutes.
I also found that all voice assist history is lost every 5 minutes. That might make sense for turning lights on and off, but for having a conversation with an ai agent it seems like a very bad decision.
After a lot of searching I found:
dev
← synesthesiam-20240604-wyoming-satellite-conversation-id
opened 07:58PM - 04 Jun 24 UTC
## Breaking change
## Proposed change
Wyoming satellites currently run… pipelines with the `conversation_id` set to `None`, which means that each request is independent.
This PR automatically generates a `conversation_id` per satellite connection, and includes it in each pipeline call. After 5 minutes of inactivity, the `conversation_id` is cleared (to match ESPHome).
## Type of change
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [x] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Additional information
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request:
## Checklist
- [ ] The code change is tested and works locally.
- [ ] Local tests pass. **Your PR cannot be merged unless tests pass**
- [ ] There is no commented out code in this PR.
- [ ] I have followed the [development checklist][dev-checklist]
- [ ] I have followed the [perfect PR recommendations][perfect-pr]
- [ ] The code has been formatted using Ruff (`ruff format homeassistant tests`)
- [ ] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]
If the code communicates with devices, web services, or third-party tools:
- [ ] The [manifest file][manifest-docs] has all fields filled out correctly.
Updated and included derived files by running: `python3 -m script.hassfest`.
- [ ] New or updated dependencies have been added to `requirements_all.txt`.
Updated by running `python3 -m script.gen_requirements_all`.
- [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
- [ ] Untested files have been added to `.coveragerc`.
To help with the load of incoming pull requests:
- [ ] I have reviewed two other [open pull requests][prs] in this repository.
[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure
[dev-checklist]: https://developers.home-assistant.io/docs/development_checklist/
[manifest-docs]: https://developers.home-assistant.io/docs/creating_integration_manifest/
[quality-scale]: https://developers.home-assistant.io/docs/integration_quality_scale_index/
[docs-repository]: https://github.com/home-assistant/home-assistant.io
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr
That led me to esphome where I found conversation_timeout, added here:
dev
← jeffc:voice-assist-improvements
opened 02:54PM - 01 Sep 24 UTC
# What does this implement/fix?
Makes the timeout for the voice assist `conve… rsation_id` configurable instead of a hard-coded 5 minutes. Partly addresses esphome/feature-requests#2812
## Types of changes
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Other
**Related issue or feature (if applicable):** partly fixes https://github.com/esphome/feature-requests/issues/2812
**Pull request in [esphome-docs](https://github.com/esphome/esphome-docs) with documentation (if applicable):** esphome/esphome-docs#4213
## Test Environment
- [x ] ESP32
- [ ] ESP32 IDF
- [ ] ESP8266
- [ ] RP2040
- [ ] BK72xx
- [ ] RTL87xx
## Example entry for `config.yaml`:
```yaml
# Example config.yaml
voice_assistant:
microphone: mic_i2s
id: va
noise_suppression_level: 2
auto_gain: 31dBFS
volume_multiplier: 8.0
use_wake_word: false
conversation_timeout: 60s
media_player: media_out
```
## Checklist:
- [ x] The code change is tested and works locally.
- [ x] Tests have been added to verify that the new code works (under `tests/` folder).
If user exposed functionality or configuration variables are added/changed:
- [ x] Documentation added/updated in [esphome-docs](https://github.com/esphome/esphome-docs).
I tried changing that and recompiling, didn’t help.
The current 2025.3.3 change log lists several changes to conversation Id, but none of it looks like it adds any functionality.
If it matters I’m running everything locally
S3 box 3 for “assist device”
N100 mini pc running Debian for home assistant
Big Ubuntu desktop with 3090 for wisper/piper/ollama and frigate
Anyone have some insight? The documentation does not go into much detail.
Thanks for reading
mchk
March 15, 2025, 6:29am
2
conversation_timeout How long to wait before resetting the conversation_id
sent to the voice assist pipeline, which contains the context of the current assist pipeline. Defauls to 300s
.
This is done so that the context doesn’t grow to a huge amount. This can be quite expensive if you are using a cloud API.
For wyoming satellite, this value is not set via parameters, but is in the code. Edit satellite.py and restart the device.
It seems that this is now controlled here
"""Helper to organize chat sessions between integrations."""
from __future__ import annotations
from collections.abc import Generator
from contextlib import contextmanager
from contextvars import ContextVar
from dataclasses import dataclass, field
from datetime import datetime, timedelta
import logging
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.core import (
CALLBACK_TYPE,
Event,
HassJob,
HassJobType,
HomeAssistant,
callback,
)
This file has been truncated. show original
I’m gonna see if I can bump session.last_updated somehow with a custom component.