public static final String THING_TYPE_SHELLY4PRO_STR = "shelly4pro";
public static final String THING_TYPE_SHELLYPLUG_STR = "shellyplug";
public static final String THING_TYPE_SHELLYPLUGS_STR = "shellyplugs";
+ public static final String THING_TYPE_SHELLYPLUGU1_STR = "shellyplugu1"; // Shely Plug US
public static final String THING_TYPE_SHELLYDIMMER_STR = "shellydimmer";
public static final String THING_TYPE_SHELLYDIMMER2_STR = "shellydimmer2";
public static final String THING_TYPE_SHELLYIX3_STR = "shellyix3";
public static final String SHELLYDT_1PM = "SHSW-PM";
public static final String SHELLYDT_SHPLG = "SHPLG-1";
public static final String SHELLYDT_SHPLG_S = "SHPLG-S";
+ public static final String SHELLYDT_SHPLG_U1 = "SHPLG-U1";
public static final String SHELLYDT_SHELLY2 = "SHSW-21";
public static final String SHELLYDT_SHELLY25 = "SHSW-25";
public static final String SHELLYDT_SHPRO = "SHSW-44";
public static final ThingTypeUID THING_TYPE_SHELLY4PRO = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLY4PRO_STR);
public static final ThingTypeUID THING_TYPE_SHELLYPLUG = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYPLUG_STR);
public static final ThingTypeUID THING_TYPE_SHELLYPLUGS = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYPLUGS_STR);
+ public static final ThingTypeUID THING_TYPE_SHELLYPLUGU1 = new ThingTypeUID(BINDING_ID,
+ THING_TYPE_SHELLYPLUGU1_STR);
public static final ThingTypeUID THING_TYPE_SHELLYDIMMER = new ThingTypeUID(BINDING_ID,
THING_TYPE_SHELLYDIMMER_STR);
public static final ThingTypeUID THING_TYPE_SHELLYDIMMER2 = new ThingTypeUID(BINDING_ID,
public static final ThingTypeUID THING_TYPE_SHELLYUNKNOWN = new ThingTypeUID(BINDING_ID,
THING_TYPE_SHELLYUNKNOWN_STR);
- public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections
- .unmodifiableSet(Stream
- .of(THING_TYPE_SHELLY1, THING_TYPE_SHELLY1PM, THING_TYPE_SHELLYEM, THING_TYPE_SHELLY3EM,
- THING_TYPE_SHELLY2_RELAY, THING_TYPE_SHELLY2_ROLLER, THING_TYPE_SHELLY25_RELAY,
- THING_TYPE_SHELLY25_ROLLER, THING_TYPE_SHELLY4PRO, THING_TYPE_SHELLYPLUG,
- THING_TYPE_SHELLYPLUGS, THING_TYPE_SHELLYDIMMER, THING_TYPE_SHELLYDIMMER2,
- THING_TYPE_SHELLYIX3, THING_TYPE_SHELLYBULB, THING_TYPE_SHELLYDUO, THING_TYPE_SHELLYVINTAGE,
- THING_TYPE_SHELLYRGBW2_COLOR, THING_TYPE_SHELLYRGBW2_WHITE, THING_TYPE_SHELLYHT,
- THING_TYPE_SHELLYSENSE, THING_TYPE_SHELLYEYE, THING_TYPE_SHELLYSMOKE, THING_TYPE_SHELLYGAS,
- THING_TYPE_SHELLYFLOOD, THING_TYPE_SHELLYDOORWIN, THING_TYPE_SHELLYDOORWIN2,
- THING_TYPE_SHELLYBUTTON1, THING_TYPE_SHELLYPROTECTED, THING_TYPE_SHELLYUNKNOWN)
- .collect(Collectors.toSet()));
+ public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet(
+ Stream.of(THING_TYPE_SHELLY1, THING_TYPE_SHELLY1PM, THING_TYPE_SHELLYEM, THING_TYPE_SHELLY3EM,
+ THING_TYPE_SHELLY2_RELAY, THING_TYPE_SHELLY2_ROLLER, THING_TYPE_SHELLY25_RELAY,
+ THING_TYPE_SHELLY25_ROLLER, THING_TYPE_SHELLY4PRO, THING_TYPE_SHELLYPLUG, THING_TYPE_SHELLYPLUGS,
+ THING_TYPE_SHELLYPLUGU1, THING_TYPE_SHELLYDIMMER, THING_TYPE_SHELLYDIMMER2, THING_TYPE_SHELLYIX3,
+ THING_TYPE_SHELLYBULB, THING_TYPE_SHELLYDUO, THING_TYPE_SHELLYVINTAGE, THING_TYPE_SHELLYRGBW2_COLOR,
+ THING_TYPE_SHELLYRGBW2_WHITE, THING_TYPE_SHELLYHT, THING_TYPE_SHELLYSENSE, THING_TYPE_SHELLYEYE,
+ THING_TYPE_SHELLYSMOKE, THING_TYPE_SHELLYGAS, THING_TYPE_SHELLYFLOOD, THING_TYPE_SHELLYDOORWIN,
+ THING_TYPE_SHELLYDOORWIN2, THING_TYPE_SHELLYBUTTON1, THING_TYPE_SHELLYPROTECTED,
+ THING_TYPE_SHELLYUNKNOWN).collect(Collectors.toSet()));
// Thing Configuration Properties
public static final String CONFIG_DEVICEIP = "deviceIp";
reqStatus = sendRequest(reqStatus, config.deviceIp, COLOIT_URI_DEVSTATUS, Type.NON);
discovering = true;
}
- } catch (IllegalArgumentException | NullPointerException e) {
+ } catch (JsonSyntaxException | IllegalArgumentException | NullPointerException e) {
logger.debug("{}: Unable to process CoIoT Message for payload={}", thingName, payload, e);
resetSerial();
}
String thingLabel = deviceName.isEmpty() ? name + " - " + address
: deviceName + " (" + name + "@" + address + ")";
return DiscoveryResultBuilder.create(thingUID).withProperties(properties).withLabel(thingLabel)
- .withRepresentationProperty(name).build();
+ .withRepresentationProperty(PROPERTY_DEV_NAME).build();
}
} catch (IOException | NullPointerException e) {
// maybe some format description was buggy
public class ShellyThingCreator {
private static final Map<String, String> THING_TYPE_MAPPING = new LinkedHashMap<>();
static {
- // mapping by thing type
+ // mapping by device type id
THING_TYPE_MAPPING.put(SHELLYDT_1PM, THING_TYPE_SHELLY1PM_STR);
THING_TYPE_MAPPING.put(SHELLYDT_1, THING_TYPE_SHELLY1_STR);
THING_TYPE_MAPPING.put(SHELLYDT_3EM, THING_TYPE_SHELLY3EM_STR);
THING_TYPE_MAPPING.put(SHELLYDT_EM, THING_TYPE_SHELLYEM_STR);
+ THING_TYPE_MAPPING.put(SHELLYDT_SHPLG_S, THING_TYPE_SHELLYPLUGS_STR);
+ THING_TYPE_MAPPING.put(SHELLYDT_SHPLG_U1, THING_TYPE_SHELLYPLUGU1_STR);
THING_TYPE_MAPPING.put(SHELLYDT_GAS, THING_TYPE_SHELLYGAS_STR);
THING_TYPE_MAPPING.put(SHELLYDT_DW, THING_TYPE_SHELLYDOORWIN_STR);
THING_TYPE_MAPPING.put(SHELLYDT_DW2, THING_TYPE_SHELLYDOORWIN2_STR);
if (name.startsWith(THING_TYPE_SHELLYPLUGS_STR) || name.contains("-s")) {
return THING_TYPE_SHELLYPLUGS_STR;
}
+ if (name.startsWith(THING_TYPE_SHELLYPLUGU1_STR)) {
+ return THING_TYPE_SHELLYPLUGU1_STR;
+ }
return THING_TYPE_SHELLYPLUG_STR;
}
if (name.startsWith(THING_TYPE_SHELLYRGBW2_PREFIX)) {
toQuantityType(getDouble(lastMin1), DIGITS_WATT, SmartHomeUnits.WATT));
// convert totalWatts into kw/h
- totalWatts = totalWatts / (60.0 * 10000.0);
+ totalWatts = totalWatts / (60.0 * 1000.0);
updated |= thingHandler.updateChannel(groupName, CHANNEL_METER_CURRENTWATTS,
toQuantityType(getDouble(currentWatts), DIGITS_WATT, SmartHomeUnits.WATT));
updated |= thingHandler.updateChannel(groupName, CHANNEL_METER_TOTALKWH,
channel-type.shelly.colorEffectRGBW2.option.2 = Farbverlauf
channel-type.shelly.colorEffectRGBW2.option.3 = Blitzen
channel-type.shelly.sensorTemp.label = Temperatur
-channel-type.shelly.sensorTemp.description = Aktuelle Temperatur des Sensors in ∞C
+channel-type.shelly.sensorTemp.description = Aktuelle Temperatur des Sensors in °C
channel-type.shelly.sensorExtTemp.label = Temperatur
channel-type.shelly.sensorExtTemp.description = Aktuelle Temperatur des externen Sensors in ∞C
channel-type.shelly.sensorExtHum.label = Luftfeuchtigkeit
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:light"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:light"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:light"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:rgbw2"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:rgbw2"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:relay"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:relay"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:relay"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:relay"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:relay"/>
</thing-type>
+
<thing-type id="shelly2-roller">
<label>Shelly2 Roller (SHSW-21)</label>
<description>Shelly2 in Roller Mode</description>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:roller"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:relay"/>
</thing-type>
+
<thing-type id="shelly25-roller">
<label>Shelly2.5 Roller (SHSW-25)</label>
<description>Shelly2 in Roller Mode</description>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:roller"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:relay"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:relay"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
+ <config-description-ref uri="thing-type:shelly:relay"/>
+ </thing-type>
+
+ <thing-type id="shellyplugu1">
+ <label>Shelly Plug US (SHPLG-U1)</label>
+ <description>Shelly Plug US with relay and meter</description>
+
+ <channel-groups>
+ <channel-group id="relay" typeId="relayChannelPlug"/>
+ <channel-group id="meter" typeId="meter"/>
+ <channel-group id="device" typeId="deviceStatus"/>
+ </channel-groups>
+
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:relay"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:dimmer"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:dimmer"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:relay"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:battery"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:battery"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:basic"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:battery"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:battery"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:battery"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:battery"/>
</thing-type>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
+ <representation-property>deviceName</representation-property>
<config-description-ref uri="thing-type:shelly:battery"/>
</thing-type>
<label>Shelly Device</label>
<description>A password protected or unknown device.</description>
+ <representation-property>deviceName</representation-property>
<config-description>
<parameter name="userId" type="text" required="true">
<label>UserID</label>
<thing-type id="shellyunknown">
<label>Unknown Shelly Device</label>
<description>This device is currently not supported</description>
+ <representation-property>deviceName</representation-property>
</thing-type>
</thing:thing-descriptions>