]> git.basschouten.com Git - openhab-addons.git/blob
4e5f12cbf330afb40534e05eaf2eaca018a4c2cb
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 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     // Special sensor - Thermostat
53     public static final ThingTypeUID THING_TYPE_THERMOSTAT = new ThingTypeUID(BINDING_ID, "thermostat");
54
55     // lights
56     public static final ThingTypeUID THING_TYPE_ONOFF_LIGHT = new ThingTypeUID(BINDING_ID, "onofflight");
57     public static final ThingTypeUID THING_TYPE_DIMMABLE_LIGHT = new ThingTypeUID(BINDING_ID, "dimmablelight");
58     public static final ThingTypeUID THING_TYPE_COLOR_TEMPERATURE_LIGHT = new ThingTypeUID(BINDING_ID,
59             "colortemperaturelight");
60     public static final ThingTypeUID THING_TYPE_COLOR_LIGHT = new ThingTypeUID(BINDING_ID, "colorlight");
61     public static final ThingTypeUID THING_TYPE_EXTENDED_COLOR_LIGHT = new ThingTypeUID(BINDING_ID,
62             "extendedcolorlight");
63     public static final ThingTypeUID THING_TYPE_WINDOW_COVERING = new ThingTypeUID(BINDING_ID, "windowcovering");
64     public static final ThingTypeUID THING_TYPE_WARNING_DEVICE = new ThingTypeUID(BINDING_ID, "warningdevice");
65
66     // groups
67     public static final ThingTypeUID THING_TYPE_LIGHTGROUP = new ThingTypeUID(BINDING_ID, "lightgroup");
68
69     // sensor channel ids
70     public static final String CHANNEL_PRESENCE = "presence";
71     public static final String CHANNEL_LAST_UPDATED = "last_updated";
72     public static final String CHANNEL_LAST_SEEN = "last_seen";
73     public static final String CHANNEL_POWER = "power";
74     public static final String CHANNEL_CONSUMPTION = "consumption";
75     public static final String CHANNEL_VOLTAGE = "voltage";
76     public static final String CHANNEL_CURRENT = "current";
77     public static final String CHANNEL_VALUE = "value";
78     public static final String CHANNEL_TEMPERATURE = "temperature";
79     public static final String CHANNEL_HUMIDITY = "humidity";
80     public static final String CHANNEL_PRESSURE = "pressure";
81     public static final String CHANNEL_LIGHT = "light";
82     public static final String CHANNEL_LIGHT_LUX = "lightlux";
83     public static final String CHANNEL_LIGHT_LEVEL = "light_level";
84     public static final String CHANNEL_DARK = "dark";
85     public static final String CHANNEL_DAYLIGHT = "daylight";
86     public static final String CHANNEL_BUTTON = "button";
87     public static final String CHANNEL_BUTTONEVENT = "buttonevent";
88     public static final String CHANNEL_GESTURE = "gesture";
89     public static final String CHANNEL_GESTUREEVENT = "gestureevent";
90     public static final String CHANNEL_OPENCLOSE = "open";
91     public static final String CHANNEL_WATERLEAKAGE = "waterleakage";
92     public static final String CHANNEL_FIRE = "fire";
93     public static final String CHANNEL_ALARM = "alarm";
94     public static final String CHANNEL_TAMPERED = "tampered";
95     public static final String CHANNEL_VIBRATION = "vibration";
96     public static final String CHANNEL_BATTERY_LEVEL = "battery_level";
97     public static final String CHANNEL_BATTERY_LOW = "battery_low";
98     public static final String CHANNEL_CARBONMONOXIDE = "carbonmonoxide";
99     public static final String CHANNEL_HEATSETPOINT = "heatsetpoint";
100     public static final String CHANNEL_THERMOSTAT_MODE = "mode";
101     public static final String CHANNEL_TEMPERATURE_OFFSET = "offset";
102     public static final String CHANNEL_VALVE_POSITION = "valve";
103
104     // group + light channel ids
105     public static final String CHANNEL_SWITCH = "switch";
106     public static final String CHANNEL_BRIGHTNESS = "brightness";
107     public static final String CHANNEL_COLOR_TEMPERATURE = "color_temperature";
108     public static final String CHANNEL_COLOR = "color";
109     public static final String CHANNEL_POSITION = "position";
110     public static final String CHANNEL_ALERT = "alert";
111     public static final String CHANNEL_ALL_ON = "all_on";
112     public static final String CHANNEL_ANY_ON = "any_on";
113
114     // Thing configuration
115     public static final String CONFIG_HOST = "host";
116     public static final String CONFIG_HTTP_PORT = "httpPort";
117     public static final String CONFIG_APIKEY = "apikey";
118     public static final String PROPERTY_UDN = "UDN";
119     public static final String CONFIG_ID = "id";
120     public static final String UNIQUE_ID = "uid";
121
122     public static final String PROPERTY_CT_MIN = "ctmin";
123     public static final String PROPERTY_CT_MAX = "ctmax";
124
125     // CT value range according to ZCL Spec
126     public static final int ZCL_CT_UNDEFINED = 0; // 0x0000
127     public static final int ZCL_CT_MIN = 1;
128     public static final int ZCL_CT_MAX = 65279; // 0xFEFF
129     public static final int ZCL_CT_INVALID = 65535; // 0xFFFF
130
131     public static final double HUE_FACTOR = 65535 / 360.0;
132     public static final int BRIGHTNESS_MIN = 0;
133     public static final int BRIGHTNESS_MAX = 254;
134     public static final double BRIGHTNESS_FACTOR = BRIGHTNESS_MAX / PercentType.HUNDRED.intValue();
135 }