]> git.basschouten.com Git - openhab-addons.git/blob
218aa20fe996e3e4ccfec8d188c2e3cf102b4df1
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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.openwebnet.internal;
14
15 import java.util.Collection;
16 import java.util.HashSet;
17 import java.util.Set;
18 import java.util.stream.Collectors;
19 import java.util.stream.Stream;
20
21 import org.eclipse.jdt.annotation.NonNullByDefault;
22 import org.openhab.core.thing.ThingTypeUID;
23
24 /**
25  * The {@link OpenWebNetBindingConstants} class defines common constants, which are used across the whole binding.
26  *
27  * @author Massimo Valla - Initial contribution
28  * @author Andrea Conte - Energy management, Thermoregulation
29  * @author Gilberto Cocchi - Thermoregulation
30  */
31
32 @NonNullByDefault
33 public class OpenWebNetBindingConstants {
34
35     public static final String BINDING_ID = "openwebnet";
36
37     public static final int THING_STATE_REQ_TIMEOUT_SEC = 5;
38
39     // #LIST OF Thing Type UIDs
40     // generic device (used for not identified devices)
41     public static final ThingTypeUID THING_TYPE_GENERIC_DEVICE = new ThingTypeUID(BINDING_ID, "generic_device");
42     public static final String THING_LABEL_GENERIC_DEVICE = "GENERIC Device";
43     // bridges
44     public static final ThingTypeUID THING_TYPE_ZB_GATEWAY = new ThingTypeUID(BINDING_ID, "zb_gateway");
45     public static final String THING_LABEL_ZB_GATEWAY = "ZigBee USB Gateway";
46     public static final ThingTypeUID THING_TYPE_BUS_GATEWAY = new ThingTypeUID(BINDING_ID, "bus_gateway");
47     public static final String THING_LABEL_BUS_GATEWAY = "BUS Gateway";
48     // other thing types
49     // BUS
50     public static final ThingTypeUID THING_TYPE_BUS_ON_OFF_SWITCH = new ThingTypeUID(BINDING_ID, "bus_on_off_switch");
51     public static final String THING_LABEL_BUS_ON_OFF_SWITCH = "Switch";
52     public static final ThingTypeUID THING_TYPE_BUS_DIMMER = new ThingTypeUID(BINDING_ID, "bus_dimmer");
53     public static final String THING_LABEL_BUS_DIMMER = "Dimmer";
54     public static final ThingTypeUID THING_TYPE_BUS_AUTOMATION = new ThingTypeUID(BINDING_ID, "bus_automation");
55     public static final String THING_LABEL_BUS_AUTOMATION = "Automation";
56     public static final ThingTypeUID THING_TYPE_BUS_ENERGY_METER = new ThingTypeUID(BINDING_ID, "bus_energy_meter");
57     public static final String THING_LABEL_BUS_ENERGY_METER = "Energy Meter";
58     public static final ThingTypeUID THING_TYPE_BUS_THERMO_SENSOR = new ThingTypeUID(BINDING_ID, "bus_thermo_sensor");
59     public static final String THING_LABEL_BUS_THERMO_SENSOR = "Thermo Sensor";
60     public static final ThingTypeUID THING_TYPE_BUS_THERMO_ZONE = new ThingTypeUID(BINDING_ID, "bus_thermo_zone");
61     public static final String THING_LABEL_BUS_THERMO_ZONE = "Thermo Zone";
62     public static final ThingTypeUID THING_TYPE_BUS_CEN_SCENARIO_CONTROL = new ThingTypeUID(BINDING_ID,
63             "bus_cen_scenario_control");
64     public static final String THING_LABEL_BUS_CEN_SCENARIO_CONTROL = "CEN Control";
65     public static final ThingTypeUID THING_TYPE_BUS_CENPLUS_SCENARIO_CONTROL = new ThingTypeUID(BINDING_ID,
66             "bus_cenplus_scenario_control");
67     public static final String THING_LABEL_BUS_CENPLUS_SCENARIO_CONTROL = "CEN+ Control";
68
69     // ZIGBEE
70     public static final ThingTypeUID THING_TYPE_ZB_ON_OFF_SWITCH = new ThingTypeUID(BINDING_ID, "zb_on_off_switch");
71     public static final String THING_LABEL_ZB_ON_OFF_SWITCH = "ZigBee Switch";
72     public static final ThingTypeUID THING_TYPE_ZB_ON_OFF_SWITCH_2UNITS = new ThingTypeUID(BINDING_ID,
73             "zb_on_off_switch2u");
74     public static final String THING_LABEL_ZB_ON_OFF_SWITCH_2UNITS = "ZigBee 2-units Switch";
75     public static final ThingTypeUID THING_TYPE_ZB_DIMMER = new ThingTypeUID(BINDING_ID, "zb_dimmer");
76     public static final String THING_LABEL_ZB_DIMMER = "ZigBee Dimmer";
77     public static final ThingTypeUID THING_TYPE_ZB_AUTOMATION = new ThingTypeUID(BINDING_ID, "zb_automation");
78     public static final String THING_LABEL_ZB_AUTOMATION = "ZigBee Automation";
79
80     // #SUPPORTED THINGS SETS
81     // ## Generic
82     public static final Set<ThingTypeUID> GENERIC_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_GENERIC_DEVICE);
83     // ## Lighting
84     public static final Set<ThingTypeUID> LIGHTING_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_ZB_ON_OFF_SWITCH,
85             THING_TYPE_ZB_ON_OFF_SWITCH_2UNITS, THING_TYPE_ZB_DIMMER, THING_TYPE_BUS_ON_OFF_SWITCH,
86             THING_TYPE_BUS_DIMMER);
87     // ## Automation
88     public static final Set<ThingTypeUID> AUTOMATION_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_ZB_AUTOMATION,
89             THING_TYPE_BUS_AUTOMATION);
90     // ## Thermoregulation
91     public static final Set<ThingTypeUID> THERMOREGULATION_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_THERMO_ZONE,
92             THING_TYPE_BUS_THERMO_SENSOR);
93     // ## Energy Management
94     public static final Set<ThingTypeUID> ENERGY_MANAGEMENT_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_ENERGY_METER);
95     // ## CEN/CEN+ Scenario
96     public static final Set<ThingTypeUID> SCENARIO_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_CEN_SCENARIO_CONTROL,
97             THING_TYPE_BUS_CENPLUS_SCENARIO_CONTROL);
98     // ## Groups
99     public static final Set<ThingTypeUID> DEVICE_SUPPORTED_THING_TYPES = Stream
100             .of(LIGHTING_SUPPORTED_THING_TYPES, AUTOMATION_SUPPORTED_THING_TYPES,
101                     THERMOREGULATION_SUPPORTED_THING_TYPES, ENERGY_MANAGEMENT_SUPPORTED_THING_TYPES,
102                     SCENARIO_SUPPORTED_THING_TYPES, GENERIC_SUPPORTED_THING_TYPES)
103             .flatMap(Collection::stream).collect(Collectors.toCollection(HashSet::new));
104     public static final Set<ThingTypeUID> BRIDGE_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_ZB_GATEWAY,
105             THING_TYPE_BUS_GATEWAY);
106     public static final Set<ThingTypeUID> ALL_SUPPORTED_THING_TYPES = Stream
107             .of(DEVICE_SUPPORTED_THING_TYPES, BRIDGE_SUPPORTED_THING_TYPES).flatMap(Collection::stream)
108             .collect(Collectors.toCollection(HashSet::new));
109
110     // LIST OF ALL CHANNEL IDs
111     // lighting
112     public static final String CHANNEL_SWITCH = "switch";
113     public static final String CHANNEL_SWITCH_01 = "switch_01";
114     public static final String CHANNEL_SWITCH_02 = "switch_02";
115     public static final String CHANNEL_BRIGHTNESS = "brightness";
116     // automation
117     public static final String CHANNEL_SHUTTER = "shutter";
118     // thermo
119     public static final String CHANNEL_TEMPERATURE = "temperature";
120     public static final String CHANNEL_FUNCTION = "function";
121     public static final String CHANNEL_TEMP_SETPOINT = "setpointTemperature";
122     public static final String CHANNEL_MODE = "mode";
123     public static final String CHANNEL_FAN_SPEED = "speedFanCoil";
124     public static final String CHANNEL_CONDITIONING_VALVES = "conditioningValves";
125     public static final String CHANNEL_HEATING_VALVES = "heatingValves";
126     public static final String CHANNEL_ACTUATORS = "actuators";
127     // energy management
128     public static final String CHANNEL_POWER = "power";
129     // scenario button channels
130     public static final String CHANNEL_SCENARIO_BUTTON = "button#";
131     public static final String CHANNEL_TYPE_CEN_BUTTON_EVENT = "cenButtonEvent";
132     public static final String CHANNEL_TYPE_CEN_PLUS_BUTTON_EVENT = "cenPlusButtonEvent";
133
134     // devices config properties
135     public static final String CONFIG_PROPERTY_WHERE = "where";
136     public static final String CONFIG_PROPERTY_SHUTTER_RUN = "shutterRun";
137     public static final String CONFIG_PROPERTY_SCENARIO_BUTTONS = "buttons";
138     // BUS gw config properties
139     public static final String CONFIG_PROPERTY_HOST = "host";
140     public static final String CONFIG_PROPERTY_SERIAL_PORT = "serialPort";
141     // properties
142     public static final String PROPERTY_OWNID = "ownId";
143     public static final String PROPERTY_ZIGBEEID = "zigbeeid";
144     public static final String PROPERTY_FIRMWARE_VERSION = "firmwareVersion";
145     public static final String PROPERTY_MODEL = "model";
146     public static final String PROPERTY_SERIAL_NO = "serialNumber";
147 }