Skip to content

LLM unable to read LLM Timeline event data due to datetime filter in calendar.py #659

Description

@Kevin03YZFR1

Checklist

  • I'm running the newest version of LLM Vision https://github.com/valentinfrlch/ha-llmvision/releases/latest
  • I have enabled debug logging for the integration.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This is a bug and not a feature request.
  • I have searched open issues for my problem.

Describe the issue

I am running Home assistant in Docker and have encountered an issue where the Voice Assistant cannot see the event data that exists on the LLM Vision Timeline.

I have traced the problem down to what appears to be a bug in Home Assiatant that seemingly completely ignores the original datetime filtering logic within calendar.py in the async def async_get_events function.

I have attempted many logic variations to re-implement the filter but it seems that removing the datetime filter is literally the only working solution that I have been able to find.

In reviewing all of the other open issues, I can clearly see this is not an issue on all Home Assistant builds. Any feedback or thoughts on this would be appreciated as this is a great tool you guys have created. The logs are otherwise clean, though I did add an example output from the voice assistant debug.

Below is a workaround that I am currently using which is basically a minor edit to the existing logic within calendar.py

    async def async_get_events(
        self,
        hass: HomeAssistant,
        start_date: datetime.datetime,
        end_date: datetime.datetime,
    ) -> list[CalendarEvent]:
        """Returns ALL calendar events (no filtering)."""

        await self.timeline.load_events()
        timeline_events = await self.timeline.get_all_events()

        calendar_events: list[CalendarEvent] = []

        for event in timeline_events:
            if event.start is None or event.end is None:
                continue

            event_start = self._ensure_datetime(event.start)
            event_end = self._ensure_datetime(event.end)

            calendar_events.append(
                CalendarEvent(
                    uid=event.uid,
                    summary=event.title,
                    start=event_start,
                    end=event_end,
                    description=event.description,
                )
            )

        return calendar_events

### Reproduction steps

1. Ask the voice assistant for events from today 
2. Open the DEBUG log for the voice assistant
3. Expand "Result for calendar_get_events"
4. Observe "result: []"
...


### Debug logs

```text
role: tool_result
agent_id: conversation.qwen3_6_35b_a3b
tool_call_id: TP9nDby3Lv3ieZAJtTdccBk5x5pHgTej
tool_name: calendar_get_events
tool_result:
success:
true
result: []
created: 2026-05-28T00:20:12.098Z

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions