#Refining exposed areas/devices?

1 messages · Page 1 of 1 (latest)

fading pilot
#

Hey folks, I've been playing a lot lately with Voice on HomeAssistant with Ollama and I've noticed that sometimes it will respond with devices that it doesn't have control of. I have only exposed items in my office to Assist, but when I look at the instructions in the conversation agent options it lists out every area and device in my house, even if assist doesn't have access. I forget exactly where I got this from but I think it was a default example from HA.

An overview of the areas and the devices in this smart home:
{%- for area in areas() %}
  {%- set area_info = namespace(printed=false) %}
  {%- for device in area_devices(area) -%}
    {%- if not device_attr(device, "disabled_by") and not device_attr(device, "entry_type") and device_attr(device, "name") %}
      {%- if not area_info.printed %}

{{ area_name(area) }}:
        {%- set area_info.printed = true %}
      {%- endif %}
- {{ device_attr(device, "name") }}{% if device_attr(device, "model") and (device_attr(device, "model") | string) not in (device_attr(device, "name") | string) %} ({{ device_attr(device, "model") }}){% endif %}
{{ states.light.device.attributes }}

    {%- endif %}
  {%- endfor %}
{%- endfor %}```

Is it possible to refine this to only list areas IF they have a device with entities that have been exposed to Assist? I think this will probably refine the behaviours of Assist/Ollama quite significantly and improve performance.

Thanks!
#

Refining exposed areas/devices?

#

I'm guessing we need to look at the expose settings? Perhaps there is a way to loop through that and THEN through the rooms?

agile narwhal
#

hm so that above prompt isn't what the stock ollama integration would give in the integration config, it's usually just a simple two line prompt and doesn't list the entities. Those are internally apended to the prompt I think

fading pilot
#

hmmmm so am I exposing my devices twice? 😄

#

I think I was originally using OpenAI and I had this setup and then moved over to Ollama later and just copied this right over 😄

#

I just removed all of this and then asked Assist what areasit controled and it gave me just my office which is correct!

fading pilot
#

Thanks for pointing me in the right direction @agile narwhal !