Skip to content

[BUG] HassLightSet: cannot target bedroom light — 'Service handler cannot target all devices' #98

Description

@charlieseay

Description

HassLightSet fails when targeting the bedroom light. Both plain-English name and entity ID formats return an error from Home Assistant.

Error: Service handler cannot target all devices

Steps to Reproduce

  1. Attempt to set brightness (or turn on) bedroom light via hass(action="set_brightness", target="bedroom light", value=...) or Sonique voice equivalent
  2. Also attempted with light.bedroom_light as target
  3. Both return: Service handler cannot target all devices

Expected Behavior

The bedroom light should be targeted and controlled successfully.

Analysis

The hass() function passes args = {"name": target} to HassLightSet (hass.py:337). When HA's Assist pipeline cannot resolve name to a specific entity, it appears to fall back to targeting all devices — which HassLightSet rejects with this error.

Likely root causes:

  • The friendly name "bedroom light" doesn't match the entity's name in HA exactly enough for the Assist intent to resolve it
  • Passing an entity ID (light.bedroom_light) as the name field doesn't work because Assist intents expect friendly names, not entity IDs
  • The device cache may resolve the device but the name passed to HA still doesn't match precisely

Possible Fix

When the device cache resolves a device and has an entity_id, consider passing it via a mechanism HA can target precisely (e.g., the raw service call with entity_id targeting rather than the Assist intent pipeline), or add stricter name normalization to match exactly against HA's entity friendly names.

Environment

  • Reported: 2026-04-23 via Sonique voice
  • Integration: caal/integrations/hass.py
  • Relevant code: HassLightSet intent mapping at line 177, arg construction at line 337

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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