• 1 Post
  • 39 Comments
Joined 1 year ago
cake
Cake day: April 24th, 2023

help-circle
  • How I keep that sort of thing in a single automation is by using trigger IDs and a service call with a template for said trigger id.

    Something like this:

    alias: Hallway Motion Light
    description: ""
    trigger:
      - platform: state
        entity_id:
          - binary_sensor.hallway_motion_occupancy
        to: "on"
        id: "on"
      - platform: state
        entity_id:
          - binary_sensor.hallway_motion_occupancy
        to: "off"
        id: "off"
        for:
          hours: 0
          minutes: 1
          seconds: 0
    condition: []
    action:
      - service: light.turn_{{ trigger.id }}
        data:
          transition: 3
        target:
          entity_id: light.hallway_light_2_2
    mode: single
    
    









  • I did just check to see if you can pass along wildcards in an automation, which you can! I used this automation:

    alias: sentence test
    description:
    trigger:
      - platform: conversation
        command:
          - When is [my] {date}
    condition: []
    action:
      - set_conversation_response: curses, that damnable {{ trigger.slots.game }}
        enabled: false
      - choose:
          - conditions:
              - condition: template
                value_template: '{{ ''birthday'' in trigger.slots.date }}'
            sequence:
              - set_conversation_response: >-
                  curses, that damnable {{ trigger.slots.date }}! It completely
                  slipped my mind
          - conditions:
              - condition: template
                value_template: '{{ ''christmas'' in trigger.slots.date }}'
            sequence:
              - set_conversation_response: sir you know when {{ trigger.slots.date }} is!
    

    This should give you a framework to build off of. It looks like when you don’t define a list of slots in an intent it just passes the wildcard along in a slot.