Unverified Commit 6d024fe2 authored by Dmitriy Safronov's avatar Dmitriy Safronov Committed by GitHub
Browse files

logger (#3)

parent ae5d32c8
Loading
Loading
Loading
Loading
+28 −6
Original line number Diff line number Diff line
@@ -83,12 +83,19 @@ action:
          - service: light.turn_off
            target:
              entity_id: !input entity_target
          - service: logbook.log
            data_template:
              name: "Blueprint #"
              message: "Condition: trigger - timer finished; Action: light turned off"
      - conditions:
          - condition: trigger
            id: motion
          - condition: state
            entity_id: !input entity_trigger
            state: "on"
          - condition: state
            entity_id: !input entity_target
            state: "off"
          - condition: numeric_state
            entity_id: !input entity_illuminance
            below: !input entity_illuminance_value
@@ -99,15 +106,16 @@ action:
          - service: light.turn_on
            target:
              entity_id: !input entity_target
          - service: timer.cancel
            target:
              entity_id: !input timer_no_motion
          - service: logbook.log
            data_template:
              name: "Blueprint #"
              message: "Condition: trigger - motion started at dark; Action: light turned on."
      - conditions:
          - condition: trigger
            id: motion
          - condition: state
            entity_id: !input entity_trigger
            state: "off"
            state: "on"
          - condition: state
            entity_id: !input entity_target
            state: "on"
@@ -118,18 +126,24 @@ action:
          - service: timer.start
            target:
              entity_id: !input timer_no_motion
          - service: logbook.log
            data_template:
              name: "Blueprint #"
              message: "Condition: trigger - motion started at light; Action: timer (re)started."
      - conditions:
          - condition: trigger
            id: light
          - condition: state
            entity_id: !input entity_target
            state: "on"
          - condition: template
            value_template: "{{ trigger.to_state.context.parent_id == none }}"
        sequence:
          - service: timer.start
            target:
              entity_id: !input timer_no_motion
          - service: logbook.log
            data_template:
              name: "Blueprint #"
              message: "Condition: trigger - light started; Action: timer started"
      - conditions:
          - condition: trigger
            id: light
@@ -140,6 +154,10 @@ action:
          - service: timer.cancel
            target:
              entity_id: !input timer_no_motion
          - service: logbook.log
            data_template:
              name: "Blueprint #"
              message: "Condition: trigger - light stopped; Action: timer cancelled"
      - conditions:
          - condition: trigger
            id: light_main
@@ -153,3 +171,7 @@ action:
          - service: timer.cancel
            target:
              entity_id: !input timer_no_motion
          - service: logbook.log
            data_template:
              name: "Blueprint #"
              message: "Condition: trigger - main light started; Action: light stopped, timer cancelled"