-
Notifications
You must be signed in to change notification settings - Fork 0
/
hottub_switches.yaml
82 lines (79 loc) · 3.07 KB
/
hottub_switches.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
switch:
- platform: template
switches:
hottub_power:
availability_template: "{{ states('sensor.hottub_online') }}"
friendly_name: Power
unique_id: hottub_power
value_template: "{% if state_attr('sensor.hottub_status', 'power') == 1 %}on{% else %}off{% endif %}"
turn_on:
- service: rest_command.hottub_command
data:
hottub_command: turn_on
- delay: 00:00:05
- service: homeassistant.update_entity
entity_id: sensor.hottub_status
turn_off:
- service: rest_command.hottub_command
data:
hottub_command: turn_off
- delay: 00:00:05
- service: homeassistant.update_entity
entity_id: sensor.hottub_status
hottub_filter:
availability_template: "{{ states('sensor.hottub_online') }}"
unique_id: hottub_filter
friendly_name: Filter
value_template: "{% if state_attr('sensor.hottub_status', 'filter_power') == 1 %}on{% else %}off{% endif %}"
turn_on:
- service: rest_command.hottub_command
data:
hottub_command: turn_filter_on
- delay: 00:00:05
- service: homeassistant.update_entity
entity_id: sensor.hottub_status
turn_off:
- service: rest_command.hottub_command
data:
hottub_command: turn_filter_off
- delay: 00:00:05
- service: homeassistant.update_entity
entity_id: sensor.hottub_status
hottub_heat:
availability_template: "{{ states('sensor.hottub_online') }}"
unique_id: Heater
friendly_name: Heater
value_template: "{% if state_attr('sensor.hottub_status', 'heat_power') == 1 %}on{% else %}off{% endif %}"
turn_on:
- service: rest_command.hottub_command
data:
hottub_command: turn_heat_on
- delay: 00:00:05
- service: homeassistant.update_entity
entity_id: sensor.hottub_status
turn_off:
- service: rest_command.hottub_command
data:
hottub_command: turn_heat_off
- delay: 00:00:05
- service: homeassistant.update_entity
entity_id: sensor.hottub_status
hottub_bubbles:
availability_template: "{{ states('sensor.hottub_online') }}"
unique_id: hottub_bubbles
friendly_name: Bubbles
value_template: "{% if state_attr('sensor.hottub_status', 'wave_power') == 1 %}on{% else %}off{% endif %}"
turn_on:
- service: rest_command.hottub_command
data:
hottub_command: turn_wave_on
- delay: 00:00:05
- service: homeassistant.update_entity
entity_id: sensor.hottub_status
turn_off:
- service: rest_command.hottub_command
data:
hottub_command: turn_wave_off
- delay: 00:00:05
- service: homeassistant.update_entity
entity_id: sensor.hottub_status