[deconz] add doorlock support (#8965)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
parent
6616353baa
commit
fdebb33059
|
@ -29,7 +29,7 @@ These sensors are supported:
|
||||||
| Color Controller | ZBT-Remote-ALL-RGBW | `colorcontrol` |
|
| Color Controller | ZBT-Remote-ALL-RGBW | `colorcontrol` |
|
||||||
|
|
||||||
|
|
||||||
Additionally lights, window coverings (blinds) and thermostats are supported:
|
Additionally lights, window coverings (blinds), door locks and thermostats are supported:
|
||||||
|
|
||||||
| Device type | Resource Type | Thing type |
|
| Device type | Resource Type | Thing type |
|
||||||
|--------------------------------------|-----------------------------------------------|-------------------------|
|
|--------------------------------------|-----------------------------------------------|-------------------------|
|
||||||
|
@ -41,6 +41,7 @@ Additionally lights, window coverings (blinds) and thermostats are supported:
|
||||||
| Blind / Window Covering | Window covering device | `windowcovering` |
|
| Blind / Window Covering | Window covering device | `windowcovering` |
|
||||||
| Thermostat | ZHAThermostat | `thermostat` |
|
| Thermostat | ZHAThermostat | `thermostat` |
|
||||||
| Warning Device (Siren) | Warning device | `warningdevice` |
|
| Warning Device (Siren) | Warning device | `warningdevice` |
|
||||||
|
| Door Lock | A remotely operatable door lock | `doorlock` |
|
||||||
|
|
||||||
Currently only light-groups are supported via the thing-type `lightgroup`.
|
Currently only light-groups are supported via the thing-type `lightgroup`.
|
||||||
|
|
||||||
|
@ -160,6 +161,7 @@ Other devices support
|
||||||
| switch | Switch | R/W | State of a ON/OFF device | `onofflight` |
|
| switch | Switch | R/W | State of a ON/OFF device | `onofflight` |
|
||||||
| color | Color | R/W | Color of an multi-color light | `colorlight`, `extendedcolorlight`, `lightgroup`|
|
| color | Color | R/W | Color of an multi-color light | `colorlight`, `extendedcolorlight`, `lightgroup`|
|
||||||
| color_temperature | Number | R/W | Color temperature in kelvin. The value range is determined by each individual light | `colortemperaturelight`, `extendedcolorlight`, `lightgroup` |
|
| color_temperature | Number | R/W | Color temperature in kelvin. The value range is determined by each individual light | `colortemperaturelight`, `extendedcolorlight`, `lightgroup` |
|
||||||
|
| lock | Switch | R/W | Lock (ON) or unlock (OFF) the doorlock| `doorlock` |
|
||||||
| position | Rollershutter | R/W | Position of the blind | `windowcovering` |
|
| position | Rollershutter | R/W | Position of the blind | `windowcovering` |
|
||||||
| heatsetpoint | Number:Temperature | R/W | Target Temperature in °C | `thermostat` |
|
| heatsetpoint | Number:Temperature | R/W | Target Temperature in °C | `thermostat` |
|
||||||
| valve | Number:Dimensionless | R | Valve position in % | `thermostat` |
|
| valve | Number:Dimensionless | R | Valve position in % | `thermostat` |
|
||||||
|
@ -213,6 +215,7 @@ Bridge deconz:deconz:homeserver [ host="192.168.0.10", apikey="ABCDEFGHIJ" ] {
|
||||||
alarmsensor basement-alarm "Basement Alarm Sensor" [ id="8", lastSeenPolling=5 ]
|
alarmsensor basement-alarm "Basement Alarm Sensor" [ id="8", lastSeenPolling=5 ]
|
||||||
dimmablelight livingroom-ceiling "Livingroom Ceiling" [ id="1" ]
|
dimmablelight livingroom-ceiling "Livingroom Ceiling" [ id="1" ]
|
||||||
lightgroup livingroom "Livingroom" [ id="1" ]
|
lightgroup livingroom "Livingroom" [ id="1" ]
|
||||||
|
doorlock entrance-door "Door Lock" [ id="20" ]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -227,7 +230,8 @@ Contact Livingroom_Window "Window Livingroom [%s]"
|
||||||
Switch Basement_Water_Leakage "Basement Water Leakage [%s]" { channel="deconz:waterleakagesensor:homeserver:basement-water-leakage:waterleakage" }
|
Switch Basement_Water_Leakage "Basement Water Leakage [%s]" { channel="deconz:waterleakagesensor:homeserver:basement-water-leakage:waterleakage" }
|
||||||
Switch Basement_Alarm "Basement Alarm Triggered [%s]" { channel="deconz:alarmsensor:homeserver:basement-alarm:alarm" }
|
Switch Basement_Alarm "Basement Alarm Triggered [%s]" { channel="deconz:alarmsensor:homeserver:basement-alarm:alarm" }
|
||||||
Dimmer Livingroom_Ceiling "Livingroom Ceiling [%d]" <light> { channel="deconz:dimmablelight:homeserver:livingroom-ceiling:brightness" }
|
Dimmer Livingroom_Ceiling "Livingroom Ceiling [%d]" <light> { channel="deconz:dimmablelight:homeserver:livingroom-ceiling:brightness" }
|
||||||
Color Livingroom "Livingroom Light Control"
|
Color Livingroom "Livingroom Light Control" { channel="deconz:lightgroup:homeserver:livingroom:color" }
|
||||||
|
Switch Entrance_Door "Doorlock" { channel="deconz:doorlock:homeserver:entrance-door:lock" }
|
||||||
```
|
```
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
|
@ -62,6 +62,7 @@ public class BindingConstants {
|
||||||
"extendedcolorlight");
|
"extendedcolorlight");
|
||||||
public static final ThingTypeUID THING_TYPE_WINDOW_COVERING = new ThingTypeUID(BINDING_ID, "windowcovering");
|
public static final ThingTypeUID THING_TYPE_WINDOW_COVERING = new ThingTypeUID(BINDING_ID, "windowcovering");
|
||||||
public static final ThingTypeUID THING_TYPE_WARNING_DEVICE = new ThingTypeUID(BINDING_ID, "warningdevice");
|
public static final ThingTypeUID THING_TYPE_WARNING_DEVICE = new ThingTypeUID(BINDING_ID, "warningdevice");
|
||||||
|
public static final ThingTypeUID THING_TYPE_DOORLOCK = new ThingTypeUID(BINDING_ID, "doorlock");
|
||||||
|
|
||||||
// groups
|
// groups
|
||||||
public static final ThingTypeUID THING_TYPE_LIGHTGROUP = new ThingTypeUID(BINDING_ID, "lightgroup");
|
public static final ThingTypeUID THING_TYPE_LIGHTGROUP = new ThingTypeUID(BINDING_ID, "lightgroup");
|
||||||
|
@ -110,6 +111,7 @@ public class BindingConstants {
|
||||||
public static final String CHANNEL_ALERT = "alert";
|
public static final String CHANNEL_ALERT = "alert";
|
||||||
public static final String CHANNEL_ALL_ON = "all_on";
|
public static final String CHANNEL_ALL_ON = "all_on";
|
||||||
public static final String CHANNEL_ANY_ON = "any_on";
|
public static final String CHANNEL_ANY_ON = "any_on";
|
||||||
|
public static final String CHANNEL_LOCK = "lock";
|
||||||
|
|
||||||
// Thing configuration
|
// Thing configuration
|
||||||
public static final String CONFIG_HOST = "host";
|
public static final String CONFIG_HOST = "host";
|
||||||
|
|
|
@ -196,6 +196,9 @@ public class ThingDiscoveryService extends AbstractDiscoveryService implements D
|
||||||
case WARNING_DEVICE:
|
case WARNING_DEVICE:
|
||||||
thingTypeUID = THING_TYPE_WARNING_DEVICE;
|
thingTypeUID = THING_TYPE_WARNING_DEVICE;
|
||||||
break;
|
break;
|
||||||
|
case DOORLOCK:
|
||||||
|
thingTypeUID = THING_TYPE_DOORLOCK;
|
||||||
|
break;
|
||||||
case CONFIGURATION_TOOL:
|
case CONFIGURATION_TOOL:
|
||||||
// ignore configuration tool device
|
// ignore configuration tool device
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -63,7 +63,7 @@ import com.google.gson.Gson;
|
||||||
public class LightThingHandler extends DeconzBaseThingHandler<LightMessage> {
|
public class LightThingHandler extends DeconzBaseThingHandler<LightMessage> {
|
||||||
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPE_UIDS = Set.of(THING_TYPE_COLOR_TEMPERATURE_LIGHT,
|
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPE_UIDS = Set.of(THING_TYPE_COLOR_TEMPERATURE_LIGHT,
|
||||||
THING_TYPE_DIMMABLE_LIGHT, THING_TYPE_COLOR_LIGHT, THING_TYPE_EXTENDED_COLOR_LIGHT, THING_TYPE_ONOFF_LIGHT,
|
THING_TYPE_DIMMABLE_LIGHT, THING_TYPE_COLOR_LIGHT, THING_TYPE_EXTENDED_COLOR_LIGHT, THING_TYPE_ONOFF_LIGHT,
|
||||||
THING_TYPE_WINDOW_COVERING, THING_TYPE_WARNING_DEVICE);
|
THING_TYPE_WINDOW_COVERING, THING_TYPE_WARNING_DEVICE, THING_TYPE_DOORLOCK);
|
||||||
|
|
||||||
private static final long DEFAULT_COMMAND_EXPIRY_TIME = 250; // in ms
|
private static final long DEFAULT_COMMAND_EXPIRY_TIME = 250; // in ms
|
||||||
private static final int BRIGHTNESS_DIM_STEP = 26; // ~ 10%
|
private static final int BRIGHTNESS_DIM_STEP = 26; // ~ 10%
|
||||||
|
@ -137,6 +137,7 @@ public class LightThingHandler extends DeconzBaseThingHandler<LightMessage> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case CHANNEL_SWITCH:
|
case CHANNEL_SWITCH:
|
||||||
|
case CHANNEL_LOCK:
|
||||||
if (command instanceof OnOffType) {
|
if (command instanceof OnOffType) {
|
||||||
newLightState.on = (command == OnOffType.ON);
|
newLightState.on = (command == OnOffType.ON);
|
||||||
} else {
|
} else {
|
||||||
|
@ -290,6 +291,7 @@ public class LightThingHandler extends DeconzBaseThingHandler<LightMessage> {
|
||||||
updateState(channelId, "alert".equals(newState.alert) ? OnOffType.ON : OnOffType.OFF);
|
updateState(channelId, "alert".equals(newState.alert) ? OnOffType.ON : OnOffType.OFF);
|
||||||
break;
|
break;
|
||||||
case CHANNEL_SWITCH:
|
case CHANNEL_SWITCH:
|
||||||
|
case CHANNEL_LOCK:
|
||||||
if (on != null) {
|
if (on != null) {
|
||||||
updateState(channelId, OnOffType.from(on));
|
updateState(channelId, OnOffType.from(on));
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ public enum LightType {
|
||||||
WINDOW_COVERING_DEVICE("Window covering device"),
|
WINDOW_COVERING_DEVICE("Window covering device"),
|
||||||
CONFIGURATION_TOOL("Configuration tool"),
|
CONFIGURATION_TOOL("Configuration tool"),
|
||||||
WARNING_DEVICE("Warning device"),
|
WARNING_DEVICE("Warning device"),
|
||||||
|
DOORLOCK("Door Lock"),
|
||||||
UNKNOWN("");
|
UNKNOWN("");
|
||||||
|
|
||||||
private static final Map<String, LightType> MAPPING = Arrays.stream(LightType.values())
|
private static final Map<String, LightType> MAPPING = Arrays.stream(LightType.values())
|
||||||
|
|
|
@ -13,6 +13,10 @@
|
||||||
<channels>
|
<channels>
|
||||||
<channel id="alert" typeId="alert"></channel>
|
<channel id="alert" typeId="alert"></channel>
|
||||||
</channels>
|
</channels>
|
||||||
|
|
||||||
|
<representation-property>uid</representation-property>
|
||||||
|
|
||||||
|
<config-description-ref uri="thing-type:deconz:sensor"/>
|
||||||
</thing-type>
|
</thing-type>
|
||||||
|
|
||||||
<thing-type id="windowcovering">
|
<thing-type id="windowcovering">
|
||||||
|
@ -107,6 +111,21 @@
|
||||||
<config-description-ref uri="thing-type:deconz:light"/>
|
<config-description-ref uri="thing-type:deconz:light"/>
|
||||||
</thing-type>
|
</thing-type>
|
||||||
|
|
||||||
|
<thing-type id="doorlock">
|
||||||
|
<supported-bridge-type-refs>
|
||||||
|
<bridge-type-ref id="deconz"/>
|
||||||
|
</supported-bridge-type-refs>
|
||||||
|
<label>Doorlock</label>
|
||||||
|
<description>A doorlock that can be locked (ON) or unlocked (OFF).</description>
|
||||||
|
<channels>
|
||||||
|
<channel typeId="lock" id="switch"/>
|
||||||
|
</channels>
|
||||||
|
|
||||||
|
<representation-property>uid</representation-property>
|
||||||
|
|
||||||
|
<config-description-ref uri="thing-type:deconz:sensor"/>
|
||||||
|
</thing-type>
|
||||||
|
|
||||||
<channel-type id="position">
|
<channel-type id="position">
|
||||||
<item-type>Rollershutter</item-type>
|
<item-type>Rollershutter</item-type>
|
||||||
<label>Position</label>
|
<label>Position</label>
|
||||||
|
@ -140,4 +159,8 @@
|
||||||
<label>Alert</label>
|
<label>Alert</label>
|
||||||
</channel-type>
|
</channel-type>
|
||||||
|
|
||||||
|
<channel-type id="lock">
|
||||||
|
<item-type>Switch</item-type>
|
||||||
|
<label>Lock</label>
|
||||||
|
</channel-type>
|
||||||
</thing:thing-descriptions>
|
</thing:thing-descriptions>
|
||||||
|
|
Loading…
Reference in New Issue