-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathh801_tobi.yaml
137 lines (115 loc) · 2.44 KB
/
h801_tobi.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
esphome:
name: h801_tobi
platform: ESP8266
board: esp01_1m
wifi:
ssid: !secret wifi-east
password: !secret wifi-pwd
use_address: h801-tobi.ak-online.be
mdns:
disabled: true
captive_portal:
# Enable logging
logger:
logs:
colorloop: info
# Enable Home Assistant API
#api:
mqtt:
broker: mqtt.ak-online.be
discovery: true
topic_prefix: esphome/h801_tobi
ota:
web_server:
port: 80
include_internal: true
button:
- platform: restart
name: restart
sensor:
- platform: wifi_signal
name: "WiFi Signal H801 Tobi"
update_interval: 60s
status_led:
pin:
number: GPIO05
#inverted: True
output:
- platform: esp8266_pwm
pin: 12
frequency: 1000 Hz
id: pwm_b
- platform: esp8266_pwm
pin: 13
frequency: 1000 Hz
id: pwm_r
- platform: esp8266_pwm
pin: 15
frequency: 1000 Hz
id: pwm_g
- platform: esp8266_pwm
pin: 14
frequency: 1000 Hz
id: pwm_w1
- platform: esp8266_pwm
pin: 04
frequency: 1000 Hz
id: pwm_w2
- platform: gpio
pin: 01
id: green_led
#remote_transmitter:
# id: IRTX
# pin: GPIO12
# carrier_duty_percent: 50
light:
- platform: rgb
name: "Tobi Bed Moodlight"
id: moodlight
red: pwm_r
green: pwm_g
blue: pwm_b
effects:
- lambda:
name: "Nothing Effect"
update_interval: 5000ms
lambda: |-
return;
- lambda:
name: "Color Loop"
update_interval: 500ms
lambda: |-
ESPHSVColor hsv;
hsv.value = 255;
hsv.saturation = 240;
static uint16_t hue = 0;
hue++;
if( hue > 360 ){
hue = 0;
}
hsv.hue = hue;
ESP_LOGD("colorloop",
"hue: %d",
hue
);
ESPColor rgb = hsv.to_rgb();
ESP_LOGD("colorloop",
"hue: %d, makes r%dg%db%d",
hue, rgb.r, rgb.g, rgb.b
);
auto call = id(moodlight).turn_on();
call.set_transition_length(500);
call.set_rgb(rgb.r/255.0, rgb.g/255.0, rgb.b/255.0);
call.perform();
# - platform: monochromatic
# name: "downlight"
# output: pwm_w1
# - platform: monochromatic
# name: "shelf-bottom"
# output: pwm_w2
#switch:
# - platform: template
# name: tvon
# turn_on_action:
# - remote_transmitter.transmit_samsung:
# data: 0xE0E040BF