-
Notifications
You must be signed in to change notification settings - Fork 2
/
lights.yaml
31 lines (29 loc) · 1.01 KB
/
lights.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- platform: template
lights:
always_on:
friendly_name: 'Always On Light to Prevent Automation Errors'
value_template: true
turn_on:
turn_off:
always_off:
friendly_name: 'Always Off Light to Prevent Automation Errors'
value_template: false
turn_on:
turn_off:
maysons:
friendly_name: "Mayson's Lights"
value_template: "{% if is_state('light.maysons_switch', 'on') %}on{%else%}off{%endif%}"
level_template: "{% if is_state('light.maysons_switch', 'on') %}{{state_attr('light.maysons_switch', 'brightness')}}{%else%}0{%endif%}"
turn_on:
service: light.turn_on
data:
entity_id: light.maysons_switch, light.maysons_outlet
turn_off:
service: light.turn_off
data:
entity_id: light.maysons_switch, light.maysons_outlet
set_level:
service: light.turn_on
entity_id: light.maysons_switch, light.maysons_outlet
data_template:
brightness: '{{ brightness }}'