Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106312

How can I use variable names in automation for an entity_id?

$
0
0

Hi all,

I would like to use a trigger variable as an entity id. I have following entities:
kamera_einfahrt_bewegung, kamera_tuerklingel_person and kamera_garten_personen

When trying to use entity_id: input_boolean.kamera_{{ trigger.id }}, while trigger_id I get the following error message when trying to save my automation:

Message malformed: Entity input_boolean.kamera_{{ trigger.id }} is neither a valid entity ID nor a valid UUID for dictionary value @ data['conditions'][0]['entity_id']

Here is the full code of my automation. Any ideas, how I

alias: Push - Einfahrt Bewegung
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.einfahrt_tuerklingel_bewegung
    to: "on"
    id: "einfahrt_bewegung"
  - trigger: state
    entity_id:
      - binary_sensor.einfahrt_tuerklingel_fahrzeug
    to: "on"
    id: "einfahrt_bewegung"
  - trigger: state
    entity_id:
      - binary_sensor.einfahrt_tuerklingel_person
    to: "on"
    id: "einfahrt_bewegung"
  - trigger: state
    entity_id:
      - binary_sensor.reolink_garten_rlc_843_tier
    to: "on"
    id: "garten_tiere"
  - trigger: state
    entity_id:
      - binary_sensor.reolink_garten_rlc_843_person
    to: "on"
    id: "garten_personen"
conditions:
  - condition: state
    entity_id: input_boolean.kamera_{{ trigger.id }}
    state: "on"
actions:
  - action: notify.mobile_app_oneplus12
    enabled: true
    data:
      message: {{ trigger.id }}
      data:
        url: /dashboard-kameras/0
        actions:
          - action: URI
            title: Open
            destructive: true
            uri: /dashboard-kameras/0
mode: single

3 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 106312

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>