initial commit
This commit is contained in:
38
configuration/automation/occupants_kitchen.yaml
Normal file
38
configuration/automation/occupants_kitchen.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
---
|
||||
- alias: 'Trip Wire #01 > AB'
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.tripwire_10521c66d2e8_direction
|
||||
to: "AB"
|
||||
action:
|
||||
- service: input_number.set_value
|
||||
data_template:
|
||||
entity_id: input_number.occupants_kitchen
|
||||
value: '{{ (states.input_number.occupants_kitchen.state | int ) + 1 }}'
|
||||
|
||||
- alias: 'Trip Wire #01 > BA'
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.tripwire_10521c66d2e8_direction
|
||||
to: "BA"
|
||||
action:
|
||||
- service: input_number.set_value
|
||||
data_template:
|
||||
entity_id: input_number.occupants_kitchen
|
||||
value: '{{ (states.input_number.occupants_kitchen.state | int ) - 1 }}'
|
||||
|
||||
- alias: "Set Kitchen Occupancy to True"
|
||||
trigger:
|
||||
platform: template
|
||||
value_template: '{{ (states.input_number.occupants_kitchen.state | int ) > 0 }}'
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.occupancy_kitchen
|
||||
|
||||
- alias: "Set Kitchen Occupancy to False"
|
||||
trigger:
|
||||
platform: template
|
||||
value_template: '{{ (states.input_number.occupants_kitchen.state | int ) == 0 }}'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.occupancy_kitchen
|
Reference in New Issue
Block a user