-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathswitch.yaml
41 lines (39 loc) · 1.34 KB
/
switch.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
32
33
34
35
36
37
38
39
40
41
- platform: deluge
host: 192.168.1.201
username: !secret deluge_user
password: !secret deluge_pass
# Reolink camera
- platform: template
switches:
hacs_camera_2_ir_lights:
value_template: "{{ is_state_attr('camera.hacs_camera_2', 'ir_lights_enabled', true) }}"
turn_on:
service: camera.enable_ir_lights
data:
entity_id: camera.hacs_camera_2
turn_off:
service: camera.disable_ir_lights
data:
entity_id: camera.hacs_camera_2
icon_template: >-
{% if is_state_attr('camera.hacs_camera_2', 'ir_lights_enabled', true) %}
mdi:flashlight
{% else %}
mdi:flashlight-off
{% endif %}
hacs_camera_2_motion_detection:
value_template: "{{ is_state_attr('camera.hacs_camera_2', 'motion_detection_enabled', true) }}"
turn_on:
service: camera.enable_motion_detection
data:
entity_id: camera.hacs_camera_2
turn_off:
service: camera.disable_motion_detection
data:
entity_id: camera.hacs_camera_2
icon_template: >-
{% if is_state_attr('camera.hacs_camera_2', 'motion_detection_enabled', true) %}
mdi:motion-sensor
{% else %}
mdi:motion-sensor-off
{% endif %}