]> git.basschouten.com Git - openhab-addons.git/blob
a7b81419a3dcae96503b21dd68947b51bf9fab5a
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.deconz.internal;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.library.types.PercentType;
17 import org.openhab.core.thing.ThingTypeUID;
18
19 /**
20  * The {@link BindingConstants} class defines common constants, which are
21  * used across the whole binding.
22  *
23  * @author David Graeff - Initial contribution
24  */
25 @NonNullByDefault
26 public class BindingConstants {
27     public static final String BINDING_ID = "deconz";
28
29     // List of all Thing Type UIDs
30     public static final ThingTypeUID BRIDGE_TYPE = new ThingTypeUID(BINDING_ID, "deconz");
31
32     // sensors
33     public static final ThingTypeUID THING_TYPE_PRESENCE_SENSOR = new ThingTypeUID(BINDING_ID, "presencesensor");
34     public static final ThingTypeUID THING_TYPE_POWER_SENSOR = new ThingTypeUID(BINDING_ID, "powersensor");
35     public static final ThingTypeUID THING_TYPE_CONSUMPTION_SENSOR = new ThingTypeUID(BINDING_ID, "consumptionsensor");
36     public static final ThingTypeUID THING_TYPE_DAYLIGHT_SENSOR = new ThingTypeUID(BINDING_ID, "daylightsensor");
37     public static final ThingTypeUID THING_TYPE_COLOR_CONTROL = new ThingTypeUID(BINDING_ID, "colorcontrol");
38     public static final ThingTypeUID THING_TYPE_SWITCH = new ThingTypeUID(BINDING_ID, "switch");
39     public static final ThingTypeUID THING_TYPE_LIGHT_SENSOR = new ThingTypeUID(BINDING_ID, "lightsensor");
40     public static final ThingTypeUID THING_TYPE_TEMPERATURE_SENSOR = new ThingTypeUID(BINDING_ID, "temperaturesensor");
41     public static final ThingTypeUID THING_TYPE_HUMIDITY_SENSOR = new ThingTypeUID(BINDING_ID, "humiditysensor");
42     public static final ThingTypeUID THING_TYPE_PRESSURE_SENSOR = new ThingTypeUID(BINDING_ID, "pressuresensor");
43     public static final ThingTypeUID THING_TYPE_OPENCLOSE_SENSOR = new ThingTypeUID(BINDING_ID, "openclosesensor");
44     public static final ThingTypeUID THING_TYPE_WATERLEAKAGE_SENSOR = new ThingTypeUID(BINDING_ID,
45             "waterleakagesensor");
46     public static final ThingTypeUID THING_TYPE_FIRE_SENSOR = new ThingTypeUID(BINDING_ID, "firesensor");
47     public static final ThingTypeUID THING_TYPE_ALARM_SENSOR = new ThingTypeUID(BINDING_ID, "alarmsensor");
48     public static final ThingTypeUID THING_TYPE_VIBRATION_SENSOR = new ThingTypeUID(BINDING_ID, "vibrationsensor");
49     public static final ThingTypeUID THING_TYPE_BATTERY_SENSOR = new ThingTypeUID(BINDING_ID, "batterysensor");
50     public static final ThingTypeUID THING_TYPE_CARBONMONOXIDE_SENSOR = new ThingTypeUID(BINDING_ID,
51             "carbonmonoxidesensor");
52     public static final ThingTypeUID THING_TYPE_AIRQUALITY_SENSOR = new ThingTypeUID(BINDING_ID, "airqualitysensor");
53     // Special sensor - Thermostat
54     public static final ThingTypeUID THING_TYPE_THERMOSTAT = new ThingTypeUID(BINDING_ID, "thermostat");
55
56     // lights
57     public static final ThingTypeUID THING_TYPE_ONOFF_LIGHT = new ThingTypeUID(BINDING_ID, "onofflight");
58     public static final ThingTypeUID THING_TYPE_DIMMABLE_LIGHT = new ThingTypeUID(BINDING_ID, "dimmablelight");
59     public static final ThingTypeUID THING_TYPE_COLOR_TEMPERATURE_LIGHT = new ThingTypeUID(BINDING_ID,
60             "colortemperaturelight");
61     public static final ThingTypeUID THING_TYPE_COLOR_LIGHT = new ThingTypeUID(BINDING_ID, "colorlight");
62     public static final ThingTypeUID THING_TYPE_EXTENDED_COLOR_LIGHT = new ThingTypeUID(BINDING_ID,
63             "extendedcolorlight");
64     public static final ThingTypeUID THING_TYPE_WINDOW_COVERING = new ThingTypeUID(BINDING_ID, "windowcovering");
65     public static final ThingTypeUID THING_TYPE_WARNING_DEVICE = new ThingTypeUID(BINDING_ID, "warningdevice");
66     public static final ThingTypeUID THING_TYPE_DOORLOCK = new ThingTypeUID(BINDING_ID, "doorlock");
67
68     // groups
69     public static final ThingTypeUID THING_TYPE_LIGHTGROUP = new ThingTypeUID(BINDING_ID, "lightgroup");
70
71     // sensor channel ids
72     public static final String CHANNEL_PRESENCE = "presence";
73     public static final String CHANNEL_ENABLED = "enabled";
74     public static final String CHANNEL_LAST_UPDATED = "last_updated";
75     public static final String CHANNEL_LAST_SEEN = "last_seen";
76     public static final String CHANNEL_POWER = "power";
77     public static final String CHANNEL_CONSUMPTION = "consumption";
78     public static final String CHANNEL_VOLTAGE = "voltage";
79     public static final String CHANNEL_CURRENT = "current";
80     public static final String CHANNEL_VALUE = "value";
81     public static final String CHANNEL_TEMPERATURE = "temperature";
82     public static final String CHANNEL_HUMIDITY = "humidity";
83     public static final String CHANNEL_PRESSURE = "pressure";
84     public static final String CHANNEL_LIGHT = "light";
85     public static final String CHANNEL_LIGHT_LUX = "lightlux";
86     public static final String CHANNEL_LIGHT_LEVEL = "light_level";
87     public static final String CHANNEL_DARK = "dark";
88     public static final String CHANNEL_DAYLIGHT = "daylight";
89     public static final String CHANNEL_BUTTON = "button";
90     public static final String CHANNEL_BUTTONEVENT = "buttonevent";
91     public static final String CHANNEL_GESTURE = "gesture";
92     public static final String CHANNEL_GESTUREEVENT = "gestureevent";
93     public static final String CHANNEL_OPENCLOSE = "open";
94     public static final String CHANNEL_WATERLEAKAGE = "waterleakage";
95     public static final String CHANNEL_FIRE = "fire";
96     public static final String CHANNEL_ALARM = "alarm";
97     public static final String CHANNEL_TAMPERED = "tampered";
98     public static final String CHANNEL_VIBRATION = "vibration";
99     public static final String CHANNEL_BATTERY_LEVEL = "battery_level";
100     public static final String CHANNEL_BATTERY_LOW = "battery_low";
101     public static final String CHANNEL_CARBONMONOXIDE = "carbonmonoxide";
102     public static final String CHANNEL_AIRQUALITY = "airquality";
103     public static final String CHANNEL_AIRQUALITYPPB = "airqualityppb";
104     public static final String CHANNEL_HEATSETPOINT = "heatsetpoint";
105     public static final String CHANNEL_THERMOSTAT_MODE = "mode";
106     public static final String CHANNEL_TEMPERATURE_OFFSET = "offset";
107     public static final String CHANNEL_VALVE_POSITION = "valve";
108     public static final String CHANNEL_WINDOWOPEN = "windowopen";
109
110     // group + light channel ids
111     public static final String CHANNEL_SWITCH = "switch";
112     public static final String CHANNEL_BRIGHTNESS = "brightness";
113     public static final String CHANNEL_COLOR_TEMPERATURE = "color_temperature";
114     public static final String CHANNEL_COLOR = "color";
115     public static final String CHANNEL_POSITION = "position";
116     public static final String CHANNEL_ALERT = "alert";
117     public static final String CHANNEL_ALL_ON = "all_on";
118     public static final String CHANNEL_ANY_ON = "any_on";
119     public static final String CHANNEL_LOCK = "lock";
120     public static final String CHANNEL_EFFECT = "effect";
121     public static final String CHANNEL_EFFECT_SPEED = "effectSpeed";
122     public static final String CHANNEL_SCENE = "scene";
123     public static final String CHANNEL_ONTIME = "ontime";
124
125     // Thing configuration
126     public static final String CONFIG_HOST = "host";
127     public static final String CONFIG_HTTP_PORT = "httpPort";
128     public static final String CONFIG_APIKEY = "apikey";
129     public static final String PROPERTY_UDN = "UDN";
130     public static final String CONFIG_ID = "id";
131     public static final String UNIQUE_ID = "uid";
132
133     public static final String PROPERTY_CT_MIN = "ctmin";
134     public static final String PROPERTY_CT_MAX = "ctmax";
135
136     // CT value range according to ZCL Spec
137     public static final int ZCL_CT_UNDEFINED = 0; // 0x0000
138     public static final int ZCL_CT_MIN = 1;
139     public static final int ZCL_CT_MAX = 65279; // 0xFEFF
140     public static final int ZCL_CT_INVALID = 65535; // 0xFFFF
141
142     public static final double HUE_FACTOR = 65535 / 360.0;
143     public static final int BRIGHTNESS_MIN = 0;
144     public static final int BRIGHTNESS_MAX = 254;
145     public static final double BRIGHTNESS_FACTOR = BRIGHTNESS_MAX / PercentType.HUNDRED.doubleValue();
146 }