Detect Guest Mode - Off

View All Rules

alias: Detect Guest Mode - Off
trigger:
  platform: state
  entity_id:
    - person.john
    - person.maureen
    - person.allan
    - person.colin
    - person.irene
    - person.kayleigh
    - person.kev
    - person.khristen
    - person.mecha
    - person.scott
    - person.steve
  from: home
condition:
  condition: and
  conditions:
    - condition: template
      value_template: "{{ states.person.john.state != 'home' }}"
    - condition: template
      value_template: "{{ states.person.maureen.state != 'home' }}"
    - condition: template
      value_template: "{{ states.person.allan.state != 'home' }}"
    - condition: template
      value_template: "{{ states.person.colin.state != 'home' }}"
    - condition: template
      value_template: "{{ states.person.irene.state != 'home' }}"
    - condition: template
      value_template: "{{ states.person.kayleigh.state != 'home' }}"
    - condition: template
      value_template: "{{ states.person.kev.state != 'home' }}"
    - condition: template
      value_template: "{{ states.person.khristen.state != 'home' }}"
    - condition: template
      value_template: "{{ states.person.mecha.state != 'home' }}"
    - condition: template
      value_template: "{{ states.person.scott.state != 'home' }}"
    - condition: template
      value_template: "{{ states.person.steve.state != 'home' }}"
action:
  - service: input_boolean.turn_off
    data:
      entity_id: input_boolean.guest_mode
  - service: script.notify_engine
    data_template:
      channel: "visitorlog"
      value1: 'All your guest have left.'
      value2: "I've turned off guest mode"
  - condition: or
    conditions:
      - condition: state
        entity_id: input_boolean.text_notifications
        state: 'on'
  - service: notify.signal_stuart
    data:
      message: "I've turned off guest mode"

© 2020. Some rights reserved. The contents of this site is released under a Creative Commons Attribution-Share Alike license.