Home control
Turn lights, switches, fans, and other Home Assistant entities on/off by a natural name — no entity IDs required.
How to use it
"turn on the living room lights"
"turn off the fan"
"dim the lights" / "dim the lights to 50"
"turn the lamp blue"
"toggle the office switch"
How it works
- Tool:
control_ha(brain/tools.py) — takes atarget(natural name),action(turn_on/turn_off/toggle), and optionalbrightness/color_name. - Entity resolution:
_resolve_entity()callssearch_entities()inha_client.py(substring match against entity_id + friendly_name) and keeps the first hit whose domain is in_CONTROLLABLE—light,switch,fan,cover,climate,media_player,input_boolean,scene,script,automation. The model never has to know or guess an entity_id. - Execution:
HomeAssistantClientinha_client.py— a thin REST wrapper around Home Assistant's/api/services/<domain>/<service>. - Narration: goes through the normal in-character narration pass (not in
VERBATIM_TOOLS) — fine here since there's no precise data to preserve, just a confirmation.
Status & known limits
- Resolution is a plain substring match, not semantic — an ambiguous or very short target name may resolve to the wrong entity if multiple friendly names overlap.
- No support for scenes/automations with required extra parameters beyond brightness/color.