Untitled

 avatar
unknown
plain_text
2 years ago
1.6 kB
2
Indexable
alias: Upozornenie na otvorené dvere
description: ""
trigger:
  - platform: state
    entity_id: group.dvere_grp
    to: "on"
    id: zabudnute
    for:
      hours: 0
      minutes: "{{ states(\"input_number.casovac_1_dvere\")|int }}"
      seconds: 0
  - platform: state
    entity_id: group.dvere_grp
    to: "on"
    for:
      hours: 0
      minutes: "{{ states(\"input_number.casovac_2_dvere\")|int }}"
      seconds: 0
    id: zabudnute15
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: zabudnute
        sequence:
          - service: notify.mobile_app_mi_8
            data:
              title: Otvorené dvere - {{ now().hour~now().strftime(':%M') }}
              message: >-
                Dvere {{ expand(states.group.dvere_grp) | selectattr('state',
                'eq', 'on') | map(attribute='name') | list | replace ("'", "") 
                }} sú otvorené viac ako {{
                states("input_number.casovac_1_dvere")|int }} min
      - conditions:
          - condition: trigger
            id: zabudnute15
        sequence:
          - service: notify.mobile_app_mi_8
            data:
              title: Otvorené dvere - {{ now().hour~now().strftime(':%M') }}
              message: >-
                Dvere {{ expand(states.group.dvere_grp) | selectattr('state',
                'eq', 'on') | map(attribute='name') | list | replace ("'", "") 
                }} sú otvorené viac ako {{
                states("input_number.casovac_2_dvere")|int }} min
    default: []
mode: single