######################################################################
##  Shut it all down.  No one is here
######################################################################

- alias: 'Away Mode'
  trigger:
    - platform: state
      entity_id: binary_sensor.downstairs_away_mode
      to: 'True'
    - platform: state
      entity_id: group.family
      to: 'not_home'
    - platform: state
      entity_id: input_boolean.good_night
      to: 'on'
    - platform: event
      #Sent from IFTTT Webhooks : {"action":"IFTTT_Away:}
      event_type: ifttt_webhook_received
      event_data:
        action: IFTTT_Away


  condition:
    - condition: state
      entity_id: group.family
      state: 'not_home'
    - condition: state
      entity_id: input_boolean.guest_mode
      state: 'off'

  action:
    - service: script.interior_off
    - service: switch.turn_off
      entity_id: switch.back_landscaping
    - service: input_boolean.turn_off
      entity_id: input_boolean.good_night