Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Home Assistant

11.6. Home Assistant — A Genuinely Two-way Integration

Home Assistant — a genuinely two-way integration. This is a rare example in the Hermes documentation that has both tools and events on the same platform — not only does the agent call outward, the smart home also actively “calls in” to the agent.

Activated with a single token

# ~/.hermes/.env
HASS_TOKEN=your-long-lived-access-token
HASS_URL=http://192.168.1.100:8123    # optional, defaults to homeassistant.local:8123

Just HASS_TOKEN activates both modes at once: the homeassistant toolset lets the agent control devices, and the platform gateway makes Home Assistant appear as a chat channel alongside Telegram, Discord…

Tool mode — direct query/command

4 tools available:

ToolFunction
ha_list_entitiesList entities, filter by domain (light, climate, sensor…) or area (living room, kitchen…)
ha_get_stateInspect the detailed state of one entity (brightness, temperature, sensor value…)
ha_list_servicesList available services for control
ha_call_servicePerform an action — this is the real “turn the light on/off” tool

Practical example: “Turn off the living room lights” → the agent finds the right entity_id via ha_list_entities, then calls ha_call_service — you do not need to know the technical entity names in advance.

Event mode — real-time reactions

The gateway adapter subscribes to the WebSocket state_changed. The key point to emphasize: by default no events are forwarded — you must explicitly declare at least one of watch_domains, watch_entities, or watch_all, otherwise the system logs a warning and silently ignores every change:

platforms:
  homeassistant:
    enabled: true
    extra:
      watch_domains: [climate, binary_sensor, alarm_control_panel, light]
      watch_entities: [sensor.front_door_battery]
      ignore_entities: [sensor.uptime, sensor.cpu_usage, sensor.memory_usage]
      cooldown_seconds: 30

The agent’s responses come back to HA as persistent notifications (persistent_notification.create) — shown in the HA interface like regular notifications.

Built-in safety rails

A group of dangerous domains is hard-blocked by default to prevent arbitrary code execution via the smart-home path: shell_command, command_line, python_script, pyscript, hassio, rest_command. All other services are available.

Field-tested lessons

  • Start with a narrow watch_domains list (climate, binary_sensor, alarm_control_panel is the recommended starting set) — expand gradually as you see the need, instead of turning on watch_all from the start and getting flooded with notifications.
  • Use ignore_entities for “noisy” sensors (uptime, CPU, memory) — otherwise every time these values change, it triggers an unnecessary agent call.
  • Keep dangerous or security-sensitive actions (locking doors, alarms) behind a confirmation step until you genuinely trust the stability of your setup — this is an official recommendation, not just personal caution.