-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnobo.yaml
118 lines (104 loc) · 2.67 KB
/
nobo.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
esphome:
name: nobo
on_boot:
then:
- light.turn_on: ledlight
- light.control:
id: ledlight
effect: Connection
esp8266:
board: d1_mini_lite
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !secret ha_token
ota:
password: !secret ha_pwd
wifi:
ssid: !secret net_name
password: !secret net_pass
on_connect:
- light.turn_on: ledlight
- light.control:
id: ledlight
effect: StatusIndicator
on_disconnect:
- light.turn_on: ledlight
- light.control:
id: ledlight
effect: Connection
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Nobo Fallback Hotspot"
password: "3QmeXUbBbO85"
captive_portal:
# Example configuration entry
web_server:
port: 80
external_components:
- source:
type: local
path: components
climate:
- platform: nobo
id: noboheater
name: "Nobo Heater LivingRoom"
nominal_power: 2000 W
power:
name: "Nobo Heater Power LivingRoom"
id: nobopower
update_interval: 30s
i2c:
sda: GPIO4
scl: GPIO5
scan: False
frequency: 50kHz
light:
- platform: neopixelbus
name: "Nobo neo light"
id: ledlight
type: GRB
variant: WS2812
pin: GPIO15
num_leds: 1
effects:
- flicker:
name: Flicker Effect With Custom Values
alpha: 95%
intensity: 1.5%
- lambda:
name: StatusIndicator
update_interval: 1s
lambda: |-
float current_power = id(noboheater).get_heater_power_percentage();
auto call = id(ledlight).make_call();
call.set_transition_length(1);
float cold_color[3]={0.22,0.77,1.0};
float mid_color[3]={1.0,0.77,0.0};
float warm_color[3]={1.0,0.11,0.06};
float mid_point=0.5*100;
float current_color[3];
if(current_power<mid_point) {
for(int ii=0;ii<3;ii++) {
current_color[ii]=cold_color[ii]+(mid_color[ii]-cold_color[ii])*current_power/mid_point;
}
} else {
for(int ii=0;ii<3;ii++) {
current_color[ii]=mid_color[ii]+(warm_color[ii]-mid_color[ii])*(current_power-mid_point)/mid_point;
}
}
call.set_rgb(current_color[0],current_color[1],current_color[2]);
call.perform();
- strobe:
name: Connection
colors:
- state: true
brightness: 100%
red: 22%
green: 77%
blue: 100%
duration: 400ms
- state: false
duration: 400ms