Created
October 18, 2020 17:53
-
-
Save bessarabov/423cf1a65814666d8b1a4cdaebd571ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
timer: | |
toilet: | |
automation: | |
- alias: Turn on light in the toilet by aqara sensor motion | |
trigger: | |
platform: mqtt | |
topic: zigbee2mqtt/0x00158d0004518e15 | |
condition: | |
condition: template | |
value_template: "{{ trigger.payload_json.occupancy }}" | |
action: | |
- service: light.turn_on | |
data_template: | |
entity_id: light.0xccccccfffe00418e_light | |
brightness: "{% if is_state('binary_sensor.night', 'on') %}1{% else %}255{% endif %}" | |
- service: timer.cancel | |
data: | |
entity_id: timer.toilet | |
- service: timer.start | |
data: | |
entity_id: timer.toilet | |
duration: "0:05:00" | |
- alias: Turn off light in the toilet by timer | |
trigger: | |
- platform: event | |
event_type: timer.finished | |
event_data: | |
entity_id: timer.toilet | |
action: | |
- service: light.turn_off | |
data: | |
entity_id: light.0xccccccfffe00418e_light |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment