Skip to content

[Bug]: homeassistant_tool.py fails to get_items on todo entities #27256

@ki9us

Description

@ki9us

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/toolsTool registry, model_tools, toolsetstool/webWeb search and extractiontype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions