-
Notifications
You must be signed in to change notification settings - Fork 0
/
nibe.yaml
211 lines (190 loc) · 5.79 KB
/
nibe.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
esphome:
name: nibe
platform: ESP32
board: m5stack-atom
platformio_options:
board_build.partitions: min_spiffs.csv
on_boot:
priority: -100
then:
- lambda: |-
if (id(sgr_channel_1).state) {
if (id(sgr_channel_2).state) {
id(cur_sgr_state).publish_state("Forced on");
ESP_LOGD("on_boot", "SGR forced on");
}
else{
id(cur_sgr_state).publish_state("Advise on");
ESP_LOGD("on_boot", "SGR advise on");
}
}
else {
if (id(sgr_channel_2).state) {
id(cur_sgr_state).publish_state("Block");
ESP_LOGD("on_boot", "SGR block");
}
else{
id(cur_sgr_state).publish_state("Normal operation");
ESP_LOGD("on_boot", "SGR normal operation");
}
}
# Enable logging
logger:
ota:
password: ""
wifi:
ssid: "yourssidhere"
password: "yourpasswordhere"
power_save_mode: none
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Nibe Fallback Hotspot"
password: "cExqZzmxQAGB"
captive_portal:
web_server:
port: 80
switch:
- platform: gpio
pin: 26
id: sgr_channel_1
name: "SGR channel 1"
- platform: gpio
pin: 32
id: sgr_channel_2
name: "SGR channel 2"
text_sensor:
- platform: template
name: "Current SGR state"
id: cur_sgr_state
mqtt:
broker: 192.168.1.59
discovery: true
on_json_message:
- topic: data/devices/heatpump/sgr_mode
then:
- lambda: |-
if (x.containsKey("value")){
if (x["value"] == 0) {
ESP_LOGD("on_json_message", "SGR normal operation");
id(sgr_channel_1).turn_off();
id(sgr_channel_2).turn_off();
id(cur_sgr_state).publish_state("Normal operation");
}
else if (x["value"] == 1) {
ESP_LOGD("on_json_message", "SGR advise on");
id(sgr_channel_1).turn_on();
id(sgr_channel_2).turn_off();
id(cur_sgr_state).publish_state("Advise on");
}
else if (x["value"] == 2) {
ESP_LOGD("on_json_message", "SGR force off");
id(sgr_channel_1).turn_off();
id(sgr_channel_2).turn_on();
id(cur_sgr_state).publish_state("Block");
}
else if (x["value"] == 3) {
ESP_LOGD("on_json_message", "SGR force on");
id(sgr_channel_1).turn_on();
id(sgr_channel_2).turn_on();
id(cur_sgr_state).publish_state("Forced on");
}
else {
ESP_LOGD("on_json_message", "SGR invalid state");
}
}
- topic: set/devices/heatpump/sgr_chan_1
then:
- lambda: |-
if (x.containsKey("value")){
if (x["value"] == "on") {
ESP_LOGD("on_json_message", "Found on");
id(sgr_channel_1).turn_on();
}
else if (x["value"] == "off") {
ESP_LOGD("on_json_message", "Found off");
id(sgr_channel_1).turn_off();
}
else {
ESP_LOGD("on_json_message", "Found something else");
}
}
- topic: set/devices/heatpump/sgr_chan_2
then:
- lambda: |-
if (x.containsKey("value")){
if (x["value"] == "on") {
ESP_LOGD("on_json_message", "Found on");
id(sgr_channel_2).turn_on();
}
else if (x["value"] == "off") {
ESP_LOGD("on_json_message", "Found off");
id(sgr_channel_2).turn_off();
}
else {
ESP_LOGD("on_json_message", "Found something else");
}
}
external_components:
- source:
type: git
url: https://github.com/elupus/esphome-nibe.git
components: [ nibegw ]
uart:
id: my_uart
rx_pin: GPIO22
tx_pin: GPIO19
baud_rate: 9600
nibegw:
# If you have a named uart instance, you can specify this here.
uart_id: my_uart
udp:
# The target address(s) to send data to. May also be multicast addresses.
target:
- ip: 192.168.1.59
port: 9999
# List of source address to accept read/write from, may be empty for no filter, but
# this is not recommended.
source:
# Optional port this device will listen to to receive read requests. Defaults to 9999
read_port: 9999
# Optional port this device will listen to to receive write request. Defaults to 10000
write_port: 10000
acknowledge:
- MODBUS40
# Enable a dummy RMU40 accessory to receive updates
# to certain registers faster. This should not be
# enabled if you have an actual RMU40.
- RMU40_S4
# Constant replies to certain requests can be made
constants:
- address: MODBUS40
token: ACCESSORY
data: [
0x0A, # MODBUS version low
0x00, # MODBUS version high
0x02, # MODBUS address?
]
# Accessory version response
- address: RMU40_S4
token: ACCESSORY
data: [
0xEE, # RMU ?
0x03, # RMU version low
0x01, # RMU version high
]
# Unknown response that nibepi uses
- address: RMU40_S4
token: RMU_DATA
command: RMU_WRITE
data: [
0x63,
0x00,
]
# Constant fixed temperature to avoid pump going into alarm.
- address: RMU40_S4
token: RMU_WRITE
data: [
0x06, # Temperature
0x14, # degrees low
0x00, # degrees hight
]