mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
[shelly] Add support for Pro 1CB (#18611)
* Add support for Shelly Pro 1CB (should also work for 2CB and 4CB) Signed-off-by: Markus Michels <markus7017@gmail.com>
This commit is contained in:
@@ -117,6 +117,7 @@ See section [Discovery](#discovery) for details.
|
||||
| ------------------- | -------------------------------------------------------- | ---------------------------------------------- |
|
||||
| shellypro1 | Shelly Pro 1 with 1x relay | SPSW-001XE16EU, SPSW-101XE16EU, SPSW-201XE16EU |
|
||||
| shellypro1pm | Shelly Pro 1 PM with 1x relay + power meter | SPSW-001PE16EU, SPSW-101PE16EU, SPSW-201PE16EU |
|
||||
| shellypro1cb | Shelly Pro 1 Circuit Breaker with 1x relay + volt meter | SPCB-01VENEU |
|
||||
| shellypro2-relay | Shelly Pro 2 with 2x relay, relay mode | SPSW-002XE16EU, SPSW-102XE16EU, SPSW-202XE16EU |
|
||||
| shellypro2pm-relay | Shelly Pro 2 PM with 2x relay + power meter, relay mode | SPSW-002PE16EU, SPSW-102PE16EU, SPSW-202PE16EU |
|
||||
| shellypro2pm-roller | Shelly Pro 2 PM with 2x relay + power meter, roller mode | SPSW-002PE16EU, SPSW-102PE16EU, SPSW-202PE16EU |
|
||||
@@ -1397,6 +1398,14 @@ Channels lastEvent and eventCount are only available if input type is set to mom
|
||||
| | totalKWH | Number | yes | Total energy consumption in kwh since the device powered up (resets on restart) |
|
||||
| | lastUpdate | DateTime | yes | Timestamp of the last measurement |
|
||||
|
||||
### Shelly Pro 1CB (thing-type: shellypro1cb)
|
||||
|
||||
| Group | Channel | Type | read-only | Description |
|
||||
| ----- | ------------ | -------- | --------- | -------------------------------------------------------------------------------- |
|
||||
| relay | output | Switch | r/w | Controls the relay's output channel (on/off) |
|
||||
| | outputName | String | yes | Logical name of this relay output as configured in the Shelly App |
|
||||
| meter | voltage | Number | yes | RMS voltage, Volts |
|
||||
|
||||
### Shelly Pro 2 (thing-type: shellypro2-relay)
|
||||
|
||||
| Group | Channel | Type | read-only | Description |
|
||||
|
||||
+1
@@ -96,6 +96,7 @@ public class ShellyBindingConstants {
|
||||
// Shelly Pro
|
||||
THING_TYPE_SHELLYPRO1, //
|
||||
THING_TYPE_SHELLYPRO1PM, //
|
||||
THING_TYPE_SHELLYPRO1CB, //
|
||||
THING_TYPE_SHELLYPRO2_RELAY, //
|
||||
THING_TYPE_SHELLYPRO2PM_RELAY, //
|
||||
THING_TYPE_SHELLYPRO2PM_ROLLER, //
|
||||
|
||||
+1
-1
@@ -83,6 +83,7 @@ public class ShellyDeviceProfile {
|
||||
|
||||
public int numMeters = 0;
|
||||
public boolean isEMeter = false; // true for ShellyEM/3EM
|
||||
public boolean isCB = false; // true for Shelly Pro CB
|
||||
|
||||
public boolean isLight = false; // true if it is a Shelly Bulb/RGBW2
|
||||
public boolean isBulb = false; // true only if it is a Bulb
|
||||
@@ -157,7 +158,6 @@ public class ShellyDeviceProfile {
|
||||
String mode = getString(device.mode);
|
||||
isRoller = mode.equalsIgnoreCase(SHELLY_MODE_ROLLER);
|
||||
inColor = isLight && mode.equalsIgnoreCase(SHELLY_MODE_COLOR);
|
||||
|
||||
numRelays = !isLight ? getInteger(device.numOutputs) : 0;
|
||||
if ((numRelays > 0) && (settings.relays == null)) {
|
||||
numRelays = 0;
|
||||
|
||||
+93
-1
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
package org.openhab.binding.shelly.internal.api2;
|
||||
|
||||
import static org.openhab.binding.shelly.internal.ShellyBindingConstants.*;
|
||||
import static org.openhab.binding.shelly.internal.ShellyBindingConstants.CHANNEL_INPUT;
|
||||
import static org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.*;
|
||||
import static org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.*;
|
||||
import static org.openhab.binding.shelly.internal.util.ShellyUtils.*;
|
||||
@@ -36,8 +36,10 @@ import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySensorTm
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsDimmer;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsEMeter;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsInput;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsLight;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsMeter;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsRelay;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsRgbwLight;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsRoller;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsStatus;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyShortLightStatus;
|
||||
@@ -54,10 +56,12 @@ import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyStatusSe
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyStatusSensor.ShellySensorHum;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyStatusSensor.ShellySensorLux;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2AuthRsp;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2CBStatus;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceConfig.Shelly2DevConfigCover;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceConfig.Shelly2DevConfigInput;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceConfig.Shelly2DevConfigSwitch;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceConfig.Shelly2GetConfigResult;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceConfig.ShellyDeviceConfigCB;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusLight;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusResult;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusResult.Shelly2CoverStatus;
|
||||
@@ -68,6 +72,7 @@ import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceS
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusResult.Shelly2DeviceStatusPower;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusResult.Shelly2DeviceStatusSmoke;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusResult.Shelly2DeviceStatusTempId;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusResult.Shelly2DeviceStatusVoltage;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2DeviceStatusResult.Shelly2RGBWStatus;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2DeviceStatus.Shelly2InputStatus;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2RelayStatus;
|
||||
@@ -175,6 +180,30 @@ public class Shelly2ApiClient extends ShellyHttpClient {
|
||||
relays.add(rsettings);
|
||||
}
|
||||
|
||||
protected @Nullable ArrayList<@Nullable ShellySettingsRelay> fillBreakerSettings(ShellyDeviceProfile profile,
|
||||
Shelly2GetConfigResult dc) {
|
||||
ArrayList<@Nullable ShellySettingsRelay> relays = new ArrayList<>();
|
||||
addBreakerSettings(relays, dc.cb0);
|
||||
addBreakerSettings(relays, dc.cb1);
|
||||
addBreakerSettings(relays, dc.cb2);
|
||||
addBreakerSettings(relays, dc.cb3);
|
||||
return !relays.isEmpty() ? relays : null;
|
||||
}
|
||||
|
||||
private void addBreakerSettings(ArrayList<@Nullable ShellySettingsRelay> relays,
|
||||
@Nullable ShellyDeviceConfigCB cs) {
|
||||
if (cs == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ShellySettingsRelay rsettings = new ShellySettingsRelay();
|
||||
rsettings.id = cs.id;
|
||||
rsettings.isValid = cs.id != null;
|
||||
rsettings.name = cs.name;
|
||||
rsettings.ison = false;
|
||||
relays.add(rsettings);
|
||||
}
|
||||
|
||||
protected boolean fillDeviceStatus(ShellySettingsStatus status, Shelly2DeviceStatusResult result,
|
||||
boolean channelUpdate) throws ShellyApiException {
|
||||
boolean updated = false;
|
||||
@@ -193,6 +222,10 @@ public class Shelly2ApiClient extends ShellyHttpClient {
|
||||
updated |= updateRelayStatus(status, result.switch3, channelUpdate);
|
||||
updated |= updateRelayStatus(status, result.switch100, channelUpdate);
|
||||
updated |= updateRelayStatus(status, result.pm10, channelUpdate);
|
||||
updated |= updateBreakerStatus(status, result.cb0, result.voltmeter0, channelUpdate);
|
||||
updated |= updateBreakerStatus(status, result.cb1, result.voltmeter1, channelUpdate);
|
||||
updated |= updateBreakerStatus(status, result.cb2, result.voltmeter2, channelUpdate);
|
||||
updated |= updateBreakerStatus(status, result.cb3, result.voltmeter3, channelUpdate);
|
||||
updated |= updateEmStatus(status, result.em0, result.emdata0, channelUpdate);
|
||||
updated |= updateEmStatus(status, result.em10, channelUpdate);
|
||||
updated |= updateEmStatus(status, result.em11, channelUpdate);
|
||||
@@ -300,6 +333,65 @@ public class Shelly2ApiClient extends ShellyHttpClient {
|
||||
: false;
|
||||
}
|
||||
|
||||
private boolean updateBreakerStatus(ShellySettingsStatus status, @Nullable Shelly2CBStatus bs,
|
||||
@Nullable Shelly2DeviceStatusVoltage vm, boolean channelUpdate) throws ShellyApiException {
|
||||
if (bs == null) {
|
||||
return false;
|
||||
}
|
||||
ShellyDeviceProfile profile = getProfile();
|
||||
|
||||
ShellySettingsRelay rstatus;
|
||||
ShellyShortStatusRelay sr;
|
||||
int rIdx = getRelayIdx(profile, bs.id);
|
||||
if (profile.hasRelays) {
|
||||
if (rIdx == -1) {
|
||||
throw new IllegalArgumentException("Update for invalid relay index");
|
||||
}
|
||||
rstatus = status.relays.get(rIdx);
|
||||
sr = relayStatus.relays.get(rIdx);
|
||||
} else {
|
||||
rstatus = new ShellySettingsRelay();
|
||||
sr = new ShellyShortStatusRelay();
|
||||
rIdx = bs.id;
|
||||
}
|
||||
|
||||
sr.isValid = rstatus.isValid = true;
|
||||
sr.name = rstatus.name = status.name;
|
||||
if (bs.output != null) {
|
||||
sr.ison = rstatus.ison = getBool(bs.output);
|
||||
}
|
||||
if (bs.temperature != null) {
|
||||
if (status.tmp == null) {
|
||||
status.tmp = new ShellySensorTmp();
|
||||
}
|
||||
status.tmp.isValid = true;
|
||||
status.tmp.tC = bs.temperature.tC;
|
||||
status.tmp.tF = bs.temperature.tF;
|
||||
status.tmp.units = "C";
|
||||
sr.temperature = getDouble(bs.temperature.tC);
|
||||
if (status.temperature == null || getDouble(bs.temperature.tC) > status.temperature) {
|
||||
status.temperature = sr.temperature;
|
||||
}
|
||||
}
|
||||
|
||||
ShellySettingsMeter sm = new ShellySettingsMeter();
|
||||
ShellySettingsEMeter emeter = status.emeters != null ? status.emeters.get(rIdx) : new ShellySettingsEMeter();
|
||||
if (vm != null && vm.voltage != null) {
|
||||
emeter.voltage = vm.voltage;
|
||||
}
|
||||
|
||||
if (profile.hasRelays) {
|
||||
// Update internal structures
|
||||
status.relays.set(rIdx, rstatus);
|
||||
relayStatus.relays.set(rIdx, sr);
|
||||
}
|
||||
|
||||
updateMeter(status, rIdx, sm, emeter, channelUpdate);
|
||||
return channelUpdate && profile.hasRelays
|
||||
? ShellyComponents.updateRelay((ShellyBaseHandler) getThing(), status, rIdx)
|
||||
: false;
|
||||
}
|
||||
|
||||
private int getRelayIdx(ShellyDeviceProfile profile, @Nullable Integer id) {
|
||||
List<ShellySettingsRelay> relays = profile.settings.relays;
|
||||
if (id != null && relays != null) {
|
||||
|
||||
+49
@@ -47,6 +47,7 @@ public class Shelly2ApiJsonDTO {
|
||||
public static final String SHELLYRPC_METHOD_SWITCH_STATUS = "Switch.GetStatus";
|
||||
public static final String SHELLYRPC_METHOD_SWITCH_SET = "Switch.Set";
|
||||
public static final String SHELLYRPC_METHOD_SWITCH_SETCONFIG = "Switch.SetConfig";
|
||||
public static final String SHELLYRPC_METHOD_CB_SET = "CB.Set";
|
||||
public static final String SHELLYRPC_METHOD_COVER_SETPOS = "Cover.GoToPosition";
|
||||
public static final String SHELLY2_COVER_CMD_OPEN = "Open";
|
||||
public static final String SHELLY2_COVER_CMD_CLOSE = "Close";
|
||||
@@ -331,6 +332,17 @@ public class Shelly2ApiJsonDTO {
|
||||
public Double currentLimit;
|
||||
}
|
||||
|
||||
public static class ShellyDeviceConfigCB {
|
||||
public Integer id;
|
||||
public String name;
|
||||
@SerializedName("undervoltage_limit")
|
||||
public Integer undervoltageLimit;
|
||||
@SerializedName("voltage_limit")
|
||||
public Integer voltageLimit;
|
||||
@SerializedName("reaction_delay")
|
||||
public Double reactionDelay;
|
||||
}
|
||||
|
||||
public static class Shelly2DevConfigEm {
|
||||
public Integer id;
|
||||
public String name;
|
||||
@@ -486,6 +498,15 @@ public class Shelly2ApiJsonDTO {
|
||||
@SerializedName("switch:100")
|
||||
public Shelly2DevConfigSwitch switch100; // Pro 3EM Add-On
|
||||
|
||||
@SerializedName("cb:0")
|
||||
ShellyDeviceConfigCB cb0;
|
||||
@SerializedName("cb:1")
|
||||
ShellyDeviceConfigCB cb1;
|
||||
@SerializedName("cb:2")
|
||||
ShellyDeviceConfigCB cb2;
|
||||
@SerializedName("cb:3")
|
||||
ShellyDeviceConfigCB cb3;
|
||||
|
||||
@SerializedName("em:0")
|
||||
public Shelly2DevConfigEm em0;
|
||||
@SerializedName("em1:0")
|
||||
@@ -773,6 +794,15 @@ public class Shelly2ApiJsonDTO {
|
||||
@SerializedName("switch:100")
|
||||
public Shelly2RelayStatus switch100; // Pro 3EM Add-On
|
||||
|
||||
@SerializedName("cb:0")
|
||||
Shelly2CBStatus cb0;
|
||||
@SerializedName("cb:1")
|
||||
Shelly2CBStatus cb1;
|
||||
@SerializedName("cb:2")
|
||||
Shelly2CBStatus cb2;
|
||||
@SerializedName("cb:3")
|
||||
Shelly2CBStatus cb3;
|
||||
|
||||
@SerializedName("pm1:0")
|
||||
public Shelly2RelayStatus pm10;
|
||||
|
||||
@@ -817,6 +847,14 @@ public class Shelly2ApiJsonDTO {
|
||||
@SerializedName("smoke:0")
|
||||
public Shelly2DeviceStatusSmoke smoke0;
|
||||
|
||||
@SerializedName("voltmeter:0")
|
||||
public Shelly2DeviceStatusVoltage voltmeter0;
|
||||
@SerializedName("voltmeter:1")
|
||||
public Shelly2DeviceStatusVoltage voltmeter1;
|
||||
@SerializedName("voltmeter:2")
|
||||
public Shelly2DeviceStatusVoltage voltmeter2;
|
||||
@SerializedName("voltmeter:3")
|
||||
public Shelly2DeviceStatusVoltage voltmeter3;
|
||||
@SerializedName("voltmeter:100")
|
||||
public Shelly2DeviceStatusVoltage voltmeter100;
|
||||
|
||||
@@ -897,6 +935,16 @@ public class Shelly2ApiJsonDTO {
|
||||
public String[] errors;
|
||||
}
|
||||
|
||||
public class Shelly2CBStatus {
|
||||
public Integer id;
|
||||
public Boolean output;
|
||||
public String source;
|
||||
@SerializedName("total_cycles")
|
||||
public Integer totalCycles;
|
||||
public Boolean safety;
|
||||
Shelly2DeviceStatusTemp temperature;
|
||||
}
|
||||
|
||||
public static class Shelly2Pm1Status {
|
||||
public Integer id;
|
||||
public String source;
|
||||
@@ -982,6 +1030,7 @@ public class Shelly2ApiJsonDTO {
|
||||
// Cover
|
||||
public Integer pos;
|
||||
public Boolean on;
|
||||
public Boolean output;
|
||||
|
||||
// Dimmer / Light
|
||||
public Integer brightness;
|
||||
|
||||
+14
-2
@@ -45,9 +45,11 @@ import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettings
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsDimmer;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsEMeter;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsInput;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsLight;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsLogin;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsMeter;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsRelay;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsRgbwLight;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsRoller;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsStatus;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsUpdate;
|
||||
@@ -55,6 +57,7 @@ import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettings
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyShortLightStatus;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyShortStatusRelay;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyStatusLight;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyStatusLightChannel;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyStatusRelay;
|
||||
import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyStatusSensor;
|
||||
import org.openhab.binding.shelly.internal.api2.Shelly2ApiJsonDTO.Shelly2APClientList;
|
||||
@@ -195,8 +198,10 @@ public class Shelly2ApiRpc extends Shelly2ApiClient implements ShellyApiInterfac
|
||||
|
||||
profile.isRoller = dc.cover0 != null;
|
||||
profile.settings.relays = fillRelaySettings(profile, dc);
|
||||
profile.settings.relays = fillBreakerSettings(profile, dc);
|
||||
profile.settings.inputs = fillInputSettings(profile, dc);
|
||||
profile.settings.rollers = fillRollerSettings(profile, dc);
|
||||
profile.isCB = dc.cb0 != null || dc.cb1 != null || dc.cb2 != null || dc.cb3 != null;
|
||||
|
||||
profile.isEMeter = true;
|
||||
List<ShellySettingsInput> inputs = profile.settings.inputs;
|
||||
@@ -890,9 +895,16 @@ public class Shelly2ApiRpc extends Shelly2ApiClient implements ShellyApiInterfac
|
||||
}
|
||||
}
|
||||
Shelly2RpcRequestParams params = new Shelly2RpcRequestParams();
|
||||
String method = "";
|
||||
params.id = rIdx;
|
||||
params.on = SHELLY_API_ON.equals(turnMode);
|
||||
apiRequest(SHELLYRPC_METHOD_SWITCH_SET, params, String.class);
|
||||
if (!profile.isCB) {
|
||||
method = SHELLYRPC_METHOD_SWITCH_SET;
|
||||
params.on = SHELLY_API_ON.equals(turnMode);
|
||||
} else {
|
||||
method = SHELLYRPC_METHOD_CB_SET;
|
||||
params.output = SHELLY_API_ON.equals(turnMode);
|
||||
}
|
||||
apiRequest(method, params, String.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
@@ -104,6 +104,7 @@ public class ShellyThingCreator {
|
||||
public static final String SHELLYDT_PRO1PM = "SPSW-001PE16EU";
|
||||
public static final String SHELLYDT_PRO1PM_2 = "SPSW-101PE16EU";
|
||||
public static final String SHELLYDT_PRO1PM_3 = "SPSW-201PE16EU";
|
||||
public static final String SHELLYDT_PRO1CB = "SPCB-01VENEU";
|
||||
public static final String SHELLYDT_PRO2_RELAY = "SPSW-002XE16EU-relay";
|
||||
public static final String SHELLYDT_PRO2_RELAY_2 = "SPSW-102XE16EU-relay";
|
||||
public static final String SHELLYDT_PRO2_RELAY_3 = "SPSW-202XE16EU-relay";
|
||||
@@ -212,6 +213,7 @@ public class ShellyThingCreator {
|
||||
// Shelly Pro Series
|
||||
public static final String THING_TYPE_SHELLYPRO1_STR = "shellypro1";
|
||||
public static final String THING_TYPE_SHELLYPRO1PM_STR = "shellypro1pm";
|
||||
public static final String THING_TYPE_SHELLYPRO1CB_STR = "shellypro1cb";
|
||||
public static final String THING_TYPE_SHELLYPRO2_RELAY_STR = "shellypro2-relay";
|
||||
public static final String THING_TYPE_SHELLYPRO2PM_RELAY_STR = "shellypro2pm-relay";
|
||||
public static final String THING_TYPE_SHELLYPRO2PM_ROLLER_STR = "shellypro2pm-roller";
|
||||
@@ -335,6 +337,8 @@ public class ShellyThingCreator {
|
||||
public static final ThingTypeUID THING_TYPE_SHELLYPRO1 = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYPRO1_STR);
|
||||
public static final ThingTypeUID THING_TYPE_SHELLYPRO1PM = new ThingTypeUID(BINDING_ID,
|
||||
THING_TYPE_SHELLYPRO1PM_STR);
|
||||
public static final ThingTypeUID THING_TYPE_SHELLYPRO1CB = new ThingTypeUID(BINDING_ID,
|
||||
THING_TYPE_SHELLYPRO1CB_STR);
|
||||
public static final ThingTypeUID THING_TYPE_SHELLYPRO2_RELAY = new ThingTypeUID(BINDING_ID,
|
||||
THING_TYPE_SHELLYPRO2_RELAY_STR);
|
||||
public static final ThingTypeUID THING_TYPE_SHELLYPRO2PM_RELAY = new ThingTypeUID(BINDING_ID,
|
||||
@@ -435,6 +439,7 @@ public class ShellyThingCreator {
|
||||
THING_TYPE_MAPPING.put(SHELLYDT_PRO1PM, THING_TYPE_SHELLYPRO1PM_STR);
|
||||
THING_TYPE_MAPPING.put(SHELLYDT_PRO1PM_2, THING_TYPE_SHELLYPRO1PM_STR);
|
||||
THING_TYPE_MAPPING.put(SHELLYDT_PRO1PM_3, THING_TYPE_SHELLYPRO1PM_STR);
|
||||
THING_TYPE_MAPPING.put(SHELLYDT_PRO1CB, THING_TYPE_SHELLYPRO1CB_STR);
|
||||
THING_TYPE_MAPPING.put(SHELLYDT_PRO2_RELAY, THING_TYPE_SHELLYPRO2_RELAY_STR);
|
||||
THING_TYPE_MAPPING.put(SHELLYDT_PRO2_RELAY_2, THING_TYPE_SHELLYPRO2_RELAY_STR);
|
||||
THING_TYPE_MAPPING.put(SHELLYDT_PRO2_RELAY_3, THING_TYPE_SHELLYPRO2_RELAY_STR);
|
||||
@@ -522,6 +527,7 @@ public class ShellyThingCreator {
|
||||
|
||||
THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPRO1_STR, THING_TYPE_SHELLYPRO1_STR);
|
||||
THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPRO1PM_STR, THING_TYPE_SHELLYPRO1PM_STR);
|
||||
THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPRO1CB_STR, THING_TYPE_SHELLYPRO1CB_STR);
|
||||
THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPRO2PM_RELAY_STR, THING_TYPE_SHELLYPRO2PM_RELAY_STR);
|
||||
THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPRO2PM_ROLLER_STR, THING_TYPE_SHELLYPRO2PM_ROLLER_STR);
|
||||
THING_TYPE_MAPPING.put(THING_TYPE_SHELLYPRO2_RELAY_STR, THING_TYPE_SHELLYPRO2_RELAY_STR);
|
||||
|
||||
@@ -113,6 +113,7 @@ thing-type.shelly.shelly1pmmini.description = Shelly Plus Mini 1PM - Single Rel
|
||||
# Pro Devices
|
||||
thing-type.shelly.shellypro1.description = Shelly Pro 1 - Single Relay Switch
|
||||
thing-type.shelly.shellypro1pm.description = Shelly Pro 1PM - Single Relay Switch with Power Meter
|
||||
thing-type.shelly.shellypro1cb.description = Shelly Pro 1CB - Single Circuit Breaker with Voltmeter
|
||||
thing-type.shelly.shellypro2-relay.description = Shelly Pro 2 - Dual Relay Switch
|
||||
thing-type.shelly.shellypro2pm-relay.description= Shelly Pro 2PM - Dual Relay Switch with Power Meter
|
||||
thing-type.shelly.shellypro2pm-roller.description = Shelly Pro 2PM - Roller Control with Power Meter
|
||||
|
||||
+14
@@ -225,6 +225,20 @@
|
||||
<config-description-ref uri="thing-type:shelly:relay-gen2"/>
|
||||
</thing-type>
|
||||
|
||||
<thing-type id="shellypro1cb">
|
||||
<label>ShellyPro 1CB</label>
|
||||
<description>@text/thing-type.shelly.shellypro1cb.description</description>
|
||||
<semantic-equipment-tag>ControlDevice</semantic-equipment-tag>
|
||||
<channel-groups>
|
||||
<channel-group id="relay" typeId="relayChannel"/>
|
||||
<channel-group id="meter" typeId="meter"/>
|
||||
<channel-group id="device" typeId="deviceStatus"/>
|
||||
</channel-groups>
|
||||
|
||||
<representation-property>serviceName</representation-property>
|
||||
<config-description-ref uri="thing-type:shelly:relay-gen2"/>
|
||||
</thing-type>
|
||||
|
||||
<thing-type id="shellypro2-relay">
|
||||
<label>ShellyPro 2 Relay</label>
|
||||
<description>@text/thing-type.shelly.shellypro2-relay.description</description>
|
||||
|
||||
+1
@@ -174,6 +174,7 @@ public class ShellyThingCreatorTest {
|
||||
Arguments.of(SHELLYDT_PRO1PM, "", THING_TYPE_SHELLYPRO1PM_STR), //
|
||||
Arguments.of(SHELLYDT_PRO1PM_2, "", THING_TYPE_SHELLYPRO1PM_STR), //
|
||||
Arguments.of(SHELLYDT_PRO1PM_3, "", THING_TYPE_SHELLYPRO1PM_STR), //
|
||||
Arguments.of(SHELLYDT_PRO1CB, "", THING_TYPE_SHELLYPRO1CB_STR), //
|
||||
Arguments.of("SPSW-002XE16EU", "relay", THING_TYPE_SHELLYPRO2_RELAY_STR), //
|
||||
Arguments.of("SPSW-102XE16EU", "relay", THING_TYPE_SHELLYPRO2_RELAY_STR), //
|
||||
Arguments.of("SPSW-202XE16EU", "relay", THING_TYPE_SHELLYPRO2_RELAY_STR), //
|
||||
|
||||
Reference in New Issue
Block a user