]> git.basschouten.com Git - openhab-addons.git/blob
8c92c88fecbd7e34bd92f693ed7735033e50628f
[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.mihome.internal;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.thing.ThingTypeUID;
17
18 /**
19  * The {@link XiaomiGatewayBindingConstants} class defines common constants, which are
20  * used across the whole binding.
21  *
22  * @author Patrick Boos - Initial contribution
23  * @author Dieter Schmidt - added cube, gateway sound channels, window sensor alarm
24  * @author Daniel Walters - Added Aqara Door/Window sensor and Aqara temperature, humidity and pressure sensor
25  * @author Kuba Wolanin - Added Water Leak sensor
26  */
27 @NonNullByDefault
28 public class XiaomiGatewayBindingConstants {
29
30     public static final String BINDING_ID = "mihome";
31
32     public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "bridge");
33     public static final ThingTypeUID THING_TYPE_GATEWAY = new ThingTypeUID(BINDING_ID, "gateway");
34     public static final ThingTypeUID THING_TYPE_BASIC = new ThingTypeUID(BINDING_ID, "basic");
35     // sensors
36     public static final ThingTypeUID THING_TYPE_SENSOR_HT = new ThingTypeUID(BINDING_ID, "sensor_ht");
37     public static final ThingTypeUID THING_TYPE_SENSOR_AQARA_WEATHER_V1 = new ThingTypeUID(BINDING_ID,
38             "sensor_weather_v1");
39     public static final ThingTypeUID THING_TYPE_SENSOR_MOTION = new ThingTypeUID(BINDING_ID, "sensor_motion");
40     public static final ThingTypeUID THING_TYPE_SENSOR_AQARA_MOTION = new ThingTypeUID(BINDING_ID, "sensor_motion_aq2");
41     public static final ThingTypeUID THING_TYPE_SENSOR_SWITCH = new ThingTypeUID(BINDING_ID, "sensor_switch");
42     public static final ThingTypeUID THING_TYPE_SENSOR_AQARA_SWITCH = new ThingTypeUID(BINDING_ID, "sensor_switch_aq2");
43     public static final ThingTypeUID THING_TYPE_SENSOR_MAGNET = new ThingTypeUID(BINDING_ID, "sensor_magnet");
44     public static final ThingTypeUID THING_TYPE_SENSOR_AQARA_MAGNET = new ThingTypeUID(BINDING_ID, "sensor_magnet_aq2");
45     public static final ThingTypeUID THING_TYPE_SENSOR_AQARA_LOCK = new ThingTypeUID(BINDING_ID, "sensor_lock_aq1");
46     public static final ThingTypeUID THING_TYPE_SENSOR_CUBE = new ThingTypeUID(BINDING_ID, "sensor_cube");
47     public static final ThingTypeUID THING_TYPE_SENSOR_AQARA_VIBRATION = new ThingTypeUID(BINDING_ID,
48             "sensor_vibration");
49     public static final ThingTypeUID THING_TYPE_SENSOR_AQARA1 = new ThingTypeUID(BINDING_ID, "86sw1");
50     public static final ThingTypeUID THING_TYPE_SENSOR_AQARA2 = new ThingTypeUID(BINDING_ID, "86sw2");
51     public static final ThingTypeUID THING_TYPE_SENSOR_GAS = new ThingTypeUID(BINDING_ID, "natgas");
52     public static final ThingTypeUID THING_TYPE_SENSOR_SMOKE = new ThingTypeUID(BINDING_ID, "smoke");
53     public static final ThingTypeUID THING_TYPE_SENSOR_WATER = new ThingTypeUID(BINDING_ID, "sensor_wleak_aq1");
54
55     // actors
56     public static final ThingTypeUID THING_TYPE_ACTOR_PLUG = new ThingTypeUID(BINDING_ID, "sensor_plug");
57     public static final ThingTypeUID THING_TYPE_ACTOR_AQARA1 = new ThingTypeUID(BINDING_ID, "ctrl_neutral1");
58     public static final ThingTypeUID THING_TYPE_ACTOR_AQARA2 = new ThingTypeUID(BINDING_ID, "ctrl_neutral2");
59     public static final ThingTypeUID THING_TYPE_ACTOR_AQARA_ZERO1 = new ThingTypeUID(BINDING_ID, "ctrl_ln1");
60     public static final ThingTypeUID THING_TYPE_ACTOR_AQARA_ZERO2 = new ThingTypeUID(BINDING_ID, "ctrl_ln2");
61     public static final ThingTypeUID THING_TYPE_ACTOR_CURTAIN = new ThingTypeUID(BINDING_ID, "curtain");
62
63     // List of all Channel ids
64     public static final String CHANNEL_BATTERY_LEVEL = "batteryLevel";
65     public static final String CHANNEL_LOW_BATTERY = "lowBattery";
66     // HT sensor
67     public static final String CHANNEL_TEMPERATURE = "temperature";
68     public static final String CHANNEL_HUMIDITY = "humidity";
69     public static final String CHANNEL_PRESSURE = "pressure";
70     // motion sensor
71     public static final String CHANNEL_MOTION = "motion";
72     public static final String CHANNEL_MOTION_OFF_TIMER = "motionOffTimer";
73     public static final String CHANNEL_LAST_MOTION = "lastMotion";
74     // window sensor
75     public static final String CHANNEL_IS_OPEN = "isOpen";
76     public static final String CHANNEL_LAST_OPENED = "lastOpened";
77     public static final String CHANNEL_OPEN_ALARM = "isOpenAlarm";
78     public static final String CHANNEL_OPEN_ALARM_TIMER = "isOpenAlarmTimer";
79     // plug
80     public static final String CHANNEL_POWER_ON = "power";
81     public static final String CHANNEL_IN_USE = "inUse";
82     public static final String CHANNEL_LOAD_POWER = "loadPower";
83     public static final String CHANNEL_POWER_CONSUMED = "powerConsumed";
84     // switch
85     public static final String CHANNEL_BUTTON = "button";
86     // cube
87     public static final String CHANNEL_ACTION = "action";
88     public static final String CHANNEL_LAST_ACTION = "lastAction";
89     public static final String CHANNEL_CUBE_ROTATION_ANGLE = "rotationAngle";
90     public static final String CHANNEL_CUBE_ROTATION_TIME = "rotationTime";
91     // vibration
92     public static final String CHANNEL_TILT_ANGLE = "tiltAngle";
93     public static final String CHANNEL_ORIENTATION_X = "orientationX";
94     public static final String CHANNEL_ORIENTATION_Y = "orientationY";
95     public static final String CHANNEL_ORIENTATION_Z = "orientationZ";
96     public static final String CHANNEL_BED_ACTIVITY = "bedActivity";
97     // gateway sound
98     public static final String CHANNEL_GATEWAY_SOUND_SWITCH = "enableSound";
99     public static final String CHANNEL_GATEWAY_SOUND = "sound";
100     public static final String CHANNEL_GATEWAY_VOLUME = "volume";
101     // gateway light
102     public static final String CHANNEL_BRIGHTNESS = "brightness";
103     public static final String CHANNEL_ILLUMINATION = "illumination";
104     public static final String CHANNEL_COLOR = "color";
105     public static final String CHANNEL_COLOR_TEMPERATURE = "colorTemperature";
106     // aqara switches
107     public static final String CHANNEL_SWITCH_CH0 = "ch1";
108     public static final String CHANNEL_SWITCH_CH1 = "ch2";
109     public static final String CHANNEL_SWITCH_DUAL_CH = "dual_ch";
110     // curtain
111     public static final String CHANNEL_CURTAIN_CONTROL = "curtainControl";
112     // gas & smoke sensor
113     public static final String CHANNEL_ALARM = "alarm";
114     public static final String CHANNEL_STATUS = "status";
115     // smoke sensor
116     public static final String CHANNEL_DENSITY = "density";
117     // water leak sensor
118     public static final String CHANNEL_LEAK = "leak";
119     // aqara lock
120     public static final String CHANNEL_ID = "id";
121     public static final String CHANNEL_WRONG_ACCESS = "wrongAccess";
122     // Bridge config properties
123     public static final String SERIAL_NUMBER = "serialNumber";
124     public static final String HOST = "ipAddress";
125     public static final String PORT = "port";
126     public static final String INTERFACE = "interface";
127     public static final String TOKEN = "token";
128
129     // Item config properties
130     public static final String ITEM_ID = "itemId";
131
132     // Basic Device channels
133     public static final String CHANNEL_REPORT_MSG = "reportMessage";
134     public static final String CHANNEL_HEARTBEAT_MSG = "heartbeatMessage";
135     public static final String CHANNEL_READ_ACK_MSG = "readAckMessage";
136     public static final String CHANNEL_WRITE_ACK_MSG = "writeAckMessage";
137     public static final String CHANNEL_LAST_MSG = "lastMessage";
138     public static final String CHANNEL_WRITE_MSG = "writeMessage";
139 }