Intent targets to intent_script

Hi, I have intent:

  testovaciIntent:
    data:
      - sentences:
          - "Testovací intent <area>"
        slots:
          domain: light

If I debug this intent:

I have intent_script:

  testovaciIntent:
    action:
      - action: persistent_notification.create
        data:
          message: **Targets entity**

I need works with targets in actions. Is it possible please?

{area} is a variable that is in expansion rule <area>

.
You can use it to create an entity filter

{{ states.light |selectattr('entity_id', 'in', area_entities(area)) |map(attribute='entity_id') |list }}

Thank you… the problem is that “area” can also be an alias for area.

Yes it’s a problem, it was discussed just today

If you have a desire, you can create an issue on github to remind about the problem.

You can use the dictionary in your intent scripts until this is fixed.

you have to define the dict first

    {% set area_alt = area %}
    {% set areadict = {
        "alias1_area1": "area1",
        "alias2_area1": "area1",
        "alias1_area2": "area2",
        "alias1_area3": "area3",
        "alias1_area4": "area4"
      } %}

After that, you can use this condition

area_entities( areadict[area_alt] if area_alt in areadict else area)