2 * Copyright (c) 2010-2020 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.deconz.internal;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.thing.ThingTypeUID;
19 * The {@link BindingConstants} class defines common constants, which are
20 * used across the whole binding.
22 * @author David Graeff - Initial contribution
25 public class BindingConstants {
26 public static final String BINDING_ID = "deconz";
28 // List of all Thing Type UIDs
29 public static final ThingTypeUID BRIDGE_TYPE = new ThingTypeUID(BINDING_ID, "deconz");
32 public static final ThingTypeUID THING_TYPE_PRESENCE_SENSOR = new ThingTypeUID(BINDING_ID, "presencesensor");
33 public static final ThingTypeUID THING_TYPE_POWER_SENSOR = new ThingTypeUID(BINDING_ID, "powersensor");
34 public static final ThingTypeUID THING_TYPE_CONSUMPTION_SENSOR = new ThingTypeUID(BINDING_ID, "consumptionsensor");
35 public static final ThingTypeUID THING_TYPE_DAYLIGHT_SENSOR = new ThingTypeUID(BINDING_ID, "daylightsensor");
36 public static final ThingTypeUID THING_TYPE_COLOR_CONTROL = new ThingTypeUID(BINDING_ID, "colorcontrol");
37 public static final ThingTypeUID THING_TYPE_SWITCH = new ThingTypeUID(BINDING_ID, "switch");
38 public static final ThingTypeUID THING_TYPE_LIGHT_SENSOR = new ThingTypeUID(BINDING_ID, "lightsensor");
39 public static final ThingTypeUID THING_TYPE_TEMPERATURE_SENSOR = new ThingTypeUID(BINDING_ID, "temperaturesensor");
40 public static final ThingTypeUID THING_TYPE_HUMIDITY_SENSOR = new ThingTypeUID(BINDING_ID, "humiditysensor");
41 public static final ThingTypeUID THING_TYPE_PRESSURE_SENSOR = new ThingTypeUID(BINDING_ID, "pressuresensor");
42 public static final ThingTypeUID THING_TYPE_OPENCLOSE_SENSOR = new ThingTypeUID(BINDING_ID, "openclosesensor");
43 public static final ThingTypeUID THING_TYPE_WATERLEAKAGE_SENSOR = new ThingTypeUID(BINDING_ID,
44 "waterleakagesensor");
45 public static final ThingTypeUID THING_TYPE_FIRE_SENSOR = new ThingTypeUID(BINDING_ID, "firesensor");
46 public static final ThingTypeUID THING_TYPE_ALARM_SENSOR = new ThingTypeUID(BINDING_ID, "alarmsensor");
47 public static final ThingTypeUID THING_TYPE_VIBRATION_SENSOR = new ThingTypeUID(BINDING_ID, "vibrationsensor");
48 public static final ThingTypeUID THING_TYPE_BATTERY_SENSOR = new ThingTypeUID(BINDING_ID, "batterysensor");
49 public static final ThingTypeUID THING_TYPE_CARBONMONOXIDE_SENSOR = new ThingTypeUID(BINDING_ID,
50 "carbonmonoxidesensor");
51 // Special sensor - Thermostat
52 public static final ThingTypeUID THING_TYPE_THERMOSTAT = new ThingTypeUID(BINDING_ID, "thermostat");
55 public static final ThingTypeUID THING_TYPE_ONOFF_LIGHT = new ThingTypeUID(BINDING_ID, "onofflight");
56 public static final ThingTypeUID THING_TYPE_DIMMABLE_LIGHT = new ThingTypeUID(BINDING_ID, "dimmablelight");
57 public static final ThingTypeUID THING_TYPE_COLOR_TEMPERATURE_LIGHT = new ThingTypeUID(BINDING_ID,
58 "colortemperaturelight");
59 public static final ThingTypeUID THING_TYPE_COLOR_LIGHT = new ThingTypeUID(BINDING_ID, "colorlight");
60 public static final ThingTypeUID THING_TYPE_EXTENDED_COLOR_LIGHT = new ThingTypeUID(BINDING_ID,
61 "extendedcolorlight");
62 public static final ThingTypeUID THING_TYPE_WINDOW_COVERING = new ThingTypeUID(BINDING_ID, "windowcovering");
63 public static final ThingTypeUID THING_TYPE_WARNING_DEVICE = new ThingTypeUID(BINDING_ID, "warningdevice");
66 public static final ThingTypeUID THING_TYPE_LIGHTGROUP = new ThingTypeUID(BINDING_ID, "lightgroup");
69 public static final String CHANNEL_PRESENCE = "presence";
70 public static final String CHANNEL_LAST_UPDATED = "last_updated";
71 public static final String CHANNEL_LAST_SEEN = "last_seen";
72 public static final String CHANNEL_POWER = "power";
73 public static final String CHANNEL_CONSUMPTION = "consumption";
74 public static final String CHANNEL_VOLTAGE = "voltage";
75 public static final String CHANNEL_CURRENT = "current";
76 public static final String CHANNEL_VALUE = "value";
77 public static final String CHANNEL_TEMPERATURE = "temperature";
78 public static final String CHANNEL_HUMIDITY = "humidity";
79 public static final String CHANNEL_PRESSURE = "pressure";
80 public static final String CHANNEL_LIGHT = "light";
81 public static final String CHANNEL_LIGHT_LUX = "lightlux";
82 public static final String CHANNEL_LIGHT_LEVEL = "light_level";
83 public static final String CHANNEL_DARK = "dark";
84 public static final String CHANNEL_DAYLIGHT = "daylight";
85 public static final String CHANNEL_BUTTON = "button";
86 public static final String CHANNEL_BUTTONEVENT = "buttonevent";
87 public static final String CHANNEL_GESTURE = "gesture";
88 public static final String CHANNEL_GESTUREEVENT = "gestureevent";
89 public static final String CHANNEL_OPENCLOSE = "open";
90 public static final String CHANNEL_WATERLEAKAGE = "waterleakage";
91 public static final String CHANNEL_FIRE = "fire";
92 public static final String CHANNEL_ALARM = "alarm";
93 public static final String CHANNEL_TAMPERED = "tampered";
94 public static final String CHANNEL_VIBRATION = "vibration";
95 public static final String CHANNEL_BATTERY_LEVEL = "battery_level";
96 public static final String CHANNEL_BATTERY_LOW = "battery_low";
97 public static final String CHANNEL_CARBONMONOXIDE = "carbonmonoxide";
98 public static final String CHANNEL_HEATSETPOINT = "heatsetpoint";
99 public static final String CHANNEL_THERMOSTAT_MODE = "mode";
100 public static final String CHANNEL_TEMPERATURE_OFFSET = "offset";
101 public static final String CHANNEL_VALVE_POSITION = "valve";
103 // group + light channel ids
104 public static final String CHANNEL_SWITCH = "switch";
105 public static final String CHANNEL_BRIGHTNESS = "brightness";
106 public static final String CHANNEL_COLOR_TEMPERATURE = "color_temperature";
107 public static final String CHANNEL_COLOR = "color";
108 public static final String CHANNEL_POSITION = "position";
109 public static final String CHANNEL_ALERT = "alert";
110 public static final String CHANNEL_ALL_ON = "all_on";
111 public static final String CHANNEL_ANY_ON = "any_on";
113 // Thing configuration
114 public static final String CONFIG_HOST = "host";
115 public static final String CONFIG_HTTP_PORT = "httpPort";
116 public static final String CONFIG_APIKEY = "apikey";
117 public static final String PROPERTY_UDN = "UDN";
118 public static final String CONFIG_ID = "id";
119 public static final String UNIQUE_ID = "uid";
121 public static final String PROPERTY_CT_MIN = "ctmin";
122 public static final String PROPERTY_CT_MAX = "ctmax";
124 // CT value range according to ZCL Spec
125 public static final int ZCL_CT_UNDEFINED = 0; // 0x0000
126 public static final int ZCL_CT_MIN = 1;
127 public static final int ZCL_CT_MAX = 65279; // 0xFEFF
128 public static final int ZCL_CT_INVALID = 65535; // 0xFFFF
130 public static final double HUE_FACTOR = 65535 / 360.0;
131 public static final double BRIGHTNESS_FACTOR = 2.54;