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.velux.internal;
15 import java.util.Arrays;
16 import java.util.HashSet;
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.openhab.core.thing.ThingTypeUID;
23 * The {@link VeluxBindingConstants} class defines common constants, which are
24 * used across the whole binding.
26 * For an in-depth view of the available Item types with description of parameters, take a look onto
27 * {@link org.openhab.binding.velux.internal.VeluxItemType VeluxItemType}.
29 * This class contains the Thing identifications:
31 * <LI>{@link #THING_VELUX_BRIDGE} for the bridge itself,</LI>
32 * <LI>{@link #THING_VELUX_SCENE} for the scenes summarizing a set of actuator states,</LI>
33 * <LI>{@link #THING_VELUX_ACTUATOR} for the general actuators identified on the bridge,</LI>
34 * <LI>{@link #THING_VELUX_ROLLERSHUTTER} for the rollershutters identified on the bridge,</LI>
35 * <LI>{@link #THING_VELUX_WINDOW} for the windows identified on the bridge.</LI>
36 * <LI>{@link #THING_VELUX_VSHUTTER} for the virtual shutters defined in the configuration</LI>
39 * @author Guenther Schreiner - Initial contribution
42 public class VeluxBindingConstants {
44 /** Basic binding identification. */
45 public static final String BINDING_ID = "velux";
47 // Id of support bridge
49 * The Thing identification of the binding.
51 private static final String THING_VELUX_BINDING = "binding";
53 * The Thing identification of the <B>Velux</B> bridge.
55 private static final String THING_VELUX_BRIDGE = "klf200";
57 * The Thing identification of a scene defined on the <B>Velux</B> bridge.
59 private static final String THING_VELUX_SCENE = "scene";
61 * The Thing identification of a generic actuator defined on the <B>Velux</B> bridge.
63 private static final String THING_VELUX_ACTUATOR = "actuator";
65 * The Thing identification of a rollershutter defined on the <B>Velux</B> bridge.
67 private static final String THING_VELUX_ROLLERSHUTTER = "rollershutter";
69 * The Thing identification of a window defined on the <B>Velux</B> bridge.
71 private static final String THING_VELUX_WINDOW = "window";
73 * The Thing identification of a virtual shutter defined on the <B>Velux</B> bridge.
75 private static final String THING_VELUX_VSHUTTER = "vshutter";
77 // List of all Thing Type UIDs
78 public static final ThingTypeUID THING_TYPE_BINDING = new ThingTypeUID(BINDING_ID, THING_VELUX_BINDING);
80 // List of all Bridge Type UIDs
81 public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, THING_VELUX_BRIDGE);
83 // List of all Thing Type UIDs beyond the bridge(s)
84 public static final ThingTypeUID THING_TYPE_VELUX_SCENE = new ThingTypeUID(BINDING_ID, THING_VELUX_SCENE);
85 public static final ThingTypeUID THING_TYPE_VELUX_ACTUATOR = new ThingTypeUID(BINDING_ID, THING_VELUX_ACTUATOR);
86 public static final ThingTypeUID THING_TYPE_VELUX_ROLLERSHUTTER = new ThingTypeUID(BINDING_ID,
87 THING_VELUX_ROLLERSHUTTER);
88 public static final ThingTypeUID THING_TYPE_VELUX_WINDOW = new ThingTypeUID(BINDING_ID, THING_VELUX_WINDOW);
89 public static final ThingTypeUID THING_TYPE_VELUX_VSHUTTER = new ThingTypeUID(BINDING_ID, THING_VELUX_VSHUTTER);
91 // Definitions of different set of Things
92 public static final Set<ThingTypeUID> SUPPORTED_THINGS_BINDING = new HashSet<>(Arrays.asList(THING_TYPE_BINDING));
93 public static final Set<ThingTypeUID> SUPPORTED_THINGS_BRIDGE = new HashSet<>(Arrays.asList(THING_TYPE_BRIDGE));
95 public static final Set<ThingTypeUID> SUPPORTED_THINGS_ITEMS = new HashSet<>(
96 Arrays.asList(THING_TYPE_VELUX_SCENE, THING_TYPE_VELUX_ACTUATOR, THING_TYPE_VELUX_ROLLERSHUTTER,
97 THING_TYPE_VELUX_WINDOW, THING_TYPE_VELUX_VSHUTTER));
99 public static final Set<ThingTypeUID> DISCOVERABLE_THINGS = Set.of(THING_TYPE_VELUX_SCENE,
100 THING_TYPE_VELUX_ACTUATOR, THING_TYPE_VELUX_ROLLERSHUTTER, THING_TYPE_VELUX_WINDOW,
101 THING_TYPE_VELUX_VSHUTTER, THING_TYPE_BINDING, THING_TYPE_BRIDGE);
103 public static final Set<ThingTypeUID> ACTUATOR_THINGS = Set.of(THING_TYPE_VELUX_ACTUATOR,
104 THING_TYPE_VELUX_ROLLERSHUTTER, THING_TYPE_VELUX_WINDOW);
106 // *** List of all Channel ids ***
108 // List of all binding channel ids
110 /** Channel identifier describing the current Binding State. */
111 public static final String CHANNEL_BINDING_INFORMATION = "information";
113 // List of all bridge channel ids
115 /** Channel/Property identifier describing the current Bridge State. */
116 public static final String CHANNEL_BRIDGE_STATUS = "status";
117 public static final String CHANNEL_BRIDGE_RELOAD = "reload";
118 public static final String CHANNEL_BRIDGE_DOWNTIME = "downtime";
119 public static final String CHANNEL_BRIDGE_DO_DETECTION = "doDetection";
121 public static final String PROPERTY_BRIDGE_TIMESTAMP_SUCCESS = "connectionSuccess";
122 public static final String PROPERTY_BRIDGE_TIMESTAMP_ATTEMPT = "connectionAttempt";
123 public static final String PROPERTY_BRIDGE_FIRMWARE = "firmware";
124 public static final String PROPERTY_BRIDGE_ADDRESS = "address";
125 public static final String PROPERTY_BRIDGE_SUBNETMASK = "subnetMask";
126 public static final String PROPERTY_BRIDGE_DEFAULTGW = "defaultGW";
127 public static final String PROPERTY_BRIDGE_DHCP = "DHCP";
128 public static final String PROPERTY_BRIDGE_WLANSSID = "WLANSSID";
129 public static final String PROPERTY_BRIDGE_WLANPASSWORD = "WLANPassword";
131 public static final String PROPERTY_BRIDGE_CHECK = "check";
132 public static final String PROPERTY_BRIDGE_PRODUCTS = "products";
133 public static final String PROPERTY_BRIDGE_SCENES = "scenes";
135 // List of all scene channel ids
136 public static final String CHANNEL_SCENE_ACTION = "action";
137 public static final String CHANNEL_SCENE_SILENTMODE = "silentMode";
139 // List of all actuator channel ids
140 public static final String CHANNEL_ACTUATOR_POSITION = "position";
141 public static final String CHANNEL_ACTUATOR_STATE = "state";
142 public static final String CHANNEL_ACTUATOR_SILENTMODE = "silentMode";
143 public static final String CHANNEL_ACTUATOR_LIMIT_MINIMUM = "limitMinimum";
144 public static final String CHANNEL_ACTUATOR_LIMIT_MAXIMUM = "limitMaximum";
145 public static final String CHANNEL_VANE_POSITION = "vanePosition";
147 // List of all virtual shutter channel ids
148 public static final String CHANNEL_VSHUTTER_POSITION = "vposition";
150 // Helper definitions
151 public static final String BINDING_VALUES_SEPARATOR = ",";
152 public static final String OUTPUT_VALUE_SEPARATOR = ",";
153 public static final String UNKNOWN = "unknown";
155 // Critical issues to be reported will use the following message
156 public static final String LOGGING_CONTACT = "Please report to maintainer: ";
158 public static final String UNKNOWN_THING_TYPE_ID = "FAILED";
159 public static final String UNKNOWN_IP_ADDRESS = "xxx.xxx.xxx.xxx";