2 * Copyright (c) 2010-2023 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.api2;
15 import java.util.ArrayList;
17 import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusResult;
18 import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2RpcBaseMessage.Shelly2RpcMessageError;
20 import com.google.gson.annotations.SerializedName;
23 * {@link Shelly2ApiJsonDTO} wraps the Shelly REST API and provides various low level function to access the device api
27 * @author Markus Michels - Initial contribution
29 public class Shelly2ApiJsonDTO {
30 public static final String SHELLYRPC_METHOD_CLASS_SHELLY = "Shelly";
31 public static final String SHELLYRPC_METHOD_CLASS_SWITCH = "Switch";
33 public static final String SHELLYRPC_METHOD_GETDEVCONFIG = "GetDeviceInfo";
34 public static final String SHELLYRPC_METHOD_GETSYSCONFIG = "GetSysConfig"; // only sys
35 public static final String SHELLYRPC_METHOD_GETCONFIG = "GetConfig"; // sys + components
36 public static final String SHELLYRPC_METHOD_GETSYSSTATUS = "GetSysStatus"; // only sys
37 public static final String SHELLYRPC_METHOD_GETSTATUS = "GetStatus"; // sys + components
38 public static final String SHELLYRPC_METHOD_REBOOT = "Shelly.Reboot";
39 public static final String SHELLYRPC_METHOD_RESET = "Shelly.FactoryReset";
40 public static final String SHELLYRPC_METHOD_CHECKUPD = "Shelly.CheckForUpdate";
41 public static final String SHELLYRPC_METHOD_UPDATE = "Shelly.Update";
42 public static final String SHELLYRPC_METHOD_AUTHSET = "Shelly.SetAuth";
43 public static final String SHELLYRPC_METHOD_SWITCH_STATUS = "Switch.GetStatus";
44 public static final String SHELLYRPC_METHOD_SWITCH_SET = "Switch.Set";
45 public static final String SHELLYRPC_METHOD_SWITCH_SETCONFIG = "Switch.SetConfig";
46 public static final String SHELLYRPC_METHOD_COVER_SETPOS = "Cover.GoToPosition";
47 public static final String SHELLY2_COVER_CMD_OPEN = "Open";
48 public static final String SHELLY2_COVER_CMD_CLOSE = "Close";
49 public static final String SHELLY2_COVER_CMD_STOP = "Stop";
50 public static final String SHELLYRPC_METHOD_WIFIGETCONG = "Wifi.GetConfig";
51 public static final String SHELLYRPC_METHOD_WIFISETCONG = "Wifi.SetConfig";
52 public static final String SHELLYRPC_METHOD_ETHGETCONG = "Eth.GetConfig";
53 public static final String SHELLYRPC_METHOD_ETHSETCONG = "Eth.SetConfig";
54 public static final String SHELLYRPC_METHOD_BLEGETCONG = "BLE.GetConfig";
55 public static final String SHELLYRPC_METHOD_BLESETCONG = "BLE.SetConfig";
56 public static final String SHELLYRPC_METHOD_CLOUDSET = "Cloud.SetConfig";
57 public static final String SHELLYRPC_METHOD_WSGETCONFIG = "WS.GetConfig";
58 public static final String SHELLYRPC_METHOD_WSSETCONFIG = "WS.SetConfig";
59 public static final String SHELLYRPC_METHOD_SMOKE_SETCONFIG = "Smoke.SetConfig";
60 public static final String SHELLYRPC_METHOD_SMOKE_MUTE = "Smoke.Mute";
62 public static final String SHELLYRPC_METHOD_NOTIFYSTATUS = "NotifyStatus"; // inbound status
63 public static final String SHELLYRPC_METHOD_NOTIFYFULLSTATUS = "NotifyFullStatus"; // inbound status from bat device
64 public static final String SHELLYRPC_METHOD_NOTIFYEVENT = "NotifyEvent"; // inbound event
67 public static final String SHELLY2_PROFILE_RELAY = "switch";
68 public static final String SHELLY2_PROFILE_ROLLER = "cover";
71 public static final String SHELLY2_BTNT_MOMENTARY = "momentary";
72 public static final String SHELLY2_BTNT_FLIP = "flip";
73 public static final String SHELLY2_BTNT_FOLLOW = "follow";
74 public static final String SHELLY2_BTNT_DETACHED = "detached";
77 public static final String SHELLY2_INPUTT_SWITCH = "switch";
78 public static final String SHELLY2_INPUTT_BUTTON = "button";
79 public static final String SHELLY2_INPUTT_ANALOG = "analog"; // Shelly Addon: analogous input
82 public static final String SHELLY2_API_MODE_DETACHED = "detached";
83 public static final String SHELLY2_API_MODE_FOLLOW = "follow";
85 // Initial switch states
86 public static final String SHELLY2_API_ISTATE_ON = "on";
87 public static final String SHELLY2_API_ISTATE_OFF = "off";
88 public static final String SHELLY2_API_ISTATE_FOLLOWLAST = "restore_last";
89 public static final String SHELLY2_API_ISTATE_MATCHINPUT = "match_input";
92 public static final String SHELLY2_RMODE_SINGLE = "single";
93 public static final String SHELLY2_RMODE_DUAL = "dual";
94 public static final String SHELLY2_RMODE_DETACHED = "detached";
96 public static final String SHELLY2_RSTATE_OPENING = "opening";
97 public static final String SHELLY2_RSTATE_OPEN = "open";
98 public static final String SHELLY2_RSTATE_CLOSING = "closing";
99 public static final String SHELLY2_RSTATE_CLOSED = "closed";
100 public static final String SHELLY2_RSTATE_STOPPED = "stopped";
101 public static final String SHELLY2_RSTATE_CALIB = "calibrating";
103 // Event notifications
104 public static final String SHELLY2_EVENT_BTNUP = "btn_up";
105 public static final String SHELLY2_EVENT_BTNDOWN = "btn_down";
106 public static final String SHELLY2_EVENT_1PUSH = "single_push";
107 public static final String SHELLY2_EVENT_2PUSH = "double_push";
108 public static final String SHELLY2_EVENT_3PUSH = "triple_push";
109 public static final String SHELLY2_EVENT_LPUSH = "long_push";
110 public static final String SHELLY2_EVENT_SLPUSH = "short_long_push";
111 public static final String SHELLY2_EVENT_LSPUSH = "long_short_push";
113 public static final String SHELLY2_EVENT_SLEEP = "sleep";
114 public static final String SHELLY2_EVENT_CFGCHANGED = "config_changed";
115 public static final String SHELLY2_EVENT_OTASTART = "ota_begin";
116 public static final String SHELLY2_EVENT_OTAPROGRESS = "ota_progress";
117 public static final String SHELLY2_EVENT_OTADONE = "ota_success";
118 public static final String SHELLY2_EVENT_WIFICONNFAILED = "sta_connect_fail";
119 public static final String SHELLY2_EVENT_WIFIDISCONNECTED = "sta_disconnected";
122 public static final String SHELLY2_ERROR_OVERPOWER = "overpower";
123 public static final String SHELLY2_ERROR_OVERTEMP = "overtemp";
124 public static final String SHELLY2_ERROR_OVERVOLTAGE = "overvoltage";
126 // Wakeup reasons (e.g. Plus HT)
127 public static final String SHELLY2_WAKEUPO_BOOT_POWERON = "poweron";
128 public static final String SHELLY2_WAKEUPO_BOOT_RESTART = "software_restart";
129 public static final String SHELLY2_WAKEUPO_BOOT_WAKEUP = "deepsleep_wake";
130 public static final String SHELLY2_WAKEUPO_BOOT_INTERNAL = "internal";
131 public static final String SHELLY2_WAKEUPO_BOOT_UNKNOWN = "unknown";
133 public static final String SHELLY2_WAKEUPOCAUSE_BUTTON = "button";
134 public static final String SHELLY2_WAKEUPOCAUSE_USB = "usb";
135 public static final String SHELLY2_WAKEUPOCAUSE_PERIODIC = "periodic";
136 public static final String SHELLY2_WAKEUPOCAUSE_UPDATE = "status_update";
137 public static final String SHELLY2_WAKEUPOCAUSE_UNDEFINED = "undefined";
139 public class Shelly2DevConfigBle {
140 public Boolean enable;
143 public class Shelly2DevConfigEth {
144 public Boolean enable;
145 public String ipv4mode;
147 public String netmask;
149 public String nameserver;
152 public static class Shelly2DeviceSettings {
158 @SerializedName("fw_id")
159 public String firmware;
162 @SerializedName("auth_en")
163 public Boolean authEnable;
164 @SerializedName("auth_domain")
165 public String authDomain;
168 public static class Shelly2DeviceConfigAp {
169 public static class Shelly2DeviceConfigApRE {
170 public Boolean enable;
173 public Boolean enable;
175 public String password;
176 @SerializedName("is_open")
177 public Boolean isOpen;
178 @SerializedName("range_extender")
179 Shelly2DeviceConfigApRE rangeExtender;
182 public static class Shelly2DeviceConfig {
183 public class Shelly2DeviceConfigSys {
184 public class Shelly2DeviceConfigDevice {
187 @SerializedName("fw_id")
189 public String profile;
190 @SerializedName("eco_mode")
191 public Boolean ecoMode;
192 public Boolean discoverable;
195 public class Shelly2DeviceConfigLocation {
201 public class Shelly2DeviceConfigSntp {
202 public String server;
205 public class Shelly2DeviceConfigSleep {
206 @SerializedName("wakeup_period")
207 public Integer wakeupPeriod;
210 public class Shelly2DeviceConfigDebug {
211 public class Shelly2DeviceConfigDebugMqtt {
212 public Boolean enable;
215 public class Shelly2DeviceConfigDebugWebSocket {
216 public Boolean enable;
219 public class Shelly2DeviceConfigDebugUdp {
223 public Shelly2DeviceConfigDebugMqtt mqtt;
224 public Shelly2DeviceConfigDebugWebSocket websocket;
225 public Shelly2DeviceConfigDebugUdp udp;
228 public class Shelly2DeviceConfigUiData {
229 public String cover; // hold comma seperated list of roller favorites
232 public class Shelly2DeviceConfigRpcUdp {
233 @SerializedName("dst_addr")
234 public String dstAddr;
235 @SerializedName("listenPort")
236 public String listenPort;
239 @SerializedName("cfg_rev")
240 public Integer cfgRevision;
241 public Shelly2DeviceConfigDevice device;
242 public Shelly2DeviceConfigLocation location;
243 public Shelly2DeviceConfigSntp sntp;
244 public Shelly2DeviceConfigSleep sleep;
245 public Shelly2DeviceConfigDebug debug;
246 @SerializedName("ui_data")
247 public Shelly2DeviceConfigUiData uiData;
248 @SerializedName("rpc_udp")
249 public Shelly2DeviceConfigRpcUdp rpcUdp;
252 public class Shelly2DevConfigInput {
256 public Boolean invert;
257 @SerializedName("factory_reset")
258 public Boolean factoryReset;
259 @SerializedName("report_thr")
260 public Double reportTreshold; // only for type analog
263 public class Shelly2DevConfigSwitch {
267 @SerializedName("in_mode")
270 @SerializedName("initial_state")
271 public String initialState;
272 @SerializedName("auto_on")
273 public Boolean autoOn;
274 @SerializedName("auto_on_delay")
275 public Double autoOnDelay;
276 @SerializedName("auto_off")
277 public Boolean autoOff;
278 @SerializedName("auto_off_delay")
279 public Double autoOffDelay;
280 @SerializedName("power_limit")
281 public Integer powerLimit;
282 @SerializedName("voltage_limit")
283 public Integer voltageLimit;
284 @SerializedName("current_limit")
285 public Double currentLimit;
288 public static class Shelly2DevConfigEm {
291 @SerializedName("blink_mode_selector")
292 public String blinkModeSelector;
293 @SerializedName("phase_selector")
294 public String phase_selector;
295 @SerializedName("monitor_phase_sequence")
296 public Boolean monitorPhaseSequence;
299 public class Shelly2DevConfigCover {
300 public class Shelly2DeviceConfigCoverMotor {
301 @SerializedName("idle_power_thr")
302 public Double idle_powerThr;
305 public class Shelly2DeviceConfigCoverSafetySwitch {
306 public Boolean enable;
307 public String direction;
308 public String action;
309 @SerializedName("allowed_move")
310 public String allowedMove;
313 public class Shelly2DeviceConfigCoverObstructionDetection {
314 public Boolean enable;
315 public String direction;
316 public String action;
317 @SerializedName("power_thr")
318 public Integer powerThr;
319 public Double holdoff;
324 public Shelly2DeviceConfigCoverMotor motor;
325 @SerializedName("maxtime_open")
326 public Double maxtimeOpen;
327 @SerializedName("maxtime_close")
328 public Double maxtimeClose;
329 @SerializedName("initial_state")
330 public String initialState;
331 @SerializedName("invert_directions")
332 public Boolean invertDirections;
333 @SerializedName("in_mode")
334 public String inMode;
335 @SerializedName("swap_inputs")
336 public Boolean swapInputs;
337 @SerializedName("safety_switch")
338 public Shelly2DeviceConfigCoverSafetySwitch safetySwitch;
339 @SerializedName("power_limit")
340 public Integer powerLimit;
341 @SerializedName("voltage_limit")
342 public Integer voltageLimit;
343 @SerializedName("current_limit")
344 public Double currentLimit;
345 @SerializedName("obstruction_detection")
346 public Shelly2DeviceConfigCoverObstructionDetection obstructionDetection;
349 public static class Shelly2ConfigSmoke {
351 public Boolean alarm;
355 public static class Shelly2GetConfigResult {
357 public class Shelly2DevConfigCloud {
358 public Boolean enable;
359 public String server;
362 public class Shelly2DevConfigMqtt {
363 public Boolean enable;
364 public String server;
366 @SerializedName("topic_prefix:0")
367 public String topicPrefix;
368 @SerializedName("rpc_ntf")
369 public String rpcNtf;
370 @SerializedName("status_ntf")
371 public String statusNtf;
374 public Shelly2DevConfigBle ble;
375 public Shelly2DevConfigEth eth;
376 public Shelly2DevConfigCloud cloud;
377 public Shelly2DevConfigMqtt mqtt;
378 public Shelly2DeviceConfigSys sys;
379 public Shelly2DeviceConfigWiFi wifi;
381 @SerializedName("input:0")
382 public Shelly2DevConfigInput input0;
383 @SerializedName("input:1")
384 public Shelly2DevConfigInput input1;
385 @SerializedName("input:2")
386 public Shelly2DevConfigInput input2;
387 @SerializedName("input:3")
388 public Shelly2DevConfigInput input3;
390 @SerializedName("switch:0")
391 public Shelly2DevConfigSwitch switch0;
392 @SerializedName("switch:1")
393 public Shelly2DevConfigSwitch switch1;
394 @SerializedName("switch:2")
395 public Shelly2DevConfigSwitch switch2;
396 @SerializedName("switch:3")
397 public Shelly2DevConfigSwitch switch3;
399 @SerializedName("em:0")
400 public Shelly2DevConfigEm em0;
402 @SerializedName("cover:0")
403 public Shelly2DevConfigCover cover0;
405 @SerializedName("smoke:0")
406 public Shelly2ConfigSmoke smoke0;
409 public class Shelly2DeviceConfigSta {
411 public String password;
412 @SerializedName("is_open")
413 public Boolean isOpen;
414 public Boolean enable;
415 public String ipv4mode;
417 public String netmask;
419 public String nameserver;
422 public class Shelly2DeviceConfigRoam {
423 @SerializedName("rssi_thr")
424 public Integer rssiThr;
425 public Integer interval;
428 public class Shelly2DeviceConfigWiFi {
429 public Shelly2DeviceConfigAp ap;
430 public Shelly2DeviceConfigSta sta;
431 public Shelly2DeviceConfigSta sta1;
432 public Shelly2DeviceConfigRoam roam;
437 public Shelly2GetConfigResult result;
440 public static class Shelly2DeviceStatus {
441 public class Shelly2InputStatus {
443 public Boolean state;
444 public Double percent; // analog input only
445 public ArrayList<String> errors;// shown only if at least one error is present.
448 public static class Shelly2DeviceStatusResult {
449 public class Shelly2DeviceStatusBle {
453 public class Shelly2DeviceStatusCloud {
454 public Boolean connected;
457 public class Shelly2DeviceStatusMqqt {
458 public Boolean connected;
461 public class Shelly2CoverStatus {
463 public String source;
465 public Double apower;
466 public Double voltage;
467 public Double current;
469 public Shelly2Energy aenergy;
470 @SerializedName("current_pos")
471 public Integer currentPos;
472 @SerializedName("target_pos")
473 public Integer targetPos;
474 @SerializedName("move_timeout")
475 public Double moveTimeout;
476 @SerializedName("move_started_at")
477 public Double moveStartedAt;
478 @SerializedName("pos_control")
479 public Boolean posControl;
480 public Shelly2DeviceStatusTemp temperature;
481 public ArrayList<String> errors;
484 public class Shelly2DeviceStatusHumidity {
489 public class Shelly2DeviceStatusVoltage {
491 public Double voltage;
494 public class Shelly2DeviceStatusTempId extends Shelly2DeviceStatusTemp {
498 public static class Shelly2DeviceStatusPower {
499 public static class Shelly2DeviceStatusBattery {
502 public Double percent;
505 public static class Shelly2DeviceStatusCharger {
506 public Boolean present;
510 public Shelly2DeviceStatusBattery battery;
511 public Shelly2DeviceStatusCharger external;
514 public static class Shelly2DeviceStatusEm {
517 @SerializedName("a_current")
518 public Double aCurrent;
519 @SerializedName("a_voltage")
520 public Double aVoltage;
521 @SerializedName("a_act_power")
522 public Double aActPower;
523 @SerializedName("a_aprt_power")
524 public Double aAprtPower;
525 @SerializedName("a_pf")
528 @SerializedName("b_current")
529 public Double bCurrent;
530 @SerializedName("b_voltage")
531 public Double bVoltage;
532 @SerializedName("b_act_power")
533 public Double bActPower;
534 @SerializedName("b_aprt_power")
535 public Double bAprtPower;
536 @SerializedName("b_pf")
539 @SerializedName("c_current")
540 public Double cCurrent;
541 @SerializedName("c_voltage")
542 public Double cVoltage;
543 @SerializedName("c_act_power")
544 public Double cActPower;
545 @SerializedName("c_aprt_power")
546 public Double cAprtPower;
547 @SerializedName("c_pf")
550 @SerializedName("n_current")
551 public Double nCurrent;
554 public static class Shelly2DeviceStatusEmData {
556 public String[] errors;
559 public class Shelly2DeviceStatusSmoke {
561 public Boolean alarm;
565 public Shelly2DeviceStatusBle ble;
566 public Shelly2DeviceStatusCloud cloud;
567 public Shelly2DeviceStatusMqqt mqtt;
568 public Shelly2DeviceStatusSys sys;
569 public Shelly2DeviceStatusSysWiFi wifi;
571 @SerializedName("input:0")
572 public Shelly2InputStatus input0;
573 @SerializedName("input:1")
574 public Shelly2InputStatus input1;
575 @SerializedName("input:2")
576 public Shelly2InputStatus input2;
577 @SerializedName("input:3")
578 public Shelly2InputStatus input3;
579 @SerializedName("input:100")
580 public Shelly2InputStatus input100; // Digital Input from Add-On
582 @SerializedName("switch:0")
583 public Shelly2RelayStatus switch0;
584 @SerializedName("switch:1")
585 public Shelly2RelayStatus switch1;
586 @SerializedName("switch:2")
587 public Shelly2RelayStatus switch2;
588 @SerializedName("switch:3")
589 public Shelly2RelayStatus switch3;
591 @SerializedName("em:0")
592 Shelly2DeviceStatusEm em0;
593 @SerializedName("emdata:0")
594 Shelly2DeviceStatusEmData emdata0;
596 @SerializedName("cover:0")
597 public Shelly2CoverStatus cover0;
599 @SerializedName("temperature:0")
600 public Shelly2DeviceStatusTempId temperature0;
601 @SerializedName("temperature:100")
602 public Shelly2DeviceStatusTempId temperature100;
603 @SerializedName("temperature:101")
604 public Shelly2DeviceStatusTempId temperature101;
605 @SerializedName("temperature:102")
606 public Shelly2DeviceStatusTempId temperature102;
607 @SerializedName("temperature:103")
608 public Shelly2DeviceStatusTempId temperature103;
609 @SerializedName("temperature:104")
610 public Shelly2DeviceStatusTempId temperature104;
612 @SerializedName("humidity:0")
613 public Shelly2DeviceStatusHumidity humidity0;
614 @SerializedName("humidity:100")
615 public Shelly2DeviceStatusHumidity humidity100;
616 @SerializedName("smoke:0")
617 public Shelly2DeviceStatusSmoke smoke0;
619 @SerializedName("voltmeter:100")
620 public Shelly2DeviceStatusVoltage voltmeter100;
622 @SerializedName("devicepower:0")
623 public Shelly2DeviceStatusPower devicepower0;
626 public class Shelly2DeviceStatusSys {
627 public class Shelly2DeviceStatusSysAvlUpdate {
628 public class Shelly2DeviceStatusSysUpdate {
629 public String version;
632 public Shelly2DeviceStatusSysUpdate stable;
633 public Shelly2DeviceStatusSysUpdate beta;
636 public class Shelly2DeviceStatusWakeup {
642 @SerializedName("restart_required")
643 public Boolean restartRequired;
645 public Long unixtime;
647 @SerializedName("ram_size")
649 @SerializedName("ram_free")
651 @SerializedName("fs_size")
653 @SerializedName("fs_free")
655 @SerializedName("cfg_rev")
656 public Integer cfg_rev;
657 @SerializedName("available_updates")
658 public Shelly2DeviceStatusSysAvlUpdate availableUpdates;
659 @SerializedName("webhook_rev")
660 public Integer webHookRev;
661 @SerializedName("wakeup_reason")
662 public Shelly2DeviceStatusWakeup wakeUpReason;
663 @SerializedName("wakeup_period")
664 public Integer wakeupPeriod;
667 public class Shelly2DeviceStatusSysWiFi {
668 @SerializedName("sta_ip")
670 public String status;
673 @SerializedName("ap_client_count")
674 public Integer apClientCount;
679 public Shelly2DeviceStatusResult result;
682 public static class Shelly2RelayStatus {
684 public String source;
685 public Boolean output;
686 @SerializedName("timer_started_at")
687 public Double timerStartetAt;
688 @SerializedName("timer_duration")
689 public Integer timerDuration;
690 public Double apower;
691 public Double voltage;
692 public Double current;
694 public Shelly2Energy aenergy;
695 public Shelly2DeviceStatusTemp temperature;
696 public String[] errors;
699 public static class Shelly2DeviceStatusTemp {
704 public static class Shelly2Energy {
705 // "switch:1":{"id":1,"aenergy":{"total":0.003,"by_minute":[0.000,0.000,0.000],"minute_ts":1619910239}}}}
707 @SerializedName("by_minute")
708 public Double[] byMinute;
709 @SerializedName("minute_ts")
710 public Long minuteTs;
713 public static class Shelly2ConfigParms {
715 public Boolean enable;
716 public String server;
717 @SerializedName("ssl_ca")
721 public Shelly2DeviceConfigAp ap;
724 @SerializedName("auto_on")
725 public Boolean autoOn;
726 @SerializedName("auto_on_delay")
727 public Double autoOnDelay;
728 @SerializedName("auto_off")
729 public Boolean autoOff;
730 @SerializedName("auto_off_delay")
731 public Double autoOffDelay;
734 public static class Shelly2RpcRequest {
735 public Integer id = 0;
736 public String method;
738 public static class Shelly2RpcRequestParams {
739 public Integer id = 1;
755 public Shelly2ConfigParms config;
757 public Shelly2RpcRequestParams withConfig() {
758 config = new Shelly2ConfigParms();
763 public Shelly2RpcRequestParams params = new Shelly2RpcRequestParams();
765 public Shelly2RpcRequest() {
768 public Shelly2RpcRequest withMethod(String method) {
769 this.method = method;
773 public Shelly2RpcRequest withId(int id) {
778 public Shelly2RpcRequest withPos(int pos) {
784 public static class Shelly2WsConfigResponse {
788 public static class Shelly2WsConfigResult {
789 @SerializedName("restart_required")
790 public Boolean restartRequired;
793 public Shelly2WsConfigResult result;
796 public static class Shelly2RpcBaseMessage {
797 // Basic message format, e.g.
798 // {"id":1,"src":"localweb528","method":"Shelly.GetConfig"}
799 public class Shelly2RpcMessageError {
801 public String message;
807 public String method;
808 public Object params;
809 public Object result;
810 public Shelly2AuthRequest auth;
811 public Shelly2RpcMessageError error;
814 public static class Shelly2RpcNotifyStatus {
815 public static class Shelly2NotifyStatus extends Shelly2DeviceStatusResult {
822 public String method;
823 public Shelly2NotifyStatus params;
824 public Shelly2NotifyStatus result;
825 public Shelly2RpcMessageError error;
828 public static String SHELLY2_AUTHTTYPE_DIGEST = "digest";
829 public static String SHELLY2_AUTHTTYPE_STRING = "string";
830 public static String SHELLY2_AUTHALG_SHA256 = "SHA-256";
831 // = ':auth:'+HexHash("dummy_method:dummy_uri");
832 public static String SHELLY2_AUTH_NOISE = "6370ec69915103833b5222b368555393393f098bfbfbb59f47e0590af135f062";
834 public static class Shelly2AuthRequest {
835 public String username;
840 public String algorithm;
841 public String response;
842 @SerializedName("auth_type")
843 public String authType;
846 public static class Shelly2AuthResponse { // on 401 message contains the auth info
847 @SerializedName("auth_type")
848 public String authType;
852 public String algorithm;
855 public class Shelly2NotifyEvent {
858 public String component;
861 public Integer reason;
862 @SerializedName("cfg_rev")
863 public Integer cfgRev;
866 public class Shelly2NotifyEventData {
868 public ArrayList<Shelly2NotifyEvent> events;
871 public static class Shelly2RpcNotifyEvent {
873 Shelly2NotifyEventData params;