2 * Copyright (c) 2010-2023 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.touchwand.internal;
15 import java.util.HashSet;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.openhab.core.thing.ThingTypeUID;
22 * The {@link TouchWandBindingConstants} class defines common constants, which are
23 * used across the whole binding.
25 * @author Roie Geron - Initial contribution
28 public class TouchWandBindingConstants {
30 public static final String BINDING_ID = "touchwand";
31 public static final String DISCOVERY_THREAD_ID = "OH-binding-touchwand-discovery";
33 // List of all Thing Type UIDs
34 public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "bridge");
35 public static final ThingTypeUID THING_TYPE_SWITCH = new ThingTypeUID(BINDING_ID, "switch");
36 public static final ThingTypeUID THING_TYPE_SHUTTER = new ThingTypeUID(BINDING_ID, "shutter");
37 public static final ThingTypeUID THING_TYPE_WALLCONTROLLER = new ThingTypeUID(BINDING_ID, "wallcontroller");
38 public static final ThingTypeUID THING_TYPE_DIMMER = new ThingTypeUID(BINDING_ID, "dimmer");
39 public static final ThingTypeUID THING_TYPE_ALARMSENSOR = new ThingTypeUID(BINDING_ID, "alarmsensor");
40 public static final ThingTypeUID THING_TYPE_BSENSOR = new ThingTypeUID(BINDING_ID, "bsensor");
41 public static final ThingTypeUID THING_TYPE_THERMOSTAT = new ThingTypeUID(BINDING_ID, "thermostat");
43 // List of all Channel ids
44 public static final String CHANNEL_SWITCH = "switch";
45 public static final String CHANNEL_SHUTTER = "shutter";
46 public static final String CHANNEL_DIMMER = "brightness";
47 public static final String CHANNEL_ALARM = "alarm";
48 public static final String CHANNEL_WALLCONTROLLER_ACTION = "wallaction";
49 public static final String CHANNEL_BATTERY_LEVEL = "battery_level";
50 public static final String CHANNEL_BATTERY_LOW = "battery_low";
51 public static final String CHANNEL_LEAK = "leak";
52 public static final String CHANNEL_MOTION = "motion";
53 public static final String CHANNEL_ILLUMINATION = "illumination";
54 public static final String CHANNEL_DOORWINDOW = "isOpen";
55 public static final String CHANNEL_TEMPERATURE = "temperature";
56 public static final String CHANNEL_THERMOSTAT_STATE = "state";
57 public static final String CHANNEL_THERMOSTAT_TARGET_TEMPERATURE = "targetTemperature";
58 public static final String CHANNEL_THERMOSTAT_ROOM_TEMPERATURE = "roomTemperature";
59 public static final String CHANNEL_THERMOSTAT_MODE = "mode";
60 public static final String CHANNEL_THERMOSTAT_FAN_LEVEL = "fanLevel";
61 public static final String CHANNEL_SMOKE = "smoke";
63 // List of configuration parameters
65 public static final String HOST = "ipAddress";
66 public static final String PORT = "port";
67 public static final String USER = "username";
68 public static final String PASS = "password";
69 public static final String STATUS_REFRESH_TIME = "statusrefresh";
70 public static final String ADD_SECONDARY_UNITS = "addSecondaryUnits";
72 // Unit handler properties
74 public static final String HANDLER_PROPERTIES_ID = "id";
75 public static final String HANDLER_PROPERTIES_NAME = "name";
77 // Connectivity options
79 public static final String CONNECTIVITY_KNX = "knx";
80 public static final String CONNECTIVITY_ZWAVE = "zwave";
81 public static final String CONNECTIVITY_RISCO = "risco";
82 public static final String CONNECTIVITY_PIMA = "pima";
83 public static final String CONNECTIVITY_ACWAND = "acwand";
87 public static final String SWITCH_STATUS_ON = "255";
88 public static final String SWITCH_STATUS_OFF = "0";
90 // thermostat commands
91 public static final String THERMOSTAT_STATE_ON = "1";
92 public static final String THERMOSTAT_STATE_OFF = "0";
93 public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = new HashSet<>();
96 SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_SWITCH);
97 SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_SHUTTER);
98 SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_WALLCONTROLLER);
99 SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_DIMMER);
100 SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_ALARMSENSOR);
101 SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_BSENSOR);
102 SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_THERMOSTAT);
105 public static final String TYPE_WALLCONTROLLER = "WallController";
106 public static final String TYPE_SWITCH = "Switch";
107 public static final String TYPE_SHUTTER = "shutter";
108 public static final String TYPE_DIMMER = "dimmer";
109 public static final String TYPE_ALARMSENSOR = "AlarmSensor";
110 public static final String TYPE_BSENSOR = "bsensor";
111 public static final String TYPE_THERMOSTAT = "thermostat";
112 public static final String TYPE_UNKNOWN = "unknown";
114 public static final int SENSOR_TYPE_TEMPERATURE = 1;
115 public static final int SENSOR_TYPE_LUMINANCE = 3;
116 public static final int SENSOR_TYPE_LEAK = 6;
117 public static final int SENSOR_TYPE_DOOR_WINDOW = 10;
118 public static final int SENSOR_TYPE_MOTION = 12;
120 // bsensor currStatus options
122 public static final String BSENSOR_STATUS_OPEN = "open";
123 public static final String BSENSOR_STATUS_CLOSE = "close";
125 public static final String BSENSOR_SUBTYPE_DOORWINDOW = "doors &windows";
126 public static final String BSENSOR_SUBTYPE_MOTION = "motion";
127 public static final String BSENSOR_SUBTYPE_SMOKE = "smoke";
129 public static final String[] SUPPORTED_TOUCHWAND_TYPES = { TYPE_WALLCONTROLLER, TYPE_SWITCH, TYPE_SHUTTER,
130 TYPE_DIMMER, TYPE_ALARMSENSOR, TYPE_BSENSOR, TYPE_THERMOSTAT };