-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlichtstreifen-perfboard-1.yaml
83 lines (72 loc) · 1.73 KB
/
lichtstreifen-perfboard-1.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
esphome:
name: lichtstreifen-perfboard-1
friendly_name: lichtstreifen_perfboard_1
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "fZzIQl14FaubX3G8+hd2m0hcd9ZxkxR0uW9ri9xySRY="
mqtt:
broker: mqtt.int.vspace.one
ota:
platform: esphome
password: "c495198a086e0fa20c36f627857a0b0c"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 10.0.8.21
subnet: 255.255.252.0
gateway: 10.0.8.1
dns1: 10.0.8.1
dns2: 1.1.1.1
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Lichtstreifen-Perfboard-1"
password: "r7pARFN42fyB"
captive_portal:
light:
- platform: rgb
name: "Lichtstreifen Wabbel"
red: r
green: g
blue: b
id: strip
effects:
- lambda:
name: Slow Rainbow
update_interval: 1s
lambda: |-
const float cycle_time = 12;
auto call = id(strip).turn_on();
call.set_publish(false);
call.set_save(false);
call.set_transition_length(1000);
float t = fmod((3 * millis())/(cycle_time * 1000), 3);
float i = fmod(t,1);
if (0 <= t && t <= 1) call.set_rgb(i, 0, 1-i);
else if (1 <= t && t <= 2) call.set_rgb(1-i, i, 0);
else if (2 <= t && t <= 3) call.set_rgb(0, 1-i, i);
call.perform();
output:
- platform: esp8266_pwm
id: g
frequency: 5000Hz
pin:
number: 0
inverted: True
- platform: esp8266_pwm
id: r
frequency: 5000Hz
pin:
number: 2
inverted: True
- platform: esp8266_pwm
id: b
frequency: 5000Hz
pin:
number: RX
inverted: False