hermes - 💡(How to fix) Fix [Bug]: homeassistant_tool.py fails to get_items on todo entities [2 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

400 error

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

Code Example

Report       https://paste.rs/IHYjm
  agent.log    https://paste.rs/T3rb2
  gateway.log  https://paste.rs/NwiFo

---



---

> payload: Dict[str, Any] = {}
> if data:
>     payload.update(data)
> if entity_id:
>     payload["entity_id"] = entity_id
> return payload
>

---

> POST /api/services/todo/get_items
> Headers: Authorization: Bearer <token>
> Body: {"entity_id": "todo.mylist", "status": "needs_action"}
>

---

> {
>   "target": {
>     "entity_id": "todo.mylist"
>   },
>   "data": {
>     "status": "needs_action"
>   }
> }
>
RAW_BUFFERClick to expand / collapse

Bug Description

My hermes has been 400ing on get_items requests to homeassistant todo entities, while add_item and remove_item work fine.

Hermes didn't seem to understand why add and remove calls weren't working and seemed to think it was a bug. See her investigation below.

Steps to Reproduce

  1. Create a todo list in home assistant, like todo.mylist.
  2. Add items to the list
  3. Ask hermes to read the items from the list

Expected Behavior

Hermes runs get_items on the list to get the list items.

Actual Behavior

400 error

Affected Component

Tools (terminal, file ops, web, code execution, etc.)

Messaging Platform (if gateway-related)

No response

Debug Report

Report       https://paste.rs/IHYjm
  agent.log    https://paste.rs/T3rb2
  gateway.log  https://paste.rs/NwiFo

Operating System

Arch linux

Python Version

3.11.15

Hermes Version

v0.14.0 (2026.5.16)

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

Asked Hermes what was the exact failing request payload and this is what she said. Hope this helps; it may be a complete hallucination.

Aha! I found the issue. Let me show you the exact payload.

Looking at this in /home/agent/.hermes/hermes-agent/tools/homeassistant_tool.py:

What ha_call_service sends vs what HA expects:

For get_items, the _build_service_payload function (lines 142-153) constructs:

payload: Dict[str, Any] = {}
if data:
    payload.update(data)
if entity_id:
    payload["entity_id"] = entity_id
return payload

So the raw POST to HA is:

POST /api/services/todo/get_items
Headers: Authorization: Bearer <token>
Body: {"entity_id": "todo.mylist", "status": "needs_action"}

The problem: HA 2023+ changed how it targets entities. For the todo domain, the service call requires the entity to be identified via a target object in the payload:

{
  "target": {
    "entity_id": "todo.mylist"
  },
  "data": {
    "status": "needs_action"
  }
}

But the tool just flattens entity_id into the top-level payload instead of wrapping it in target. That flat format still works for most domains (lights, switches, etc.) due to HA's backwards compatibility, but the todo domain is stricter and doesn't accept the flat format.

This is a limitation of the Hermes ha_call_service tool's payload construction. The fix would need to go in _build_service_payload at line 147 of tools/homeassistant_tool.py.

Proposed Fix (optional)

Wish I could be more help

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug]: homeassistant_tool.py fails to get_items on todo entities [2 pull requests]