#Exposing different entities to multiple voice pipelines.

1 messages Β· Page 1 of 1 (latest)

vital ravine
#

Hey everyone! πŸ‘‹
Quick question: is it currently possible to expose different entities to different Assist pipelines? Or is this something that's planned?

This would be insanely useful for setups with multiple households sharing the same HA server (e.g., separate floors that have some overlapping entities but also some that are identical on both floors and need to be separated), or for creating "agents" that only control a subset of entitiesβ€”great for keeping the main Assist focused on the most-used devices.

Thanks in advance!

@hollow rivet

next tree
#

you can use Assist "trigger.device_id" together with "trigger.slots.area" in automation variables to detect VA that is receiving command, so that way you can have same names or aliases on every floor. For example HVAC you have on every floor and all with same alias, which will be controlled depends on which VA got command
@vital ravine

#

Example automation that I use at my place that has 3 apartments, all have HVAC, I can say Turn off AC and it will turnHVAC off in my apartment, if I say Turn off AC at dads flat, it will turn HVAC of in dads apartment. HVAC do not have alias set, and have different names. Templates take care of that.

alias: Voice - set HVAC to OFF in area
description: >-
  Reads the area from the voice prompt (or the calling device), searches for the
  first climate entity and sets HVAC mode to OFF. 
triggers:
  - command:
      - >-
        Turn off AC in {area}
    trigger: conversation
  - command:
      - >-
        Turn off AC
    trigger: conversation
conditions: []
actions:
  - variables:
      area: |-
        {%- if trigger.slots.area -%}
          {{ trigger.slots.area }}
        {%- else -%}
          {{ area_id(trigger.device_id) }}
        {%- endif -%}
  - choose:
      - conditions:
          - condition: template
            value_template: |-
              {{ states.climate
                  | selectattr('entity_id','in', area_entities(area))
                  | list
                  | length > 0 }}
        sequence:
          - target:
              entity_id: |-
                {{ (states.climate
                    | selectattr('entity_id','in', area_entities(area))
                    | map(attribute='entity_id')
                    | list)[0] }}
            data:
              hvac_mode: "off"
            action: climate.set_hvac_mode
          - set_conversation_response: AC is off
    default:
      - set_conversation_response: No AC in area
mode: single
next tree
#

This method works on any pipeline, its set to take area of voice assist device, so basically all VA can use same pipeline or have different for each apartment

vital ravine
#

Thank you πŸ‘ this definitely solves part of the problem. But when saying "turn on the TV" it is not clear which tv (at least when using assist through the smartphone). The other issue I have is the amount of tokens used by each command that is not handled locally by having twice the devices on each request πŸ˜…

next tree
#

yes, smartphone is tricky since it does not expose VA entity so we can assign it to area. But if you use phone, you need to always say area where you expect TV to turn on

next tree
#

In case of VA that has area that is assigned, saying Turn on the TV, will turn on TV in same area as VA device

chilly tangle
tidal pine
vital ravine
sudden delta
#

Will Assist ever be able to help troubleshoot integration problems? Feels like this would be the biggest advantage to having an AI interested into HA

tidal pine
vital ravine
# tidal pine You can have pipeline with that switch on, and with it off - and switch between ...

Thanks for the suggestion but then I would have still the issue that one floor has full access to the other floor which probably will sometimes lead to situations where there a 2 night lamps and the question is then which lamp you mean πŸ˜… preferably I would separate these floors completely on the voice side, but keep them on the same server as they share some common entities. But I think this is not possible currently

tidal pine
vital ravine
#

Is that true also in terms of floors?

tidal pine
#

But different floors means different areas πŸ™‚

#

Floor is set of areas, right?

vital ravine
tidal pine