mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[konnected] Added support for Konnected Pro (#13180)
* - bug fix in konnnected handler to update change of smarthome units to Units - multiple changes to code to enable support for the konnected pro-module * Added optional configuration for callback URI * Added support for more than one buzzer sound. Made zone/pin variables consistent. Removed preconfigured channels to be consistent (either all should be added or none). Signed-off-by: Haavar Valeur <haavar@haavar.com>
This commit is contained in:
parent
f4fef5f6df
commit
6c78fb3161
@ -2,12 +2,12 @@
|
||||
|
||||
This binding is for interacting with the [Konnected Alarm Panel](https://konnected.io/).
|
||||
A module which interfaces with existing home security sensors.
|
||||
Konnected is an open-source firmware and software that runs on a NodeMCU ESP8266 device.
|
||||
The Konnected hardware is specifically designed for an alarm panel installation, but the general purpose firmware/software can be run on any ESP8266 device.
|
||||
Konnected is an open-source firmware and software that runs on a NodeMCU ESP8266 (Wi-Fi) or ESP32 (Pro) device.
|
||||
The Konnected hardware is designed for an alarm panel installation, but the general purpose firmware/software can be run on a generic NodeMCU device.
|
||||
|
||||
## Supported Things
|
||||
|
||||
This binding supports one type of thing module, which represents a Konnected Alarm Panel.
|
||||
``
|
||||
This binding supports two types of thing modules, which represents the Wi-Fi version of the Konnected Alarm Panel and the Konnected Alarm Panel Pro.
|
||||
|
||||
## Discovery
|
||||
|
||||
@ -28,24 +28,14 @@ The blink setting will disable the transmission LED on the Konnected Alarm Panel
|
||||
|
||||
## Channels
|
||||
|
||||
The auto discovered thing adds two default channels.
|
||||
|
||||
| Channel | Channel Id | Channel Type | Description |
|
||||
|---------|------------|--------------|----------------------------------------------------------|
|
||||
| 1 | Zone_6 | Switch | A Switch channel for zone 6 |
|
||||
| 2 | Out | Actuator | The Channel for the Out Pin on the Konnected Alarm Panel |
|
||||
|
||||
One channel for Zone 6 which is a sensor type channel, and one channel for the out pin that is an actuator type channel.
|
||||
These channels represent the two pins on the Konnected Alarm Panel whose type cannot be changed.
|
||||
For zones 1-5, you will need to add channels for the remaining zones that you have connected and configure them with the appropriate configuration parameters for each channel.
|
||||
|
||||
You will need to add channels for the zones that you have connected and configure them with the appropriate configuration parameters for each channel.
|
||||
|
||||
| Channel Type | Item Type | Config Parameters | Description |
|
||||
|--------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Switch | Switch | Zone Number | This is the channel type for sensors or other read only devices |
|
||||
| Actuator | Switch | Zone Number, Momentary, Pause, Times | This is the channel type for devices whose state can be turned on an off by the Konnected Alarm Panel |
|
||||
| Temperature | Number:Temperature | Zone Number, DHT22, Poll Interval, DS18b20 Address | This is the channel for sensors which measure temperature (DHT22 and DS18B20). The DHT22 setting should be set to true when the channel is monitoring a zone connected to a DHT22 sensor and false if the zone is connected to a DS1820B sensor |
|
||||
| Humidity | Number:Dimensionless | Zone Number | This is the channel type for the humidity sensor on a connected DHT22 sensor |
|
||||
| Switch-(wifi/pro) | Switch | Zone Number | This is the channel type for sensors or other read only devices |
|
||||
| Actuator-(wifi/pro) | Switch | Zone Number, Momentary, Pause, Times | This is the channel type for devices whose state can be turned on an off by the Konnected Alarm Panel |
|
||||
| Temperature-(wifi/pro) | Number:Temperature | Zone Number, DHT22, Poll Interval, DS18b20 Address | This is the channel for sensors which measure temperature (DHT22 and DS18B20). The DHT22 setting should be set to true when the channel is monitoring a zone connected to a DHT22 sensor and false if the zone is connected to a DS1820B sensor |
|
||||
| Humidity-(wifi/pro) | Number:Dimensionless | Zone Number | This is the channel type for the humidity sensor on a connected DHT22 sensor |
|
||||
|
||||
You will need to configure each channel with the appropriate zone number corresponding to the zone on The Konnected Alarm Panel.
|
||||
Then you need to link the corresponding item to the channel.
|
||||
@ -58,6 +48,11 @@ A beep/blink switch is like a momentary switch that repeats either a specified n
|
||||
This is commonly used with a piezo buzzer to make a "beep beep" sound when a door is opened, or to make a repeating beep pattern for an alarm or audible warning.
|
||||
It can also be used to blink lights.
|
||||
|
||||
A note about the Alarm Panel Pro.
|
||||
Zones 1-8 can be configured for any Channel-Types.
|
||||
Zones 9-12, out1, alarm1 and out2/alarm2 can only be configured as an actuator.
|
||||
For more information, see: https://help.konnected.io/support/solutions/articles/32000028978-alarm-panel-pro-inputs-and-outputs
|
||||
|
||||
DSB1820 temperature probes.
|
||||
These are one wire devices which can all be Konnected to the same "Zone" on the Konnected Alarm Panel.
|
||||
As part of its transmission the module will include an unique "address" property of each sensor probe that will be logged to the debug log when received.
|
||||
@ -71,8 +66,11 @@ A channel should be added for each probe, as indicated above and configured with
|
||||
*.items
|
||||
|
||||
```
|
||||
Contact Front_Door_Sensor "Front Door" {channel="konnected:module:generic:switch"}
|
||||
Switch Siren "Siren" {channel="konnected:module:generic:actuator"}
|
||||
Switch Front_Door_Sensor "Front Door" {channel="konnected:wifi-module:generic:switch-wifi"}
|
||||
Switch Siren "Siren" {channel="konnected:wifi-module:generic:actuator-wifi"}
|
||||
|
||||
Switch Front_Door_Sensor_Pro "Front Door" {channel="konnected:pro-module:generic:switch-pro"}
|
||||
Switch Siren_Pro "Siren" {channel="konnected:pro-module:generic:actuator-pro"}
|
||||
```
|
||||
|
||||
*.sitemap
|
||||
@ -85,12 +83,20 @@ Switch item=Siren label="Alarm Siren" icon="Siren" mappings=[ON="Open", OFF="Clo
|
||||
*.things
|
||||
|
||||
```
|
||||
Thing konnected:module:generic "Konnected Module" [ipAddress="http://192.168.30.153:9586", macAddress="1586517"]{
|
||||
Type switch : switch "Front Door" [channel_zone=1]
|
||||
Type actuator : actuator "Siren" [channel_zone=1, momentary = 50, times = 2, pause = 50]
|
||||
Type humidity : humidity "DHT - Humidity" [channel_zone=1]
|
||||
Type temperature : temperature "DHT Temperature" [channel_zone=1, tempsensorType = true, pollinterval = 1]
|
||||
Type temperature : temperature "DS18B20 Temperature" [channel_zone=1, tempsensorType = false, pollinterval = 1, ds18b20_address = "XX:XX:XX:XX:XX:XX:XX"]
|
||||
Thing konnected:wifi-module:generic "Konnected Module" [ipAddress="http://192.168.30.153:9586", macAddress="1586517"]{
|
||||
Type switch : switch-wifi "Front Door" [channel_zone=1]
|
||||
Type actuator : actuator-wifi "Siren" [channel_zone=1, momentary = 50, times = 2, pause = 50]
|
||||
Type humidity : humidity-wifi "DHT - Humidity" [channel_zone=1]
|
||||
Type temperature : temperature-wifi "DHT Temperature" [channel_zone=1, tempsensorType = true, pollinterval = 1]
|
||||
Type temperature : temperature-wifi "DS18B20 Temperature" [channel_zone=1, tempsensorType = false, pollinterval = 1, ds18b20_address = "XX:XX:XX:XX:XX:XX:XX"]
|
||||
}
|
||||
|
||||
Thing konnected:pro-module:generic "Konnected Module" [ipAddress="http://192.168.30.154:9586", macAddress="1684597"]{
|
||||
Type switch : switch-pro "Front Door" [channel_zone=1]
|
||||
Type actuator : actuator-pro "Siren" [channel_zone=1, momentary = 50, times = 2, pause = 50]
|
||||
Type humidity : humidity-pro "DHT - Humidity" [channel_zone=1]
|
||||
Type temperature : temperature-pro "DHT Temperature" [channel_zone=1, tempsensorType = true, pollinterval = 1]
|
||||
Type temperature : temperature-pro "DS18B20 Temperature" [channel_zone=1, tempsensorType = false, pollinterval = 1, ds18b20_address = "XX:XX:XX:XX:XX:XX:XX"]
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -12,6 +12,9 @@
|
||||
*/
|
||||
package org.openhab.binding.konnected.internal;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.openhab.core.thing.ThingTypeUID;
|
||||
|
||||
@ -25,22 +28,26 @@ import org.openhab.core.thing.ThingTypeUID;
|
||||
public class KonnectedBindingConstants {
|
||||
|
||||
public static final String BINDING_ID = "konnected";
|
||||
public static final String PRO_MODULE = "pro-module";
|
||||
public static final String WIFI_MODULE = "wifi-module";
|
||||
|
||||
// List of all Thing Type UIDs
|
||||
public static final ThingTypeUID THING_TYPE_MODULE = new ThingTypeUID(BINDING_ID, "module");
|
||||
public static final ThingTypeUID THING_TYPE_WIFIMODULE = new ThingTypeUID(BINDING_ID, WIFI_MODULE);
|
||||
public static final ThingTypeUID THING_TYPE_PROMODULE = new ThingTypeUID(BINDING_ID, PRO_MODULE);
|
||||
|
||||
// Thing config properties
|
||||
public static final String HOST = "ipAddress";
|
||||
public static final String MAC_ADDR = "macAddress";
|
||||
public static final String CALLBACK_PATH = "callBackPath";
|
||||
public static final String REQUEST_TIMEOUT = "request_timeout";
|
||||
public static final String RETRY_COUNT = "retry_count";
|
||||
public static final String CALLBACK_URI = "callback_uri";
|
||||
|
||||
// PIN_TO_ZONE array, this array maps an index location as a zone to the corresponding
|
||||
// pin location
|
||||
public static final Integer[] PIN_TO_ZONE = { 0, 1, 2, 5, 6, 7, 9, 8 };
|
||||
|
||||
public static final String WEBHOOK_APP = "app_security";
|
||||
// ESP8266_ZONE_TO_PIN map, this maps a zone to a pin for ESP8266 based devices
|
||||
// Source: https://help.konnected.io/support/solutions/articles/32000026808-zone-to-gpio-pin-mapping
|
||||
public static final Map<String, Integer> ESP8266_ZONE_TO_PIN = Map.of("1", 1, "2", 2, "3", 5, "4", 6, "5", 7, "6",
|
||||
9, "alarm_out", 8);
|
||||
public static final Map<Integer, String> ESP8266_PIN_TO_ZONE = ESP8266_ZONE_TO_PIN.entrySet().stream()
|
||||
.collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey));
|
||||
|
||||
public static final String CHANNEL_ZONE = "zone";
|
||||
|
||||
|
@ -14,7 +14,6 @@ package org.openhab.binding.konnected.internal;
|
||||
|
||||
import static org.openhab.binding.konnected.internal.KonnectedBindingConstants.*;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Dictionary;
|
||||
import java.util.Set;
|
||||
|
||||
@ -48,7 +47,8 @@ import org.slf4j.LoggerFactory;
|
||||
@Component(configurationPid = "binding.konnected", service = ThingHandlerFactory.class)
|
||||
public class KonnectedHandlerFactory extends BaseThingHandlerFactory {
|
||||
private final Logger logger = LoggerFactory.getLogger(KonnectedHandlerFactory.class);
|
||||
private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.singleton(THING_TYPE_MODULE);
|
||||
private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Set.of(THING_TYPE_PROMODULE,
|
||||
THING_TYPE_WIFIMODULE);
|
||||
private static final String alias = "/" + BINDING_ID;
|
||||
|
||||
private HttpService httpService;
|
||||
|
@ -18,6 +18,8 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
@ -27,6 +29,7 @@ import org.jupnp.model.meta.RemoteDevice;
|
||||
import org.openhab.core.config.discovery.DiscoveryResult;
|
||||
import org.openhab.core.config.discovery.DiscoveryResultBuilder;
|
||||
import org.openhab.core.config.discovery.upnp.UpnpDiscoveryParticipant;
|
||||
import org.openhab.core.config.discovery.upnp.internal.UpnpDiscoveryService;
|
||||
import org.openhab.core.thing.ThingTypeUID;
|
||||
import org.openhab.core.thing.ThingUID;
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
@ -44,10 +47,12 @@ import org.slf4j.LoggerFactory;
|
||||
@Component(service = UpnpDiscoveryParticipant.class)
|
||||
public class KonnectedUPnPServer implements UpnpDiscoveryParticipant {
|
||||
private Logger logger = LoggerFactory.getLogger(KonnectedUPnPServer.class);
|
||||
private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections
|
||||
.unmodifiableSet(Stream.of(THING_TYPE_PROMODULE, THING_TYPE_WIFIMODULE).collect(Collectors.toSet()));
|
||||
|
||||
@Override
|
||||
public Set<ThingTypeUID> getSupportedThingTypeUIDs() {
|
||||
return Collections.singleton(THING_TYPE_MODULE);
|
||||
return SUPPORTED_THING_TYPES_UIDS;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -70,14 +75,16 @@ public class KonnectedUPnPServer implements UpnpDiscoveryParticipant {
|
||||
DeviceDetails details = device.getDetails();
|
||||
if (details != null) {
|
||||
ModelDetails modelDetails = details.getModelDetails();
|
||||
|
||||
if (modelDetails != null) {
|
||||
String modelName = modelDetails.getModelName();
|
||||
logger.debug("Model Details: {} Url: {} UDN: {} Model Number: {}", modelName, details.getBaseURL(),
|
||||
details.getSerialNumber(), modelDetails.getModelNumber());
|
||||
if (modelName != null) {
|
||||
if (modelName.startsWith("Konnected Pro")) {
|
||||
return new ThingUID(THING_TYPE_PROMODULE, details.getSerialNumber());
|
||||
}
|
||||
if (modelName.startsWith("Konnected")) {
|
||||
return new ThingUID(THING_TYPE_MODULE, details.getSerialNumber());
|
||||
return new ThingUID(THING_TYPE_WIFIMODULE, details.getSerialNumber());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,8 @@
|
||||
*/
|
||||
package org.openhab.binding.konnected.internal.gson;
|
||||
|
||||
import static org.openhab.binding.konnected.internal.KonnectedBindingConstants.*;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
@ -24,6 +26,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
public class KonnectedModuleGson {
|
||||
|
||||
private Integer pin;
|
||||
private String zone;
|
||||
private String temp;
|
||||
private String humi;
|
||||
private String state;
|
||||
@ -40,8 +43,16 @@ public class KonnectedModuleGson {
|
||||
return pin;
|
||||
}
|
||||
|
||||
public void setPin(Integer setPin) {
|
||||
this.pin = setPin;
|
||||
public void setPin(Integer pin) {
|
||||
this.pin = pin;
|
||||
}
|
||||
|
||||
public String getZone() {
|
||||
return zone;
|
||||
}
|
||||
|
||||
public void setZone(String zone) {
|
||||
this.zone = zone;
|
||||
}
|
||||
|
||||
public Integer getPollInterval() {
|
||||
@ -111,4 +122,20 @@ public class KonnectedModuleGson {
|
||||
public void setAddr(String setAddr) {
|
||||
this.addr = setAddr;
|
||||
}
|
||||
|
||||
public void setZone(String thingId, String zone) {
|
||||
if (isEsp8266(thingId)) {
|
||||
setPin(ESP8266_ZONE_TO_PIN.get(zone));
|
||||
} else {
|
||||
setZone(zone);
|
||||
}
|
||||
}
|
||||
|
||||
public String getZone(String thingId) {
|
||||
return isEsp8266(thingId) ? ESP8266_PIN_TO_ZONE.get(pin) : getZone();
|
||||
}
|
||||
|
||||
private boolean isEsp8266(String thingId) {
|
||||
return WIFI_MODULE.equals(thingId);
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ package org.openhab.binding.konnected.internal.handler;
|
||||
import static org.openhab.binding.konnected.internal.KonnectedBindingConstants.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@ -54,13 +53,14 @@ import com.google.gson.GsonBuilder;
|
||||
public class KonnectedHandler extends BaseThingHandler {
|
||||
private final Logger logger = LoggerFactory.getLogger(KonnectedHandler.class);
|
||||
private KonnectedConfiguration config;
|
||||
|
||||
private final String konnectedServletPath;
|
||||
private final KonnectedHTTPUtils http = new KonnectedHTTPUtils(30);
|
||||
private String callbackIpAddress = null;
|
||||
private String moduleIpAddress;
|
||||
private Gson gson = new GsonBuilder().create();
|
||||
private final Gson gson = new GsonBuilder().create();
|
||||
private int retryCount;
|
||||
private final String thingID;
|
||||
public String authToken;
|
||||
|
||||
/**
|
||||
* This is the constructor of the Konnected Handler.
|
||||
@ -73,11 +73,12 @@ public class KonnectedHandler extends BaseThingHandler {
|
||||
*/
|
||||
public KonnectedHandler(Thing thing, String path, String hostAddress, String port) {
|
||||
super(thing);
|
||||
|
||||
this.konnectedServletPath = path;
|
||||
callbackIpAddress = hostAddress + ":" + port;
|
||||
logger.debug("The callback ip address is: {}", callbackIpAddress);
|
||||
retryCount = 2;
|
||||
thingID = getThing().getThingTypeUID().getId();
|
||||
authToken = getThing().getUID().getAsString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -85,25 +86,22 @@ public class KonnectedHandler extends BaseThingHandler {
|
||||
// get the zone number in integer form
|
||||
Channel channel = this.getThing().getChannel(channelUID.getId());
|
||||
String channelType = channel.getChannelTypeUID().getAsString();
|
||||
String zoneNumber = (String) channel.getConfiguration().get(CHANNEL_ZONE);
|
||||
Integer zone = Integer.parseInt(zoneNumber);
|
||||
String zone = (String) channel.getConfiguration().get(CHANNEL_ZONE);
|
||||
logger.debug("The channelUID is: {} and the zone is : {}", channelUID.getAsString(), zone);
|
||||
// convert the zone to the pin based on value at index of zone
|
||||
Integer pin = Arrays.asList(PIN_TO_ZONE).get(zone);
|
||||
// if the command is OnOfftype
|
||||
if (command instanceof OnOffType) {
|
||||
if (channelType.equalsIgnoreCase(CHANNEL_SWITCH)) {
|
||||
if (channelType.contains(CHANNEL_SWITCH)) {
|
||||
logger.debug("A command was sent to a sensor type so we are ignoring the command");
|
||||
} else {
|
||||
int sendCommand = (OnOffType.OFF.compareTo((OnOffType) command));
|
||||
logger.debug("The command being sent to pin {} for channel:{} is {}", pin, channelUID.getAsString(),
|
||||
logger.debug("The command being sent to zone {} for channel:{} is {}", zone, channelUID.getAsString(),
|
||||
sendCommand);
|
||||
sendActuatorCommand(Integer.toString(sendCommand), pin, channelUID);
|
||||
sendActuatorCommand(Integer.toString(sendCommand), zone, channelUID);
|
||||
}
|
||||
} else if (command instanceof RefreshType) {
|
||||
// check to see if handler has been initialized before attempting to get state of pin, else wait one minute
|
||||
if (this.isInitialized()) {
|
||||
getSwitchState(pin, channelUID);
|
||||
getSwitchState(zone, channelUID);
|
||||
} else {
|
||||
scheduler.schedule(() -> {
|
||||
handleCommand(channelUID, command);
|
||||
@ -119,34 +117,35 @@ public class KonnectedHandler extends BaseThingHandler {
|
||||
* @param event the {@link KonnectedModuleGson} event that contains the state and pin information to be processed
|
||||
*/
|
||||
public void handleWebHookEvent(KonnectedModuleGson event) {
|
||||
// if we receive a command upteate the thing status to being online
|
||||
// if we receive a command update the thing status to being online
|
||||
updateStatus(ThingStatus.ONLINE);
|
||||
// get the zone number based off of the index location of the pin value
|
||||
String sentZone = Integer.toString(Arrays.asList(PIN_TO_ZONE).indexOf(event.getPin()));
|
||||
// String sentZone = Integer.toString(Arrays.asList(PIN_TO_ZONE).indexOf(event.getPin()));
|
||||
String zone = event.getZone(thingID);
|
||||
// check that the zone number is in one of the channelUID definitions
|
||||
logger.debug("Looping Through all channels on thing: {} to find a match for {}", thing.getUID().getAsString(),
|
||||
event.getAuthToken());
|
||||
zone);
|
||||
getThing().getChannels().forEach(channel -> {
|
||||
ChannelUID channelId = channel.getUID();
|
||||
String zoneNumber = (String) channel.getConfiguration().get(CHANNEL_ZONE);
|
||||
// if the string zone that was sent equals the last digit of the channelId found process it as the
|
||||
// channelId else do nothing
|
||||
if (sentZone.equalsIgnoreCase(zoneNumber)) {
|
||||
if (zone.equalsIgnoreCase(zoneNumber)) {
|
||||
logger.debug(
|
||||
"The configrued zone of channelID: {} was a match for the zone sent by the alarm panel: {} on thing: {}",
|
||||
channelId, sentZone, this.getThing().getUID().getId());
|
||||
channelId, zone, this.getThing().getUID().getId());
|
||||
String channelType = channel.getChannelTypeUID().getAsString();
|
||||
logger.debug("The channeltypeID is: {}", channelType);
|
||||
// check if the itemType has been defined for the zone received
|
||||
// check the itemType of the Zone, if Contact, send the State if Temp send Temp, etc.
|
||||
if (channelType.equalsIgnoreCase(CHANNEL_SWITCH) || channelType.equalsIgnoreCase(CHANNEL_ACTUATOR)) {
|
||||
if (channelType.contains(CHANNEL_SWITCH) || channelType.contains(CHANNEL_ACTUATOR)) {
|
||||
OnOffType onOffType = event.getState().equalsIgnoreCase(getOnState(channel)) ? OnOffType.ON
|
||||
: OnOffType.OFF;
|
||||
updateState(channelId, onOffType);
|
||||
} else if (channelType.equalsIgnoreCase(CHANNEL_HUMIDITY)) {
|
||||
} else if (channelType.contains(CHANNEL_HUMIDITY)) {
|
||||
// if the state is of type number then this means it is the humidity channel of the dht22
|
||||
updateState(channelId, new QuantityType<>(Double.parseDouble(event.getHumi()), Units.PERCENT));
|
||||
} else if (channelType.equalsIgnoreCase(CHANNEL_TEMPERATURE)) {
|
||||
} else if (channelType.contains(CHANNEL_TEMPERATURE)) {
|
||||
Configuration configuration = channel.getConfiguration();
|
||||
if (((Boolean) configuration.get(CHANNEL_TEMPERATURE_TYPE))) {
|
||||
updateState(channelId,
|
||||
@ -155,21 +154,20 @@ public class KonnectedHandler extends BaseThingHandler {
|
||||
// need to check to make sure right dsb1820 address
|
||||
logger.debug("The address of the DSB1820 sensor received from modeule {} is: {}",
|
||||
this.thing.getUID(), event.getAddr());
|
||||
if (event.getAddr().toString()
|
||||
if (event.getAddr()
|
||||
.equalsIgnoreCase((String) (configuration.get(CHANNEL_TEMPERATURE_DS18B20_ADDRESS)))) {
|
||||
updateState(channelId,
|
||||
new QuantityType<>(Double.parseDouble(event.getTemp()), SIUnits.CELSIUS));
|
||||
} else {
|
||||
logger.debug("The address of {} does not match {} not updating this channel",
|
||||
event.getAddr().toString(),
|
||||
(configuration.get(CHANNEL_TEMPERATURE_DS18B20_ADDRESS)));
|
||||
event.getAddr(), (configuration.get(CHANNEL_TEMPERATURE_DS18B20_ADDRESS)));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.trace(
|
||||
"The zone number sent by the alarm panel: {} was not a match the configured zone for channelId: {} for thing {}",
|
||||
sentZone, channelId, getThing().getThingTypeUID().toString());
|
||||
zone, channelId, getThing().getThingTypeUID().toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -322,11 +320,13 @@ public class KonnectedHandler extends BaseThingHandler {
|
||||
* @return a json settings payload which can be sent to the Konnected Module based on the Thing
|
||||
*/
|
||||
private String constructSettingsPayload() {
|
||||
String hostPath = "";
|
||||
hostPath = callbackIpAddress + this.konnectedServletPath;
|
||||
String authToken = getThing().getUID().getAsString();
|
||||
String apiUrl = (String) getThing().getConfiguration().get(CALLBACK_URI);
|
||||
if (apiUrl == null) {
|
||||
apiUrl = "http://" + callbackIpAddress + this.konnectedServletPath;
|
||||
}
|
||||
|
||||
logger.debug("The Auth_Token is: {}", authToken);
|
||||
KonnectedModulePayload payload = new KonnectedModulePayload(authToken, "http://" + hostPath);
|
||||
KonnectedModulePayload payload = new KonnectedModulePayload(authToken, apiUrl);
|
||||
payload.setBlink(config.blink);
|
||||
payload.setDiscovery(config.discovery);
|
||||
this.getThing().getChannels().forEach(channel -> {
|
||||
@ -335,10 +335,7 @@ public class KonnectedHandler extends BaseThingHandler {
|
||||
// adds linked channels to list based on last value of Channel ID
|
||||
// which is set to a number
|
||||
// get the zone number in integer form
|
||||
String zoneNumber = (String) channel.getConfiguration().get(CHANNEL_ZONE);
|
||||
Integer zone = Integer.parseInt(zoneNumber);
|
||||
// convert the zone to the pin based on value at index of zone
|
||||
Integer pin = Arrays.asList(PIN_TO_ZONE).get(zone);
|
||||
String zone = (String) channel.getConfiguration().get(CHANNEL_ZONE);
|
||||
// if the pin is an actuator add to actuator string
|
||||
// else add to sensor string
|
||||
// This is determined based off of the accepted item type, contact types are sensors
|
||||
@ -346,20 +343,20 @@ public class KonnectedHandler extends BaseThingHandler {
|
||||
String channelType = channel.getChannelTypeUID().getAsString();
|
||||
logger.debug("The channeltypeID is: {}", channelType);
|
||||
KonnectedModuleGson module = new KonnectedModuleGson();
|
||||
module.setPin(pin);
|
||||
if (channelType.equalsIgnoreCase(CHANNEL_SWITCH)) {
|
||||
module.setZone(thingID, zone);
|
||||
if (channelType.contains(CHANNEL_SWITCH)) {
|
||||
payload.addSensor(module);
|
||||
logger.trace("Channel {} will be configured on the konnected alarm panel as a switch",
|
||||
channel.toString());
|
||||
} else if (channelType.equalsIgnoreCase(CHANNEL_ACTUATOR)) {
|
||||
} else if (channelType.contains(CHANNEL_ACTUATOR)) {
|
||||
payload.addActuators(module);
|
||||
logger.trace("Channel {} will be configured on the konnected alarm panel as an actuator",
|
||||
channel.toString());
|
||||
} else if (channelType.equalsIgnoreCase(CHANNEL_HUMIDITY)) {
|
||||
} else if (channelType.contains(CHANNEL_HUMIDITY)) {
|
||||
// the humidity channels do not need to be added because the supported sensor (dht22) is added under
|
||||
// the temp sensor
|
||||
logger.trace("Channel {} is a humidity channel.", channel.toString());
|
||||
} else if (channelType.equalsIgnoreCase(CHANNEL_TEMPERATURE)) {
|
||||
} else if (channelType.contains(CHANNEL_TEMPERATURE)) {
|
||||
logger.trace("Channel {} will be configured on the konnected alarm panel as a temperature sensor",
|
||||
channel.toString());
|
||||
Configuration configuration = channel.getConfiguration();
|
||||
@ -416,9 +413,9 @@ public class KonnectedHandler extends BaseThingHandler {
|
||||
* Sends a command to the module via {@link KonnectedHTTPUtils}
|
||||
*
|
||||
* @param scommand the string command, either 0 or 1 to send to the actutor pin on the Konnected module
|
||||
* @param pin the pin to send the command to on the Konnected Module
|
||||
* @param zone the zone to send the command to on the Konnected Module
|
||||
*/
|
||||
private void sendActuatorCommand(String scommand, Integer pin, ChannelUID channelId) {
|
||||
private void sendActuatorCommand(String scommand, String zone, ChannelUID channelId) {
|
||||
try {
|
||||
Channel channel = getThing().getChannel(channelId.getId());
|
||||
if (!(channel == null)) {
|
||||
@ -427,7 +424,9 @@ public class KonnectedHandler extends BaseThingHandler {
|
||||
Configuration configuration = channel.getConfiguration();
|
||||
KonnectedModuleGson payload = new KonnectedModuleGson();
|
||||
payload.setState(scommand);
|
||||
payload.setPin(pin);
|
||||
|
||||
payload.setZone(thingID, zone);
|
||||
|
||||
// check to see if this is an On Command type, if so add the momentary, pause, times to the payload if
|
||||
// they exist on the configuration.
|
||||
if (scommand.equals(getOnState(channel))) {
|
||||
@ -461,7 +460,16 @@ public class KonnectedHandler extends BaseThingHandler {
|
||||
}
|
||||
String payloadString = gson.toJson(payload);
|
||||
logger.debug("The command payload is: {}", payloadString);
|
||||
http.doPut(moduleIpAddress + "/device", payloadString, retryCount);
|
||||
String path = "";
|
||||
switch (this.thingID) {
|
||||
case PRO_MODULE:
|
||||
path = "/zone";
|
||||
break;
|
||||
case WIFI_MODULE:
|
||||
path = "/device";
|
||||
break;
|
||||
}
|
||||
http.doPut(moduleIpAddress + path, payloadString, retryCount);
|
||||
} else {
|
||||
logger.debug("The channel {} returned null for channelId.getID(): {}", channelId.toString(),
|
||||
channelId.getId());
|
||||
@ -474,23 +482,23 @@ public class KonnectedHandler extends BaseThingHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private void getSwitchState(Integer pin, ChannelUID channelId) {
|
||||
private void getSwitchState(String zone, ChannelUID channelId) {
|
||||
Channel channel = getThing().getChannel(channelId.getId());
|
||||
if (!(channel == null)) {
|
||||
logger.debug("getasstring: {} getID: {} getGroupId: {} toString:{}", channelId.getAsString(),
|
||||
channelId.getId(), channelId.getGroupId(), channelId.toString());
|
||||
KonnectedModuleGson payload = new KonnectedModuleGson();
|
||||
payload.setPin(pin);
|
||||
payload.setZone(thingID, zone);
|
||||
String payloadString = gson.toJson(payload);
|
||||
logger.debug("The command payload is: {}", payloadString);
|
||||
try {
|
||||
sendSetSwitchState(payloadString);
|
||||
sendSetSwitchState(thingID, payloadString);
|
||||
} catch (KonnectedHttpRetryExceeded e) {
|
||||
// try to get the state of the device one more time 30 seconds later. This way it can be confirmed if
|
||||
// the device was simply in a reboot loop when device state was attempted the first time
|
||||
scheduler.schedule(() -> {
|
||||
try {
|
||||
sendSetSwitchState(payloadString);
|
||||
sendSetSwitchState(thingID, payloadString);
|
||||
} catch (KonnectedHttpRetryExceeded ex) {
|
||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
|
||||
"Unable to communicate with Konnected Alarm Panel confirm settings, and that module is online.");
|
||||
@ -505,10 +513,13 @@ public class KonnectedHandler extends BaseThingHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private void sendSetSwitchState(String payloadString) throws KonnectedHttpRetryExceeded {
|
||||
String response = http.doGet(moduleIpAddress + "/device", payloadString, retryCount);
|
||||
KonnectedModuleGson event = gson.fromJson(response, KonnectedModuleGson.class);
|
||||
this.handleWebHookEvent(event);
|
||||
private void sendSetSwitchState(String thingId, String payloadString) throws KonnectedHttpRetryExceeded {
|
||||
String path = thingId.equals(WIFI_MODULE) ? "/device" : "/zone";
|
||||
String response = http.doGet(moduleIpAddress + path, payloadString, retryCount);
|
||||
KonnectedModuleGson[] events = gson.fromJson(response, KonnectedModuleGson[].class);
|
||||
for (KonnectedModuleGson event : events) {
|
||||
this.handleWebHookEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
private String getOnState(Channel channel) {
|
||||
|
@ -58,7 +58,23 @@ public class KonnectedHTTPServlet extends HttpServlet {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void service(HttpServletRequest req, HttpServletResponse resp) {
|
||||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
|
||||
logger.debug("Unhandled get request: {}?{}", req.getRequestURI(), req.getQueryString());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) {
|
||||
logger.debug("Got POST: {}", req.getRequestURI());
|
||||
handleDeviceCallback(req, resp);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doPut(HttpServletRequest req, HttpServletResponse resp) {
|
||||
logger.debug("Got PUT: {}", req.getRequestURI());
|
||||
handleDeviceCallback(req, resp);
|
||||
}
|
||||
|
||||
private void handleDeviceCallback(HttpServletRequest req, HttpServletResponse resp) {
|
||||
try {
|
||||
String data = inputStreamToString(req);
|
||||
|
||||
@ -67,8 +83,6 @@ public class KonnectedHTTPServlet extends HttpServlet {
|
||||
KonnectedModuleGson event = gson.fromJson(data, KonnectedModuleGson.class);
|
||||
String authorizationHeader = req.getHeader("Authorization");
|
||||
String thingHandlerKey = authorizationHeader.substring("Bearer".length()).trim();
|
||||
logger.debug("The path of the response was: {}", req.getContextPath());
|
||||
logger.debug("The json received was: {}", event.toString());
|
||||
logger.debug("The thing handler to send the command to is the handler for thing: {}", thingHandlerKey);
|
||||
try {
|
||||
KonnectedHandler thingHandler = konnectedThingHandlers.get(thingHandlerKey);
|
||||
@ -88,7 +102,7 @@ public class KonnectedHTTPServlet extends HttpServlet {
|
||||
|
||||
private String inputStreamToString(HttpServletRequest req) throws IOException {
|
||||
Scanner scanner = new Scanner(req.getInputStream()).useDelimiter("\\A");
|
||||
return scanner.hasNext() ? scanner.next() : "";
|
||||
return scanner.hasNext() ? scanner.next() : null;
|
||||
}
|
||||
|
||||
private void setHeaders(HttpServletResponse response) {
|
||||
|
@ -40,6 +40,17 @@
|
||||
<default>30</default>
|
||||
<advanced>true</advanced>
|
||||
</parameter>
|
||||
|
||||
<parameter name="callback_uri" type="text">
|
||||
<label>Callback URI</label>
|
||||
<description>The URI where the Konnected panel will make callbacks. The default is to auto detect the port and IP
|
||||
address of openHAB. This may not work in case you use a reverse proxy or openHAB
|
||||
is running in Docker. Then the
|
||||
plugin
|
||||
is bound to the /konnected http context.</description>
|
||||
<advanced>true</advanced>
|
||||
</parameter>
|
||||
|
||||
<parameter name="controller_softreset" type="boolean" groupName="actions">
|
||||
<label>Soft Reset Module</label>
|
||||
<description>Send A Restart Command to the Module.</description>
|
||||
|
@ -5,16 +5,17 @@ binding.konnected.description = This is the binding for Konnected.
|
||||
|
||||
# thing types
|
||||
|
||||
thing-type.konnected.module.label = The Konnected Alarm Panel
|
||||
thing-type.konnected.module.description = The Konnected Module
|
||||
thing-type.konnected.module.channel.Out.label = The out Pin
|
||||
thing-type.konnected.module.channel.Zone_6.label = Zone 6
|
||||
thing-type.konnected.module.channel.Zone_6.description = Zone 6 Sensor
|
||||
thing-type.konnected.pro-module.label = The Konnected Alarm Panel Pro
|
||||
thing-type.konnected.pro-module.description = The Konnected Alarm Panel Pro
|
||||
thing-type.konnected.wifi-module.label = The Konnected Alarm Panel
|
||||
thing-type.konnected.wifi-module.description = The Konnected Wi-Fi Alarm Panel
|
||||
|
||||
# thing types config
|
||||
|
||||
thing-type.config.konnected.module.blink.label = Blink
|
||||
thing-type.config.konnected.module.blink.description = When set to false the Led on the device won't blink during transmission.
|
||||
thing-type.config.konnected.module.callback_uri.label = Callback URI
|
||||
thing-type.config.konnected.module.callback_uri.description = The URI where the Konnected panel will make callbacks. The default is to auto detect the port and IP address of openHAB. This may not work in case you use a reverse proxy or openHAB is running in Docker. Then the plugin is bound to the /konnected http context.
|
||||
thing-type.config.konnected.module.controller_removewifi.label = Factory Reset
|
||||
thing-type.config.konnected.module.controller_removewifi.description = Resets the module to Factory Conditions.
|
||||
thing-type.config.konnected.module.controller_sendConfig.label = Update Settings
|
||||
@ -31,6 +32,159 @@ thing-type.config.konnected.module.retry_count.description = The number of times
|
||||
|
||||
# channel types
|
||||
|
||||
channel-type.konnected.actuator-pro.label = Actuator
|
||||
channel-type.konnected.actuator-pro.description = This zone is an actuator
|
||||
channel-type.konnected.actuator-wifi.label = Actuator
|
||||
channel-type.konnected.actuator-wifi.description = This zone is an actuator
|
||||
channel-type.konnected.humidity-pro.label = Humidity
|
||||
channel-type.konnected.humidity-pro.description = This zone measures humidity
|
||||
channel-type.konnected.humidity-wifi.label = Humidity
|
||||
channel-type.konnected.humidity-wifi.description = This zone measures humidity
|
||||
channel-type.konnected.switch-pro.label = Switch
|
||||
channel-type.konnected.switch-pro.description = This zone is a read only switch type zone
|
||||
channel-type.konnected.switch-wifi.label = Switch
|
||||
channel-type.konnected.switch-wifi.description = This zone is a read only switch type zone
|
||||
channel-type.konnected.temperature-pro.label = Temperature
|
||||
channel-type.konnected.temperature-pro.description = This zone measures temperature
|
||||
channel-type.konnected.temperature-wifi.label = Temperature
|
||||
channel-type.konnected.temperature-wifi.description = This zone measures temperature
|
||||
|
||||
# channel types config
|
||||
|
||||
channel-type.config.konnected.actuator-pro.momentary.label = Momentary
|
||||
channel-type.config.konnected.actuator-pro.momentary.description = The duration of the pulse in milliseconds
|
||||
channel-type.config.konnected.actuator-pro.onvalue.label = On Value
|
||||
channel-type.config.konnected.actuator-pro.onvalue.description = The value that will be treated by the binding as an on command. For actuators that activate with a high command set to 1 and actuators that activate with a low value set to 0.
|
||||
channel-type.config.konnected.actuator-pro.onvalue.option.0 = 0
|
||||
channel-type.config.konnected.actuator-pro.onvalue.option.1 = 1
|
||||
channel-type.config.konnected.actuator-pro.pause.label = Pause
|
||||
channel-type.config.konnected.actuator-pro.pause.description = The time between pulses in milliseconds
|
||||
channel-type.config.konnected.actuator-pro.times.label = Times
|
||||
channel-type.config.konnected.actuator-pro.times.description = The number of times to repeat or `-1` for an infinitely repeating pulse
|
||||
channel-type.config.konnected.actuator-pro.zone.label = Zone Number
|
||||
channel-type.config.konnected.actuator-pro.zone.description = The zone number of the channel.
|
||||
channel-type.config.konnected.actuator-pro.zone.option.1 = 1
|
||||
channel-type.config.konnected.actuator-pro.zone.option.2 = 2
|
||||
channel-type.config.konnected.actuator-pro.zone.option.3 = 3
|
||||
channel-type.config.konnected.actuator-pro.zone.option.4 = 4
|
||||
channel-type.config.konnected.actuator-pro.zone.option.5 = 5
|
||||
channel-type.config.konnected.actuator-pro.zone.option.6 = 6
|
||||
channel-type.config.konnected.actuator-pro.zone.option.7 = 7
|
||||
channel-type.config.konnected.actuator-pro.zone.option.8 = 8
|
||||
channel-type.config.konnected.actuator-pro.zone.option.alarm1 = Alarm1
|
||||
channel-type.config.konnected.actuator-pro.zone.option.out1 = Output1
|
||||
channel-type.config.konnected.actuator-pro.zone.option.alarm2_out2 = Alarm2/Out2
|
||||
channel-type.config.konnected.actuator-wifi.momentary.label = Momentary
|
||||
channel-type.config.konnected.actuator-wifi.momentary.description = The duration of the pulse in millisecods
|
||||
channel-type.config.konnected.actuator-wifi.onvalue.label = On Value
|
||||
channel-type.config.konnected.actuator-wifi.onvalue.description = The value that will be treated by the binding as an on command. For actuators that activate with a high command set to 1 and actuators that activate with a low value set to 0.
|
||||
channel-type.config.konnected.actuator-wifi.onvalue.option.0 = 0
|
||||
channel-type.config.konnected.actuator-wifi.onvalue.option.1 = 1
|
||||
channel-type.config.konnected.actuator-wifi.pause.label = Pause
|
||||
channel-type.config.konnected.actuator-wifi.pause.description = The time between pulses in millisecods
|
||||
channel-type.config.konnected.actuator-wifi.times.label = Times
|
||||
channel-type.config.konnected.actuator-wifi.times.description = is the number of times to repeat or `-1` for an infinitely repeating pulse
|
||||
channel-type.config.konnected.actuator-wifi.zone.label = Zone Number
|
||||
channel-type.config.konnected.actuator-wifi.zone.description = The Zone Number of the channel.
|
||||
channel-type.config.konnected.actuator-wifi.zone.option.1 = 1
|
||||
channel-type.config.konnected.actuator-wifi.zone.option.2 = 2
|
||||
channel-type.config.konnected.actuator-wifi.zone.option.3 = 3
|
||||
channel-type.config.konnected.actuator-wifi.zone.option.4 = 4
|
||||
channel-type.config.konnected.actuator-wifi.zone.option.5 = 5
|
||||
channel-type.config.konnected.actuator-wifi.zone.option.6 = 6
|
||||
channel-type.config.konnected.actuator-wifi.zone.option.alarm_out = Alarm/Out
|
||||
channel-type.config.konnected.humidity-pro.zone.label = Zone Number
|
||||
channel-type.config.konnected.humidity-pro.zone.description = The zone number of the channel.
|
||||
channel-type.config.konnected.humidity-pro.zone.option.1 = 1
|
||||
channel-type.config.konnected.humidity-pro.zone.option.2 = 2
|
||||
channel-type.config.konnected.humidity-pro.zone.option.3 = 3
|
||||
channel-type.config.konnected.humidity-pro.zone.option.4 = 4
|
||||
channel-type.config.konnected.humidity-pro.zone.option.5 = 5
|
||||
channel-type.config.konnected.humidity-pro.zone.option.6 = 6
|
||||
channel-type.config.konnected.humidity-pro.zone.option.7 = 7
|
||||
channel-type.config.konnected.humidity-pro.zone.option.8 = 8
|
||||
channel-type.config.konnected.humidity-wifi.zone.label = Zone Number
|
||||
channel-type.config.konnected.humidity-wifi.zone.description = The Zone Number of the channel.
|
||||
channel-type.config.konnected.humidity-wifi.zone.option.1 = 1
|
||||
channel-type.config.konnected.humidity-wifi.zone.option.2 = 2
|
||||
channel-type.config.konnected.humidity-wifi.zone.option.3 = 3
|
||||
channel-type.config.konnected.humidity-wifi.zone.option.4 = 4
|
||||
channel-type.config.konnected.humidity-wifi.zone.option.5 = 5
|
||||
channel-type.config.konnected.humidity-wifi.zone.option.6 = 6
|
||||
channel-type.config.konnected.humidity-wifi.zone.option.alarm_out = Alarm/Out
|
||||
channel-type.config.konnected.switch-pro.onvalue.label = On Value
|
||||
channel-type.config.konnected.switch-pro.onvalue.description = The value that will be treated by the binding as the on value. For sensors that activate with a high value, leave at the default of 1 and sensors that activate with a low value set to 0.
|
||||
channel-type.config.konnected.switch-pro.onvalue.option.0 = 0
|
||||
channel-type.config.konnected.switch-pro.onvalue.option.1 = 1
|
||||
channel-type.config.konnected.switch-pro.zone.label = Zone Number
|
||||
channel-type.config.konnected.switch-pro.zone.description = The zone number of the channel.
|
||||
channel-type.config.konnected.switch-pro.zone.option.1 = 1
|
||||
channel-type.config.konnected.switch-pro.zone.option.2 = 2
|
||||
channel-type.config.konnected.switch-pro.zone.option.3 = 3
|
||||
channel-type.config.konnected.switch-pro.zone.option.4 = 4
|
||||
channel-type.config.konnected.switch-pro.zone.option.5 = 5
|
||||
channel-type.config.konnected.switch-pro.zone.option.6 = 6
|
||||
channel-type.config.konnected.switch-pro.zone.option.7 = 7
|
||||
channel-type.config.konnected.switch-pro.zone.option.8 = 8
|
||||
channel-type.config.konnected.switch-pro.zone.option.9 = 9
|
||||
channel-type.config.konnected.switch-pro.zone.option.10 = 10
|
||||
channel-type.config.konnected.switch-pro.zone.option.11 = 11
|
||||
channel-type.config.konnected.switch-pro.zone.option.12 = 12
|
||||
channel-type.config.konnected.switch-wifi.onvalue.label = On Value
|
||||
channel-type.config.konnected.switch-wifi.onvalue.description = The value that will be treated by the binding as the on value. For sensors that activate with a high value leave at the default of 1 and sensors that activate with a low value set to 0.
|
||||
channel-type.config.konnected.switch-wifi.onvalue.option.0 = 0
|
||||
channel-type.config.konnected.switch-wifi.onvalue.option.1 = 1
|
||||
channel-type.config.konnected.switch-wifi.zone.label = Zone Number
|
||||
channel-type.config.konnected.switch-wifi.zone.description = The Zone Number of the channel.
|
||||
channel-type.config.konnected.switch-wifi.zone.option.1 = 1
|
||||
channel-type.config.konnected.switch-wifi.zone.option.2 = 2
|
||||
channel-type.config.konnected.switch-wifi.zone.option.3 = 3
|
||||
channel-type.config.konnected.switch-wifi.zone.option.4 = 4
|
||||
channel-type.config.konnected.switch-wifi.zone.option.5 = 5
|
||||
channel-type.config.konnected.switch-wifi.zone.option.6 = 6
|
||||
channel-type.config.konnected.switch-wifi.zone.option.alarm_out = Alarm/Out
|
||||
channel-type.config.konnected.temperature-pro.ds18b20_address.label = DS18b20 Address
|
||||
channel-type.config.konnected.temperature-pro.ds18b20_address.description = This is the unique address of the sensor on the one wire bus.
|
||||
channel-type.config.konnected.temperature-pro.pollinterval.label = Poll Interval
|
||||
channel-type.config.konnected.temperature-pro.pollinterval.description = The interval in minutes to poll the sensor.
|
||||
channel-type.config.konnected.temperature-pro.tempsensorType.label = DHT22
|
||||
channel-type.config.konnected.temperature-pro.tempsensorType.description = Is the sensor a dht22 or a ds18b20? Set to true for dht22 sensor
|
||||
channel-type.config.konnected.temperature-pro.zone.label = Zone Number
|
||||
channel-type.config.konnected.temperature-pro.zone.description = The Zone Number of the channel.
|
||||
channel-type.config.konnected.temperature-pro.zone.option.1 = 1
|
||||
channel-type.config.konnected.temperature-pro.zone.option.2 = 2
|
||||
channel-type.config.konnected.temperature-pro.zone.option.3 = 3
|
||||
channel-type.config.konnected.temperature-pro.zone.option.4 = 4
|
||||
channel-type.config.konnected.temperature-pro.zone.option.5 = 5
|
||||
channel-type.config.konnected.temperature-pro.zone.option.6 = 6
|
||||
channel-type.config.konnected.temperature-pro.zone.option.7 = 7
|
||||
channel-type.config.konnected.temperature-pro.zone.option.8 = 8
|
||||
channel-type.config.konnected.temperature-wifi.ds18b20_address.label = DS18b20 Address
|
||||
channel-type.config.konnected.temperature-wifi.ds18b20_address.description = This is the unique address of the sensor on the one wire bus.
|
||||
channel-type.config.konnected.temperature-wifi.pollinterval.label = Poll Interval
|
||||
channel-type.config.konnected.temperature-wifi.pollinterval.description = The interval in minutes to poll the sensor.
|
||||
channel-type.config.konnected.temperature-wifi.tempsensorType.label = DHT22
|
||||
channel-type.config.konnected.temperature-wifi.tempsensorType.description = Is the sensor a dht22 or a ds18b20? Set to true for dht22 sensor
|
||||
channel-type.config.konnected.temperature-wifi.zone.label = Zone Number
|
||||
channel-type.config.konnected.temperature-wifi.zone.description = The Zone Number of the channel.
|
||||
channel-type.config.konnected.temperature-wifi.zone.option.1 = 1
|
||||
channel-type.config.konnected.temperature-wifi.zone.option.2 = 2
|
||||
channel-type.config.konnected.temperature-wifi.zone.option.3 = 3
|
||||
channel-type.config.konnected.temperature-wifi.zone.option.4 = 4
|
||||
channel-type.config.konnected.temperature-wifi.zone.option.5 = 5
|
||||
channel-type.config.konnected.temperature-wifi.zone.option.6 = 6
|
||||
channel-type.config.konnected.temperature-wifi.zone.option.alarm_out = Alarm/Out
|
||||
|
||||
# thing types
|
||||
|
||||
thing-type.konnected.module.label = The Konnected Alarm Panel
|
||||
thing-type.konnected.module.description = The Konnected Module
|
||||
thing-type.konnected.module.channel.Out.label = The out Pin
|
||||
thing-type.konnected.module.channel.Zone_6.label = Zone 6
|
||||
thing-type.konnected.module.channel.Zone_6.description = Zone 6 Sensor
|
||||
|
||||
# channel types
|
||||
|
||||
channel-type.konnected.actuator.label = Actuator
|
||||
channel-type.konnected.actuator.description = This zone is an actuator
|
||||
channel-type.konnected.humidity.label = Humidity
|
||||
|
@ -3,23 +3,21 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
|
||||
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
|
||||
<!-- This is the Konnected Thing-Type -->
|
||||
<thing-type id="module" extensible="switch,actuator,temperature,humidity">
|
||||
<!-- This is the Konnected Wifi Thing-Type -->
|
||||
<thing-type id="wifi-module" extensible="switch-wifi,actuator-wifi,temperature-wifi,humidity-wifi">
|
||||
<label>The Konnected Alarm Panel</label>
|
||||
<description>The Konnected Module</description>
|
||||
<channels>
|
||||
<channel id="Zone_6" typeId="switch">
|
||||
<label>Zone 6</label>
|
||||
<description>Zone 6 Sensor</description>
|
||||
</channel>
|
||||
<channel id="Out" typeId="actuator">
|
||||
<label>The out Pin</label>
|
||||
</channel>
|
||||
</channels>
|
||||
<description>The Konnected Wi-Fi Alarm Panel</description>
|
||||
<config-description-ref uri="thing-type:konnected:module"/>
|
||||
</thing-type>
|
||||
<!-- This is the Konnected Alarm Panel Pro Thing-Type -->
|
||||
<thing-type id="pro-module" extensible="switch-pro,actuator-pro,temperature-pro,humidity-pro">
|
||||
<label>The Konnected Alarm Panel Pro</label>
|
||||
<description>The Konnected Alarm Panel Pro</description>
|
||||
<config-description-ref uri="thing-type:konnected:module"/>
|
||||
</thing-type>
|
||||
|
||||
<!-- Zone Channel Type -->
|
||||
<channel-type id="switch">
|
||||
<channel-type id="switch-wifi">
|
||||
<item-type>Switch</item-type>
|
||||
<label>Switch</label>
|
||||
<description>This zone is a read only switch type zone</description>
|
||||
@ -36,7 +34,7 @@
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">Out</option>
|
||||
<option value="alarm_out">Alarm/Out</option>
|
||||
</options>
|
||||
</parameter>
|
||||
<parameter name="onvalue" type="text">
|
||||
@ -51,7 +49,7 @@
|
||||
</parameter>
|
||||
</config-description>
|
||||
</channel-type>
|
||||
<channel-type id="temperature">
|
||||
<channel-type id="temperature-wifi">
|
||||
<item-type>Number:Temperature</item-type>
|
||||
<label>Temperature</label>
|
||||
<description>This zone measures temperature</description>
|
||||
@ -67,7 +65,7 @@
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">Out</option>
|
||||
<option value="alarm_out">Alarm/Out</option>
|
||||
</options>
|
||||
</parameter>
|
||||
<parameter name="tempsensorType" type="boolean">
|
||||
@ -84,7 +82,7 @@
|
||||
</parameter>
|
||||
</config-description>
|
||||
</channel-type>
|
||||
<channel-type id="humidity">
|
||||
<channel-type id="humidity-wifi">
|
||||
<item-type>Number:Dimensionless</item-type>
|
||||
<label>Humidity</label>
|
||||
<description>This zone measures humidity</description>
|
||||
@ -100,12 +98,12 @@
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">Out</option>
|
||||
<option value="alarm_out">Alarm/Out</option>
|
||||
</options>
|
||||
</parameter>
|
||||
</config-description>
|
||||
</channel-type>
|
||||
<channel-type id="actuator">
|
||||
<channel-type id="actuator-wifi">
|
||||
<item-type>Switch</item-type>
|
||||
<label>Actuator</label>
|
||||
<description>This zone is an actuator</description>
|
||||
@ -121,7 +119,7 @@
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">Out</option>
|
||||
<option value="alarm_out">Alarm/Out</option>
|
||||
</options>
|
||||
</parameter>
|
||||
<parameter name="onvalue" type="text">
|
||||
@ -148,4 +146,144 @@
|
||||
</parameter>
|
||||
</config-description>
|
||||
</channel-type>
|
||||
<channel-type id="switch-pro">
|
||||
<item-type>Switch</item-type>
|
||||
<label>Switch</label>
|
||||
<description>This zone is a read only switch type zone</description>
|
||||
<state readOnly="true"/>
|
||||
<config-description>
|
||||
<parameter name="zone" type="text" required="true">
|
||||
<label>Zone Number</label>
|
||||
<description>The zone number of the channel.</description>
|
||||
<default>4</default>
|
||||
<options>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">7</option>
|
||||
<option value="8">8</option>
|
||||
<option value="9">9</option>
|
||||
<option value="10">10</option>
|
||||
<option value="11">11</option>
|
||||
<option value="12">12</option>
|
||||
</options>
|
||||
</parameter>
|
||||
<parameter name="onvalue" type="text">
|
||||
<label>On Value</label>
|
||||
<description>The value that will be treated by the binding as the on value. For sensors that activate with a high
|
||||
value, leave at the default of 1 and sensors that activate with a low value set to 0.</description>
|
||||
<default>1</default>
|
||||
<options>
|
||||
<option value="0">0</option>
|
||||
<option value="1">1</option>
|
||||
</options>
|
||||
</parameter>
|
||||
</config-description>
|
||||
</channel-type>
|
||||
<channel-type id="actuator-pro">
|
||||
<item-type>Switch</item-type>
|
||||
<label>Actuator</label>
|
||||
<description>This zone is an actuator</description>
|
||||
<config-description>
|
||||
<parameter name="zone" type="text" required="true">
|
||||
<label>Zone Number</label>
|
||||
<description>The zone number of the channel.</description>
|
||||
<default>2</default>
|
||||
<options>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">7</option>
|
||||
<option value="8">8</option>
|
||||
<option value="alarm1">Alarm1</option>
|
||||
<option value="out1">Output1</option>
|
||||
<option value="alarm2_out2">Alarm2/Out2</option>
|
||||
</options>
|
||||
</parameter>
|
||||
<parameter name="onvalue" type="text">
|
||||
<label>On Value</label>
|
||||
<description>The value that will be treated by the binding as an on command. For actuators that activate with a high
|
||||
command set to 1 and actuators that activate with a low value set to 0.</description>
|
||||
<default>1</default>
|
||||
<options>
|
||||
<option value="0">0</option>
|
||||
<option value="1">1</option>
|
||||
</options>
|
||||
</parameter>
|
||||
<parameter name="momentary" type="integer">
|
||||
<label>Momentary</label>
|
||||
<description>The duration of the pulse in milliseconds</description>
|
||||
</parameter>
|
||||
<parameter name="pause" type="integer">
|
||||
<label>Pause</label>
|
||||
<description>The time between pulses in milliseconds</description>
|
||||
</parameter>
|
||||
<parameter name="times" type="integer">
|
||||
<label>Times</label>
|
||||
<description>The number of times to repeat or `-1` for an infinitely repeating pulse</description>
|
||||
</parameter>
|
||||
</config-description>
|
||||
</channel-type>
|
||||
<channel-type id="temperature-pro">
|
||||
<item-type>Number:Temperature</item-type>
|
||||
<label>Temperature</label>
|
||||
<description>This zone measures temperature</description>
|
||||
<state readOnly="true"/>
|
||||
<config-description>
|
||||
<parameter name="zone" type="text">
|
||||
<label>Zone Number</label>
|
||||
<description>The Zone Number of the channel.</description>
|
||||
<options>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">7</option>
|
||||
<option value="8">8</option>
|
||||
</options>
|
||||
</parameter>
|
||||
<parameter name="tempsensorType" type="boolean">
|
||||
<label>DHT22</label>
|
||||
<description>Is the sensor a dht22 or a ds18b20? Set to true for dht22 sensor</description>
|
||||
</parameter>
|
||||
<parameter name="pollinterval" type="integer">
|
||||
<label>Poll Interval</label>
|
||||
<description>The interval in minutes to poll the sensor.</description>
|
||||
</parameter>
|
||||
<parameter name="ds18b20_address" type="text">
|
||||
<label>DS18b20 Address</label>
|
||||
<description>This is the unique address of the sensor on the one wire bus.</description>
|
||||
</parameter>
|
||||
</config-description>
|
||||
</channel-type>
|
||||
<channel-type id="humidity-pro">
|
||||
<item-type>Number:Dimensionless</item-type>
|
||||
<label>Humidity</label>
|
||||
<description>This zone measures humidity</description>
|
||||
<state readOnly="true"/>
|
||||
<config-description>
|
||||
<parameter name="zone" type="text" required="true">
|
||||
<label>Zone Number</label>
|
||||
<description>The zone number of the channel.</description>
|
||||
<options>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">7</option>
|
||||
<option value="8">8</option>
|
||||
</options>
|
||||
</parameter>
|
||||
</config-description>
|
||||
</channel-type>
|
||||
</thing:thing-descriptions>
|
||||
|
Loading…
Reference in New Issue
Block a user