2 * Copyright (c) 2010-2022 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.shelly.internal;
15 import java.util.Collections;
17 import java.util.stream.Collectors;
18 import java.util.stream.Stream;
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.openhab.core.thing.ThingTypeUID;
24 * The {@link ShellyBindingConstants} class defines common constants, which are
25 * used across the whole binding.
27 * @author Markus Michels - Initial contribution
30 public class ShellyBindingConstants {
32 public static final String VENDOR = "Shelly";
33 public static final String BINDING_ID = "shelly";
34 public static final String SYSTEM_ID = "system";
37 public static final String THING_TYPE_SHELLY1_STR = "shelly1";
38 public static final String THING_TYPE_SHELLY1L_STR = "shelly1l";
39 public static final String THING_TYPE_SHELLY1PM_STR = "shelly1pm";
40 public static final String THING_TYPE_SHELLYEM_STR = "shellyem";
41 public static final String THING_TYPE_SHELLY3EM_STR = "shellyem3"; // bad: misspelled product name, it's 3EM
42 public static final String THING_TYPE_SHELLY2_PREFIX = "shellyswitch";
43 public static final String THING_TYPE_SHELLY2_RELAY_STR = "shelly2-relay";
44 public static final String THING_TYPE_SHELLY2_ROLLER_STR = "shelly2-roller";
45 public static final String THING_TYPE_SHELLY25_PREFIX = "shellyswitch25";
46 public static final String THING_TYPE_SHELLY25_RELAY_STR = "shelly25-relay";
47 public static final String THING_TYPE_SHELLY25_ROLLER_STR = "shelly25-roller";
48 public static final String THING_TYPE_SHELLY4PRO_STR = "shelly4pro";
49 public static final String THING_TYPE_SHELLYPLUG_STR = "shellyplug";
50 public static final String THING_TYPE_SHELLYPLUGS_STR = "shellyplugs";
51 public static final String THING_TYPE_SHELLYPLUGU1_STR = "shellyplugu1"; // Shely Plug US
52 public static final String THING_TYPE_SHELLYDIMMER_STR = "shellydimmer";
53 public static final String THING_TYPE_SHELLYDIMMER2_STR = "shellydimmer2";
54 public static final String THING_TYPE_SHELLYIX3_STR = "shellyix3";
55 public static final String THING_TYPE_SHELLYBULB_STR = "shellybulb";
56 public static final String THING_TYPE_SHELLYDUO_STR = "shellybulbduo";
57 public static final String THING_TYPE_SHELLYVINTAGE_STR = "shellyvintage";
58 public static final String THING_TYPE_SHELLYRGBW2_PREFIX = "shellyrgbw2";
59 public static final String THING_TYPE_SHELLYRGBW2_COLOR_STR = THING_TYPE_SHELLYRGBW2_PREFIX + "-color";
60 public static final String THING_TYPE_SHELLYRGBW2_WHITE_STR = THING_TYPE_SHELLYRGBW2_PREFIX + "-white";
61 public static final String THING_TYPE_SHELLYDUORGBW_STR = "shellycolorbulb";
62 public static final String THING_TYPE_SHELLYHT_STR = "shellyht";
63 public static final String THING_TYPE_SHELLYSMOKE_STR = "shellysmoke";
64 public static final String THING_TYPE_SHELLYGAS_STR = "shellygas";
65 public static final String THING_TYPE_SHELLYFLOOD_STR = "shellyflood";
66 public static final String THING_TYPE_SHELLYDOORWIN_STR = "shellydw";
67 public static final String THING_TYPE_SHELLYDOORWIN2_STR = "shellydw2";
68 public static final String THING_TYPE_SHELLYEYE_STR = "shellyseye";
69 public static final String THING_TYPE_SHELLYSENSE_STR = "shellysense";
70 public static final String THING_TYPE_SHELLYTRV_STR = "shellytrv";
71 public static final String THING_TYPE_SHELLYMOTION_STR = "shellymotion";
72 public static final String THING_TYPE_SHELLYMOTION2_STR = "shellymotion2";
73 public static final String THING_TYPE_SHELLYBUTTON1_STR = "shellybutton1";
74 public static final String THING_TYPE_SHELLYBUTTON2_STR = "shellybutton2";
75 public static final String THING_TYPE_SHELLYUNI_STR = "shellyuni";
77 // Shelly Plus Seriens
78 public static final String THING_TYPE_SHELLYPLUS1_STR = "shellyplus1";
79 public static final String THING_TYPE_SHELLYPLUS1PM_STR = "shellyplus1pm";
80 public static final String THING_TYPE_SHELLYPLUS2PM_RELAY_STR = "shellyplus2pm-relay";
81 public static final String THING_TYPE_SHELLYPLUS2PM_ROLLER_STR = "shellyplus2pm-roller";
82 public static final String THING_TYPE_SHELLYPLUSI4_STR = "shellyplusi4";
83 public static final String THING_TYPE_SHELLYPLUSHT_STR = "shellyplusht";
84 public static final String THING_TYPE_SHELLYPLUSPLUGUS_STR = "shellyplusplugus";
87 public static final String THING_TYPE_SHELLYPRO1_STR = "shellypro1";
88 public static final String THING_TYPE_SHELLYPRO1PM_STR = "shellypro1pm";
89 public static final String THING_TYPE_SHELLYPRO2_RELAY_STR = "shellypro2-relay";
90 public static final String THING_TYPE_SHELLYPRO2_ROLLER_STR = "shellypro2-roller";
91 public static final String THING_TYPE_SHELLYPRO2PM_RELAY_STR = "shellypro2pm-relay";
92 public static final String THING_TYPE_SHELLYPRO2PM_ROLLER_STR = "shellypro2pm-roller";
93 public static final String THING_TYPE_SHELLYPRO4PM_STR = "shellypro4pm";
95 public static final String THING_TYPE_SHELLYPROTECTED_STR = "shellydevice";
96 public static final String THING_TYPE_SHELLYUNKNOWN_STR = "shellyunknown";
99 public static final String SHELLYDT_1 = "SHSW-1";
100 public static final String SHELLYDT_1PM = "SHSW-PM";
101 public static final String SHELLYDT_1L = "SHSW-L";
102 public static final String SHELLYDT_SHPLG = "SHPLG-1";
103 public static final String SHELLYDT_SHPLG_S = "SHPLG-S";
104 public static final String SHELLYDT_SHPLG_U1 = "SHPLG-U1";
105 public static final String SHELLYDT_SHELLY2 = "SHSW-21";
106 public static final String SHELLYDT_SHELLY25 = "SHSW-25";
107 public static final String SHELLYDT_SHPRO = "SHSW-44";
108 public static final String SHELLYDT_EM = "SHEM";
109 public static final String SHELLYDT_3EM = "SHEM-3";
110 public static final String SHELLYDT_HT = "SHHT-1";
111 public static final String SHELLYDT_DW = "SHDW-1";
112 public static final String SHELLYDT_DW2 = "SHDW-2";
113 public static final String SHELLYDT_SENSE = "SHSEN-1";
114 public static final String SHELLYDT_MOTION = "SHMOS-01";
115 public static final String SHELLYDT_MOTION2 = "SHMOS-02";
116 public static final String SHELLYDT_GAS = "SHGS-1";
117 public static final String SHELLYDT_DIMMER = "SHDM-1";
118 public static final String SHELLYDT_DIMMER2 = "SHDM-2";
119 public static final String SHELLYDT_IX3 = "SHIX3-1";
120 public static final String SHELLYDT_BULB = "SHBLB-1";
121 public static final String SHELLYDT_DUO = "SHBDUO-1";
122 public static final String SHELLYDT_DUORGBW = "SHCB-1";
123 public static final String SHELLYDT_VINTAGE = "SHVIN-1";
124 public static final String SHELLYDT_RGBW2 = "SHRGBW2";
125 public static final String SHELLYDT_BUTTON1 = "SHBTN-1";
126 public static final String SHELLYDT_BUTTON2 = "SHBTN-2";
127 public static final String SHELLYDT_UNI = "SHUNI-1";
128 public static final String SHELLYDT_TRV = "SHTRV-01";
130 // Shelly Plus Series
131 public static final String SHELLYDT_PLUS1 = "SNSW-001X16EU";
132 public static final String SHELLYDT_PLUS1PM = "SNSW-001P16EU";
133 public static final String SHELLYDT_PLUS2PM_RELAY = "SNSW-002P16EU-relay";
134 public static final String SHELLYDT_PLUS2PM_ROLLER = "SNSW-002P16EU-roller";
135 public static final String SHELLYDT_PLUSPLUGUS = "SNPL-00116US";
136 public static final String SHELLYDT_PLUSI4 = "SNSN-0024X";
137 public static final String SHELLYDT_PLUSHT = "SNSN-0013A";
140 public static final String SHELLYDT_PRO1 = "SPSW-001XE16EU";
141 public static final String SHELLYDT_PRO1PM = "SPSW-001PE16EU";
142 public static final String SHELLYDT_PRO2_RELAY = "SPSW-002XE16EU-relay";
143 public static final String SHELLYDT_PRO2_ROLLER = "SPSW-002XE16EU-roller";
144 public static final String SHELLYDT_PRO2PM_RELAY = "SPSW-002PE16EU-relay";
145 public static final String SHELLYDT_PRO2PM_ROLLER = "SPSW-002PE16EU-roller";
146 public static final String SHELLYDT_PRO4PM = "SPSW-004PE16EU";
148 // List of all Thing Type UIDs
149 public static final ThingTypeUID THING_TYPE_SHELLY1 = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLY1_STR);
150 public static final ThingTypeUID THING_TYPE_SHELLY1L = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLY1L_STR);
151 public static final ThingTypeUID THING_TYPE_SHELLY1PM = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLY1PM_STR);
152 public static final ThingTypeUID THING_TYPE_SHELLYEM = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYEM_STR);
153 public static final ThingTypeUID THING_TYPE_SHELLY3EM = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLY3EM_STR);
154 public static final ThingTypeUID THING_TYPE_SHELLY2_RELAY = new ThingTypeUID(BINDING_ID,
155 THING_TYPE_SHELLY2_RELAY_STR);
156 public static final ThingTypeUID THING_TYPE_SHELLY2_ROLLER = new ThingTypeUID(BINDING_ID,
157 THING_TYPE_SHELLY2_ROLLER_STR);
158 public static final ThingTypeUID THING_TYPE_SHELLY25_RELAY = new ThingTypeUID(BINDING_ID,
159 THING_TYPE_SHELLY25_RELAY_STR);
160 public static final ThingTypeUID THING_TYPE_SHELLY25_ROLLER = new ThingTypeUID(BINDING_ID,
161 THING_TYPE_SHELLY25_ROLLER_STR);
162 public static final ThingTypeUID THING_TYPE_SHELLY4PRO = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLY4PRO_STR);
163 public static final ThingTypeUID THING_TYPE_SHELLYPLUG = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYPLUG_STR);
164 public static final ThingTypeUID THING_TYPE_SHELLYPLUGS = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYPLUGS_STR);
165 public static final ThingTypeUID THING_TYPE_SHELLYPLUGU1 = new ThingTypeUID(BINDING_ID,
166 THING_TYPE_SHELLYPLUGU1_STR);
167 public static final ThingTypeUID THING_TYPE_SHELLYUNI = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYUNI_STR);
168 public static final ThingTypeUID THING_TYPE_SHELLYDIMMER = new ThingTypeUID(BINDING_ID,
169 THING_TYPE_SHELLYDIMMER_STR);
170 public static final ThingTypeUID THING_TYPE_SHELLYDIMMER2 = new ThingTypeUID(BINDING_ID,
171 THING_TYPE_SHELLYDIMMER2_STR);
172 public static final ThingTypeUID THING_TYPE_SHELLYIX3 = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYIX3_STR);
173 public static final ThingTypeUID THING_TYPE_SHELLYBULB = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYBULB_STR);
174 public static final ThingTypeUID THING_TYPE_SHELLYDUO = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYDUO_STR);
175 public static final ThingTypeUID THING_TYPE_SHELLYVINTAGE = new ThingTypeUID(BINDING_ID,
176 THING_TYPE_SHELLYVINTAGE_STR);
177 public static final ThingTypeUID THING_TYPE_SHELLYDUORGBW = new ThingTypeUID(BINDING_ID,
178 THING_TYPE_SHELLYDUORGBW_STR);
179 public static final ThingTypeUID THING_TYPE_SHELLYHT = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYHT_STR);
180 public static final ThingTypeUID THING_TYPE_SHELLYSENSE = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYSENSE_STR);
181 public static final ThingTypeUID THING_TYPE_SHELLYSMOKE = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYSMOKE_STR);
182 public static final ThingTypeUID THING_TYPE_SHELLYGAS = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYGAS_STR);
183 public static final ThingTypeUID THING_TYPE_SHELLYFLOOD = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYFLOOD_STR);
184 public static final ThingTypeUID THING_TYPE_SHELLYDOORWIN = new ThingTypeUID(BINDING_ID,
185 THING_TYPE_SHELLYDOORWIN_STR);
186 public static final ThingTypeUID THING_TYPE_SHELLYDOORWIN2 = new ThingTypeUID(BINDING_ID,
187 THING_TYPE_SHELLYDOORWIN2_STR);
188 public static final ThingTypeUID THING_TYPE_SHELLYTRV = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYTRV_STR);
189 public static final ThingTypeUID THING_TYPE_SHELLYBUTTON1 = new ThingTypeUID(BINDING_ID,
190 THING_TYPE_SHELLYBUTTON1_STR);
191 public static final ThingTypeUID THING_TYPE_SHELLYBUTTON2 = new ThingTypeUID(BINDING_ID,
192 THING_TYPE_SHELLYBUTTON2_STR);
193 public static final ThingTypeUID THING_TYPE_SHELLYEYE = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYEYE_STR);
194 public static final ThingTypeUID THING_TYPE_SHELLMOTION = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYMOTION_STR);
195 public static final ThingTypeUID THING_TYPE_SHELLYRGBW2_COLOR = new ThingTypeUID(BINDING_ID,
196 THING_TYPE_SHELLYRGBW2_COLOR_STR);
197 public static final ThingTypeUID THING_TYPE_SHELLYRGBW2_WHITE = new ThingTypeUID(BINDING_ID,
198 THING_TYPE_SHELLYRGBW2_WHITE_STR);
199 public static final ThingTypeUID THING_TYPE_SHELLYPROTECTED = new ThingTypeUID(BINDING_ID,
200 THING_TYPE_SHELLYPROTECTED_STR);
201 public static final ThingTypeUID THING_TYPE_SHELLYUNKNOWN = new ThingTypeUID(BINDING_ID,
202 THING_TYPE_SHELLYUNKNOWN_STR);
204 public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections
205 .unmodifiableSet(Stream.of(THING_TYPE_SHELLY1, THING_TYPE_SHELLY1L, THING_TYPE_SHELLY1PM,
206 THING_TYPE_SHELLYEM, THING_TYPE_SHELLY3EM, THING_TYPE_SHELLY2_RELAY, THING_TYPE_SHELLY2_ROLLER,
207 THING_TYPE_SHELLY25_RELAY, THING_TYPE_SHELLY25_ROLLER, THING_TYPE_SHELLY4PRO, THING_TYPE_SHELLYPLUG,
208 THING_TYPE_SHELLYPLUGS, THING_TYPE_SHELLYPLUGU1, THING_TYPE_SHELLYUNI, THING_TYPE_SHELLYDIMMER,
209 THING_TYPE_SHELLYDIMMER2, THING_TYPE_SHELLYIX3, THING_TYPE_SHELLYBULB, THING_TYPE_SHELLYDUO,
210 THING_TYPE_SHELLYVINTAGE, THING_TYPE_SHELLYDUORGBW, THING_TYPE_SHELLYRGBW2_COLOR,
211 THING_TYPE_SHELLYRGBW2_WHITE, THING_TYPE_SHELLYHT, THING_TYPE_SHELLYTRV, THING_TYPE_SHELLYSENSE,
212 THING_TYPE_SHELLYEYE, THING_TYPE_SHELLYSMOKE, THING_TYPE_SHELLYGAS, THING_TYPE_SHELLYFLOOD,
213 THING_TYPE_SHELLYDOORWIN, THING_TYPE_SHELLYDOORWIN2, THING_TYPE_SHELLYBUTTON1,
214 THING_TYPE_SHELLYBUTTON2, THING_TYPE_SHELLMOTION, THING_TYPE_SHELLMOTION,
215 THING_TYPE_SHELLYPROTECTED, THING_TYPE_SHELLYUNKNOWN).collect(Collectors.toSet()));
217 // Thing Configuration Properties
218 public static final String CONFIG_DEVICEIP = "deviceIp";
219 public static final String CONFIG_HTTP_USERID = "userId";
220 public static final String CONFIG_HTTP_PASSWORD = "password";
221 public static final String CONFIG_UPDATE_INTERVAL = "updateInterval";
223 public static final String PROPERTY_SERVICE_NAME = "serviceName";
224 public static final String PROPERTY_DEV_NAME = "deviceName";
225 public static final String PROPERTY_DEV_TYPE = "deviceType";
226 public static final String PROPERTY_DEV_MODE = "deviceMode";
227 public static final String PROPERTY_DEV_GEN = "deviceGeneration";
228 public static final String PROPERTY_HWREV = "deviceHwRev";
229 public static final String PROPERTY_HWBATCH = "deviceHwBatch";
230 public static final String PROPERTY_UPDATE_PERIOD = "devUpdatePeriod";
231 public static final String PROPERTY_NUM_RELAYS = "numberRelays";
232 public static final String PROPERTY_NUM_ROLLERS = "numberRollers";
233 public static final String PROPERTY_NUM_METER = "numberMeters";
234 public static final String PROPERTY_LAST_ACTIVE = "lastActive";
235 public static final String PROPERTY_WIFI_NETW = "wifiNetwork";
236 public static final String PROPERTY_UPDATE_STATUS = "updateStatus";
237 public static final String PROPERTY_UPDATE_AVAILABLE = "updateAvailable";
238 public static final String PROPERTY_UPDATE_CURR_VERS = "updateCurrentVersion";
239 public static final String PROPERTY_UPDATE_NEW_VERS = "updateNewVersion";
240 public static final String PROPERTY_COAP_DESCR = "coapDeviceDescr";
241 public static final String PROPERTY_COAP_VERSION = "coapVersion";
242 public static final String PROPERTY_COIOTAUTO = "coiotAutoEnable";
245 public static final String CHANNEL_GROUP_RELAY_CONTROL = "relay";
246 public static final String CHANNEL_OUTPUT_NAME = "outputName";
247 public static final String CHANNEL_OUTPUT = "output";
248 public static final String CHANNEL_INPUT = "input";
249 public static final String CHANNEL_INPUT1 = "input1";
250 public static final String CHANNEL_INPUT2 = "input2";
251 public static final String CHANNEL_BRIGHTNESS = "brightness";
253 public static final String CHANNEL_TIMER_AUTOON = "autoOn";
254 public static final String CHANNEL_TIMER_AUTOOFF = "autoOff";
255 public static final String CHANNEL_TIMER_ACTIVE = "timerActive";
258 public static final String CHANNEL_GROUP_ROL_CONTROL = "roller";
259 public static final String CHANNEL_ROL_CONTROL_CONTROL = "control";
260 public static final String CHANNEL_ROL_CONTROL_POS = "rollerpos";
261 public static final String CHANNEL_ROL_CONTROL_FAV = "rollerFav";
262 public static final String CHANNEL_ROL_CONTROL_TIMER = "timer";
263 public static final String CHANNEL_ROL_CONTROL_STATE = "state";
264 public static final String CHANNEL_ROL_CONTROL_STOPR = "stopReason";
265 public static final String CHANNEL_ROL_CONTROL_SAFETY = "safety";
268 public static final String CHANNEL_GROUP_DIMMER_CONTROL = CHANNEL_GROUP_RELAY_CONTROL;
271 public static final String CHANNEL_GROUP_METER = "meter";
272 public static final String CHANNEL_METER_CURRENTWATTS = "currentWatts";
273 public static final String CHANNEL_METER_LASTMIN = "lastPower";
274 public static final String CHANNEL_METER_LASTMIN1 = CHANNEL_METER_LASTMIN + "1";
275 public static final String CHANNEL_METER_TOTALKWH = "totalKWH";
276 public static final String CHANNEL_EMETER_TOTALRET = "returnedKWH";
277 public static final String CHANNEL_EMETER_REACTWATTS = "reactiveWatts";
278 public static final String CHANNEL_EMETER_VOLTAGE = "voltage";
279 public static final String CHANNEL_EMETER_CURRENT = "current";
280 public static final String CHANNEL_EMETER_PFACTOR = "powerFactor";
282 public static final String CHANNEL_GROUP_SENSOR = "sensors";
283 public static final String CHANNEL_SENSOR_TEMP = "temperature";
284 public static final String CHANNEL_SENSOR_HUM = "humidity";
285 public static final String CHANNEL_SENSOR_LUX = "lux";
286 public static final String CHANNEL_SENSOR_PPM = "ppm";
287 public static final String CHANNEL_SENSOR_VOLTAGE = "voltage";
288 public static final String CHANNEL_SENSOR_ILLUM = "illumination";
289 public static final String CHANNEL_SENSOR_VIBRATION = "vibration";
290 public static final String CHANNEL_SENSOR_TILT = "tilt";
291 public static final String CHANNEL_SENSOR_FLOOD = "flood";
292 public static final String CHANNEL_SENSOR_SMOKE = "smoke";
293 public static final String CHANNEL_SENSOR_STATE = "state";
294 public static final String CHANNEL_SENSOR_VALVE = "valve";
295 public static final String CHANNEL_SENSOR_SSTATE = "status"; // Shelly Gas
296 public static final String CHANNEL_SENSOR_MOTION_ACT = "motionActive";
297 public static final String CHANNEL_SENSOR_MOTION = "motion";
298 public static final String CHANNEL_SENSOR_MOTION_TS = "motionTimestamp";
299 public static final String CHANNEL_SENSOR_SLEEPTIME = "sensorSleepTime";
300 public static final String CHANNEL_SENSOR_ALARM_STATE = "alarmState";
301 public static final String CHANNEL_SENSOR_ERROR = "lastError";
303 public static final String CHANNEL_CONTROL_SETTEMP = "targetTemp"; // Shelly TRV: target temp
304 public static final String CHANNEL_CONTROL_POSITION = "position"; // Shelly TRV: Valve position
305 public static final String CHANNEL_CONTROL_MODE = "mode"; // Shelly TRV
306 public static final String CHANNEL_CONTROL_PROFILE = "profile"; // Shelly TRV
307 public static final String CHANNEL_CONTROL_BCONTROL = "boost"; // Shelly TRV
308 public static final String CHANNEL_CONTROL_BTIMER = "boostTimer"; // Shelly TRV
310 // External sensors for Shelly1/1PM
311 public static final String CHANNEL_ESENDOR_TEMP1 = CHANNEL_SENSOR_TEMP + "1";
312 public static final String CHANNEL_ESENDOR_TEMP2 = CHANNEL_SENSOR_TEMP + "2";
313 public static final String CHANNEL_ESENDOR_TEMP3 = CHANNEL_SENSOR_TEMP + "3";
314 public static final String CHANNEL_ESENDOR_HUMIDITY = CHANNEL_SENSOR_HUM;
316 public static final String CHANNEL_GROUP_CONTROL = "control";
317 public static final String CHANNEL_SENSE_KEY = "key";
319 public static final String CHANNEL_GROUP_BATTERY = "battery";
320 public static final String CHANNEL_SENSOR_BAT_LEVEL = "batteryLevel";
321 public static final String CHANNEL_SENSOR_BAT_LOW = "lowBattery";
323 public static final String CHANNEL_GROUP_LIGHT_CONTROL = "control";
324 public static final String CHANNEL_LIGHT_COLOR_MODE = "mode";
325 public static final String CHANNEL_LIGHT_POWER = "power";
326 public static final String CHANNEL_LIGHT_DEFSTATE = "defaultState";
327 public static final String CHANNEL_GROUP_LIGHT_CHANNEL = "channel";
329 // Bulb/RGBW2 in color mode
330 public static final String CHANNEL_GROUP_COLOR_CONTROL = "color";
331 public static final String CHANNEL_COLOR_PICKER = "hsb";
332 public static final String CHANNEL_COLOR_FULL = "full";
333 public static final String CHANNEL_COLOR_RED = "red";
334 public static final String CHANNEL_COLOR_GREEN = "green";
335 public static final String CHANNEL_COLOR_BLUE = "blue";
336 public static final String CHANNEL_COLOR_WHITE = "white";
337 public static final String CHANNEL_COLOR_GAIN = "gain";
338 public static final String CHANNEL_COLOR_EFFECT = "effect";
340 // Bulb/RGBW2/Dup in White Mode
341 public static final String CHANNEL_GROUP_WHITE_CONTROL = "white";
342 public static final String CHANNEL_COLOR_TEMP = "temperature";
345 public static final String CHANNEL_GROUP_DEV_STATUS = "device";
346 public static final String CHANNEL_DEVST_NAME = "deviceName";
347 public static final String CHANNEL_DEVST_UPTIME = "uptime";
348 public static final String CHANNEL_DEVST_HEARTBEAT = "heartBeat";
349 public static final String CHANNEL_DEVST_RSSI = "wifiSignal";
350 public static final String CHANNEL_DEVST_ITEMP = "internalTemp";
351 public static final String CHANNEL_DEVST_WAKEUP = "wakeupReason";
352 public static final String CHANNEL_DEVST_ALARM = "alarm";
353 public static final String CHANNEL_DEVST_ACCUWATTS = "accumulatedWatts";
354 public static final String CHANNEL_DEVST_ACCUTOTAL = "accumulatedWTotal";
355 public static final String CHANNEL_DEVST_ACCURETURNED = "accumulatedReturned";
356 public static final String CHANNEL_DEVST_CHARGER = "charger";
357 public static final String CHANNEL_DEVST_UPDATE = "updateAvailable";
358 public static final String CHANNEL_DEVST_SELFTTEST = "selfTest";
359 public static final String CHANNEL_DEVST_VOLTAGE = "supplyVoltage";
360 public static final String CHANNEL_DEVST_CALIBRATED = "calibrated";
361 public static final String CHANNEL_DEVST_SCHEDULE = "schedule";
363 public static final String CHANNEL_LED_STATUS_DISABLE = "statusLed";
364 public static final String CHANNEL_LED_POWER_DISABLE = "powerLed";
366 public static final String CHANNEL_GROUP_STATUS = "status";
367 public static final String CHANNEL_STATUS_EVENTTYPE = "lastEvent";
368 public static final String CHANNEL_STATUS_EVENTTYPE1 = CHANNEL_STATUS_EVENTTYPE + "1";
369 public static final String CHANNEL_STATUS_EVENTTYPE2 = CHANNEL_STATUS_EVENTTYPE + "2";
370 public static final String CHANNEL_STATUS_EVENTCOUNT = "eventCount";
371 public static final String CHANNEL_STATUS_EVENTCOUNT1 = CHANNEL_STATUS_EVENTCOUNT + "1";
372 public static final String CHANNEL_STATUS_EVENTCOUNT2 = CHANNEL_STATUS_EVENTCOUNT + "2";
375 public static final String CHANNEL_LAST_UPDATE = "lastUpdate";
376 public static final String CHANNEL_EVENT_TRIGGER = "event";
377 public static final String CHANNEL_BUTTON_TRIGGER = "button";
378 public static final String CHANNEL_BUTTON_TRIGGER1 = CHANNEL_BUTTON_TRIGGER + "1";
379 public static final String CHANNEL_BUTTON_TRIGGER2 = CHANNEL_BUTTON_TRIGGER + "2";
381 public static final String SERVICE_TYPE = "_http._tcp.local.";
382 public static final String SHELLY_API_MIN_FWVERSION = "v1.8.2";
383 public static final String SHELLY_API_MIN_FWCOIOT = "v1.6";// v1.6.0+
384 public static final String SHELLY_API_FWCOIOT2 = "v1.8";// CoAP 2 with FW 1.8+
385 public static final String SHELLY_API_FW_110 = "v1.10"; // FW 1.10 or newer detected, activates some add feature
387 // Alarm types/messages
388 public static final String ALARM_TYPE_NONE = "NONE";
389 public static final String ALARM_TYPE_RESTARTED = "RESTARTED";
390 public static final String ALARM_TYPE_OVERTEMP = "OVERTEMP";
391 public static final String ALARM_TYPE_OVERPOWER = "OVERPOWER";
392 public static final String ALARM_TYPE_OVERLOAD = "OVERLOAD";
393 public static final String ALARM_TYPE_LOADERR = "LOAD_ERROR";
394 public static final String ALARM_TYPE_SENSOR_ERROR = "SENSOR_ERROR";
395 public static final String ALARM_TYPE_LOW_BATTERY = "LOW_BATTERY";
396 public static final String ALARM_TYPE_VALVE_ERROR = "VALVE_ERROR";
397 public static final String EVENT_TYPE_VIBRATION = "VIBRATION";
400 public static final String EVENT_TYPE_RELAY = "relay";
401 public static final String EVENT_TYPE_ROLLER = "roller";
402 public static final String EVENT_TYPE_LIGHT = "light";
403 public static final String EVENT_TYPE_SENSORDATA = "report";
405 // URI for the EventServlet
406 public static final String SHELLY_CALLBACK_URI = "/shelly/event";
408 public static final int DIM_STEPSIZE = 5;
410 // Formatting: Number of scaling digits
411 public static final int DIGITS_NONE = 0;
412 public static final int DIGITS_WATT = 2;
413 public static final int DIGITS_KWH = 3;
414 public static final int DIGITS_VOLT = 1;
415 public static final int DIGITS_TEMP = 1;
416 public static final int DIGITS_LUX = 0;
417 public static final int DIGITS_PERCENT = 1;
419 public static final int SHELLY_API_TIMEOUT_MS = 15000;
420 public static final int UPDATE_STATUS_INTERVAL_SECONDS = 3; // check for updates every x sec
421 public static final int UPDATE_SKIP_COUNT = 20; // update every x triggers or when a key was pressed
422 public static final int UPDATE_MIN_DELAY = 15;// update every x triggers or when a key was pressed
423 public static final int UPDATE_SETTINGS_INTERVAL_SECONDS = 60; // check for updates every x sec
424 public static final int HEALTH_CHECK_INTERVAL_SEC = 300; // Health check interval, 5min
425 public static final int VIBRATION_FILTER_SEC = 5; // Absore duplicate vibration events for xx sec