-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathbasement-bath-shower-light-heat.yaml
More file actions
96 lines (89 loc) · 2.14 KB
/
Copy pathbasement-bath-shower-light-heat.yaml
File metadata and controls
96 lines (89 loc) · 2.14 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
substitutions:
device_id: basement-bath-shower-light-heat
device_name: Basement Bathroom Shower Light and Heater
board: esp01_1m
api_key: !secret basement_bathroom_shower_light_heat_key
pwd: !secret basement_bathroom_shower_light_heat_pwd
packages:
device_base: !include ./packages/device_base_esp8266.yaml
binary_sensor:
- platform: gpio
id: light_button
pin:
number: 12
mode: INPUT_PULLUP
on_press:
then:
- light.toggle: shower_light
- platform: gpio
id: heater_button
pin:
number: 3
mode: INPUT_PULLUP
on_press:
then:
- switch.toggle: heater
light:
- platform: binary
id: shower_light
name: Basement Shower Light
output: light_output
on_turn_on:
- component.update: shower_light_power
on_turn_off:
- component.update: shower_light_power
output:
- platform: gpio
id: light_output
pin: 13
status_led:
pin:
number: 0
inverted: true
switch:
- platform: gpio
id: heater
name: Basement Bathroom Heater
icon: mdi:radiator
pin: 4
on_turn_on:
- component.update: heater_power
on_turn_off:
- component.update: heater_power
sensor:
- platform: template
id: shower_light_power
name: Basement Shower Light Power
unit_of_measurement: "W"
device_class: power
state_class: measurement
accuracy_decimals: 1
update_interval: never
lambda: |-
return id(shower_light).current_values.is_on() ? 11.5 : 0.0;
filters:
- heartbeat:
period: 10s
optimistic: true
- platform: template
id: heater_power
name: Basement Bathroom Heater Power
unit_of_measurement: "W"
device_class: power
state_class: measurement
accuracy_decimals: 1
update_interval: never
lambda: |-
return id(heater).state ? 500.0 : 0.0;
filters:
- heartbeat:
period: 10s
optimistic: true
- platform: total_daily_energy
name: Basement Shower Light
power_id: shower_light_power
method: left
- platform: total_daily_energy
name: Basement Bathroom Heater
power_id: heater_power
method: left