Created
August 17, 2021 11:20
-
-
Save grillp/443f9a79e6e74cf8768bb8a4c942c613 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
blueprint: | |
name: Timed Light with lock | |
description: Define a timed light with a delayed turn off, with the ability to lock the light on using an Tasmotta , TRIPLE or QUAD click | |
domain: automation | |
input: | |
target_light: | |
name: Light | |
description: The Light | |
selector: | |
entity: | |
domain: light | |
delay: | |
name: Delay | |
description: The delay in minutes before switching off the light | |
selector: | |
number: | |
min: 5 | |
max: 120 | |
mode: slider | |
unit_of_measurement: minutes | |
step: 5 | |
mqtt_message: | |
name: MQTT Message | |
description: The Tasmota multi-tap MQTT Message that will lock the light on (e.g. stat/tasmota_999999/BUTTON1T) | |
selector: | |
text: | |
trigger_type: | |
name: the type of Tasmota multi-tap | |
description: The type of multi-tap | |
selector: | |
select: | |
options: | |
- DOUBLE | |
- TRIPLE | |
- QUAD | |
trigger: | |
- platform: state | |
entity_id: !input target_light | |
to: "on" | |
id: "trig_on_single" | |
- platform: mqtt | |
topic: !input mqtt_message | |
value_template: "{{ value_json.TRIG }}" | |
payload: !input trigger_type | |
action: | |
- service: automation.turn_off | |
target: | |
entity_id: "{{ this.entity_id }}" | |
data: | |
stop_actions: false | |
- service: light.turn_on | |
target: | |
entity_id: !input target_light | |
- delay: | |
milliseconds: 100 | |
- service: automation.turn_on | |
target: | |
entity_id: "{{ this.entity_id }}" | |
- condition: trigger | |
id: "trig_on_single" | |
- delay: | |
minutes: !input delay | |
- service: light.turn_off | |
target: | |
entity_id: !input target_light | |
data: {} | |
mode: restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment