JSONs.h
10.6 KB
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
#pragma once
// EASYOPENTHERM_MQTT_DISCOVERY_MSG_CLIMATE
// Home Assistant Climate MQTT Discovery Message
// https://www.home-assistant.io/integrations/climate.mqtt/
//
// This JSON is sent to topic "homeassistant/climate/112233445566/climate/config" to automatically configurate a thermostat in Home Assistant
// Before sending this JSON all "112233445566" are replaced by the hexadecimal chip ID, i.e. the same as the MAC address in reverse
// order. Also all 11:22:33:44:55:66 are replaced by the MAC address and #### by the hex value of the least significant 4 bytes of the
// chip ID. Because this is done in place, the exact space in the character array is already reserved.
// All topics MAY begin with "~/". If so "~" must be defined by a key-value pair in this JSON. This is NOT CHECKED by the code.
// The following topics MUST be present. Again this is NOT CHECKED by the code:
// - "current_temperature_topic"
// - "temperature_command_topic"
// - "mode_command_topic"
// - "preset_mode_command_topic"
// - "outside_temperature_command_topic"
// Templates are used to pick out the right value. For the climate entity "current_temperature_topic" is the state topic, associated with the
// template "current_temperature_template".
// A subset of "modes":["auto","off","cool","heat"] is added to the ArduinoJson document depending on the capabilities of the boiler.
// If the boiler is for heating only, ["off","heat"] is added. If the boiler can also cool, the full set is added.
// If topic "mode_state_topic":"~/mode/state" or topic "temperature_state_topic":"~/setpoint/state" is defined the Home Assistant
// Thermostat is not properly updated, because of 'optimistic mode'
// For readability 'pretty' format is used, for saving a few bytes of memory it may also be minified.
char EASYOPENTHERM_MQTT_DISCOVERY_MSG_CLIMATE[] = R"DISCMQTTCLIMATE(
{
"~":"Metriot/EasyOpenTherm/112233445566",
"name":"EasyOpenTherm #### Thermostat",
"unique_id":"Metriot-EasyOpenTherm-112233445566-thermostat",
"device":
{
"identifiers":["112233445566"],
"connections":[["mac","11:22:33:44:55:66"]],
"name":"EasyOpenTherm:boiler ####",
"suggested_area":"Living Room",
"manufacturer":"Metriot",
"model":"EasyOpenTherm:boiler",
"sw_version":"1.0"
},
"precision":0.1,
"temp_step":0.5,
"min_temp":10.0,
"max_temp": 30.0,
"initial":12,
"preset_modes":["eco","away","boost","comfort","home","sleep","activity"],
"preset_mode_command_topic":"~/preset_mode/set",
"current_temperature_topic":"~/climate/state",
"current_temperature_template":"{{value_json.temperature}}",
"temperature_command_topic":"~/setpoint/set",
"temperature_high_state_topic":"~/high_temperature/state",
"temperature_high_command_topic":"~/high_temperature/set",
"temperature_low_state_topic":"~/low_temperature/state",
"temperature_low_command_topic":"~/low_temperature/set",
"modes":[],
"mode_command_topic":"~/mode/set",
"availability_topic":"~/sensors/state",
"availability_template":"{{value_json.climate_available}}",
"payload_available":"ONLINE",
"payload_not_available":"OFFLINE",
"retain":false
}
)DISCMQTTCLIMATE";
// EASYOPENTHERM_MQTT_DISCOVERY_MSG_SETPOINT_SENSOR
// Discovery message for the central heating boiler temperature setpoint sensor. Since the setpoint is computed by the thermostat, this
// sensor is always present in Home Assistant
char EASYOPENTHERM_MQTT_DISCOVERY_MSG_SETPOINT_SENSOR[] = R"DISCMQTTSENSOR(
{
"~":"Metriot/EasyOpenTherm/112233445566",
"name":"EasyOpenTherm #### Boiler Setpoint",
"unique_id":"Metriot-EasyOpenTherm-112233445566-boiler_ch_setpoint",
"device":
{
"identifiers":["112233445566"],
"connections":[["mac","11:22:33:44:55:66"]],
"name":"EasyOpenTherm:boiler ####",
"suggested_area":"Living Room",
"manufacturer":"Metriot",
"model":"EasyOpenTherm:boiler",
"sw_version":"1.0"
},
"device_class":"temperature",
"state_topic":"~/ch_setpoint/state",
"unit_of_measurement":"°C",
"value_template":"{{value_json.ch_setpoint}}",
"retain":false
}
)DISCMQTTSENSOR";
// EASYOPENTHERM_MQTT_DISCOVERY_MSG_FLOW_TEMPERATURE_SENSOR
// Discovery message for the boiler flow temperature sensor. The flow temperature is the temperature of
// the water leaving the boiler.
// This sensor is only added to Home Assistant if it can be read using the OpenTherm interface
char EASYOPENTHERM_MQTT_DISCOVERY_MSG_FLOW_TEMPERATURE_SENSOR[] = R"DISCMQTTSENSOR(
{
"~":"Metriot/EasyOpenTherm/112233445566",
"name":"EasyOpenTherm #### Boiler Flow Temperature",
"unique_id":"Metriot-EasyOpenTherm-112233445566-boiler_flow_temperature",
"device":
{
"identifiers":["112233445566"],
"connections":[["mac","11:22:33:44:55:66"]],
"name":"EasyOpenTherm:boiler ####",
"suggested_area":"Living Room",
"manufacturer":"Metriot",
"model":"EasyOpenTherm:boiler",
"sw_version":"1.0"
},
"device_class":"temperature",
"state_topic":"~/flow_temperature/state",
"unit_of_measurement":"°C",
"value_template":"{{value_json.flow_temperature}}",
"retain":false
}
)DISCMQTTSENSOR";
// EASYOPENTHERM_MQTT_DISCOVERY_MSG_RETURN_TEMPERATURE_SENSOR
// Discovery message for the boiler return temperature sensor. The return temperature is the temperature of
// the water returning to the boiler.
// This sensor is only added to Home Assistant if it can be read using the OpenTherm interface
char EASYOPENTHERM_MQTT_DISCOVERY_MSG_RETURN_TEMPERATURE_SENSOR[] = R"DISCMQTTSENSOR(
{
"~":"Metriot/EasyOpenTherm/112233445566",
"name":"EasyOpenTherm #### Boiler Return Temperature",
"unique_id":"Metriot-EasyOpenTherm-112233445566-boiler_return_temperature",
"device":
{
"identifiers":["112233445566"],
"connections":[["mac","11:22:33:44:55:66"]],
"name":"EasyOpenTherm:boiler ####",
"suggested_area":"Living Room",
"manufacturer":"Metriot",
"model":"EasyOpenTherm:boiler",
"sw_version":"1.0"
},
"device_class":"temperature",
"state_topic":"~/return_temperature/state",
"unit_of_measurement":"°C",
"value_template":"{{value_json.return_temperature}}",
"retain":false
}
)DISCMQTTSENSOR";
// EASYOPENTHERM_MQTT_DISCOVERY_MSG_WATER_PRESSURE_SENSOR
// Discovery message for the boiler water pressure sensor.
// This sensor is only added to Home Assistant if it can be read using the OpenTherm interface
char EASYOPENTHERM_MQTT_DISCOVERY_MSG_WATER_PRESSURE_SENSOR[] = R"DISCMQTTSENSOR(
{
"~":"Metriot/EasyOpenTherm/112233445566",
"name":"EasyOpenTherm #### Boiler Water Pressure",
"unique_id":"Metriot-EasyOpenTherm-112233445566-boiler_water_pressure",
"device":
{
"identifiers":["112233445566"],
"connections":[["mac","11:22:33:44:55:66"]],
"name":"EasyOpenTherm:boiler ####",
"suggested_area":"Living Room",
"manufacturer":"Metriot",
"model":"EasyOpenTherm:boiler",
"sw_version":"1.0"
},
"device_class":"pressure",
"state_topic":"~/water_pressure/state",
"unit_of_measurement":"bar",
"value_template":"{{value_json.water_pressure}}",
"retain":false
}
)DISCMQTTSENSOR";
// EASYOPENTHERM_MQTT_DISCOVERY_MSG_RELATIVE_MODULATION_SENSOR
// Discovery message for the boiler relative modulation sensor.
// This sensor is only added to Home Assistant if it can be read using the OpenTherm interface
char EASYOPENTHERM_MQTT_DISCOVERY_MSG_RELATIVE_MODULATION_SENSOR[] = R"DISCMQTTSENSOR(
{
"~":"Metriot/EasyOpenTherm/112233445566",
"name":"EasyOpenTherm #### Boiler Relative Modulation",
"unique_id":"Metriot-EasyOpenTherm-112233445566-boiler_relative_modulation",
"device":
{
"identifiers":["112233445566"],
"connections":[["mac","11:22:33:44:55:66"]],
"name":"EasyOpenTherm:boiler ####",
"suggested_area":"Living Room",
"manufacturer":"Metriot",
"model":"EasyOpenTherm:boiler",
"sw_version":"1.0"
},
"icon":"mdi:percent-outline",
"state_topic":"~/relative_modulation/state",
"unit_of_measurement":"%",
"value_template":"{{value_json.relative_modulation}}",
"retain":false
}
)DISCMQTTSENSOR";
// EASYOPENTHERM_MQTT_DISCOVERY_MSG_RSSI_SENSOR
// Discovery message for the RSSI signal strength sensor.
// This sensor is always added to Home Assistant
char EASYOPENTHERM_MQTT_DISCOVERY_MSG_RSSI_SENSOR[] = R"DISCMQTTSENSOR(
{
"~":"Metriot/EasyOpenTherm/112233445566",
"name":"EasyOpenTherm #### Thermostat RSSI",
"unique_id":"Metriot-EasyOpenTherm-112233445566-thermostat_rssi",
"device":
{
"identifiers":["112233445566"],
"connections":[["mac","11:22:33:44:55:66"]],
"name":"EasyOpenTherm:boiler ####",
"suggested_area":"Living Room",
"manufacturer":"Metriot",
"model":"EasyOpenTherm:boiler",
"sw_version":"1.0"
},
"device_class":"signal_strength",
"state_topic":"~/RSSI/state",
"unit_of_measurement":"dBm",
"value_template":"{{value_json.RSSI}}",
"retain":false
}
)DISCMQTTSENSOR";
// EASYOPENTHERM_MQTT_DISCOVERY_MSG_FLAME_BINARY_SENSOR
// Discovery message for the boiler flame on / off binary sensor.
// This sensor is always added to Home Assistant
char EASYOPENTHERM_MQTT_DISCOVERY_MSG_FLAME_BINARY_SENSOR[] = R"DISCMQTTSENSOR(
{
"~":"Metriot/EasyOpenTherm/112233445566",
"name":"EasyOpenTherm #### Boiler Flame",
"unique_id":"Metriot-EasyOpenTherm-112233445566-boiler_flame",
"device":
{
"identifiers":["112233445566"],
"connections":[["mac","11:22:33:44:55:66"]],
"name":"EasyOpenTherm:boiler ####",
"suggested_area":"Living Room",
"manufacturer":"Metriot",
"model":"EasyOpenTherm:boiler",
"sw_version":"1.0"
},
"icon":"mdi:fire",
"state_topic":"~/flame/state",
"value_template":"{{value_json.flame}}",
"payload_on":"ON",
"payload_off":"OFF",
"retain":false
}
)DISCMQTTSENSOR";
// EASYOPENTHERM_MQTT_DISCOVERY_MSG_DHW_BINARY_SENSOR
// Discovery message for the boiler Domestic Hot Water on / off binary sensor.
// This sensor is 'on' if the boiler is running for Domestoc Hot Wtaer and 'off' if
// the boiler is running for Central Heating or is not running.
// This sensor is only added to Home Assistant if the boiler supports DHW
char EASYOPENTHERM_MQTT_DISCOVERY_MSG_DHW_BINARY_SENSOR[] = R"DISCMQTTSENSOR(
{
"~":"Metriot/EasyOpenTherm/112233445566",
"name":"EasyOpenTherm #### Boiler Domestic Hot Water",
"unique_id":"Metriot-EasyOpenTherm-112233445566-boiler_DHW",
"device":
{
"identifiers":["112233445566"],
"connections":[["mac","11:22:33:44:55:66"]],
"name":"EasyOpenTherm:boiler ####",
"suggested_area":"Living Room",
"manufacturer":"Metriot",
"model":"EasyOpenTherm:boiler",
"sw_version":"1.0"
},
"icon":"mdi:shower",
"state_topic":"~/dhw/state",
"payload_on":"ON",
"payload_off":"OFF",
"value_template":"{{value_json.dhw}}",
"retain":false
}
)DISCMQTTSENSOR";