-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathledstreifen-holzklotz.yaml
90 lines (78 loc) · 1.79 KB
/
ledstreifen-holzklotz.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
esphome:
name: ledstreifen-holzklotz
friendly_name: ledstreifen_holzklotz
esp32:
board: esp32-s2-saola-1
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "lIuGugE9HUrO/bV5u4obhlNWloA4PZR8NPmqbOWBicg="
mqtt:
broker: mqtt.int.vspace.one
ota:
platform: esphome
password: "b6b51aff08747dfa848a5cff3f7e2925"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 10.0.8.22
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: "Ledstreifen-Holzklotz"
password: "nGdzuMiLEVmZ"
captive_portal:
status_led:
pin:
number: 3
inverted: True
light:
- platform: rgb
name: "Lichtstreifen Holzklotz"
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: ledc
id: g
frequency: 9765Hz
pin:
number: 5
inverted: True
- platform: ledc
id: r
frequency: 9765Hz
pin:
number: 43
inverted: True
- platform: ledc
id: b
frequency: 9765Hz
pin:
number: 9
inverted: False