2 * Copyright (c) 2010-2022 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.openwebnet.internal;
15 import java.util.Collection;
16 import java.util.HashSet;
18 import java.util.stream.Collectors;
19 import java.util.stream.Stream;
21 import org.eclipse.jdt.annotation.NonNullByDefault;
22 import org.openhab.core.thing.ThingTypeUID;
25 * The {@link OpenWebNetBindingConstants} class defines common constants, which are used across the whole binding.
27 * @author Massimo Valla - Initial contribution, updates
28 * @author Gilberto Cocchi - Thermoregulation
29 * @author Andrea Conte - Energy management, Thermoregulation
30 * @author Giovanni Fabiani - Aux support
34 public class OpenWebNetBindingConstants {
36 public static final String BINDING_ID = "openwebnet";
38 public static final int THING_STATE_REQ_TIMEOUT_SEC = 5;
40 // #LIST OF Thing Type UIDs
41 // generic device (used for not identified devices)
42 public static final ThingTypeUID THING_TYPE_GENERIC_DEVICE = new ThingTypeUID(BINDING_ID, "generic_device");
43 public static final String THING_LABEL_GENERIC_DEVICE = "GENERIC Device";
45 public static final ThingTypeUID THING_TYPE_ZB_GATEWAY = new ThingTypeUID(BINDING_ID, "zb_gateway");
46 public static final String THING_LABEL_ZB_GATEWAY = "ZigBee USB Gateway";
47 public static final ThingTypeUID THING_TYPE_BUS_GATEWAY = new ThingTypeUID(BINDING_ID, "bus_gateway");
48 public static final String THING_LABEL_BUS_GATEWAY = "BUS Gateway";
51 public static final ThingTypeUID THING_TYPE_BUS_ON_OFF_SWITCH = new ThingTypeUID(BINDING_ID, "bus_on_off_switch");
52 public static final String THING_LABEL_BUS_ON_OFF_SWITCH = "Switch";
53 public static final ThingTypeUID THING_TYPE_BUS_DIMMER = new ThingTypeUID(BINDING_ID, "bus_dimmer");
54 public static final String THING_LABEL_BUS_DIMMER = "Dimmer";
55 public static final ThingTypeUID THING_TYPE_BUS_AUTOMATION = new ThingTypeUID(BINDING_ID, "bus_automation");
56 public static final String THING_LABEL_BUS_AUTOMATION = "Automation";
57 public static final ThingTypeUID THING_TYPE_BUS_ENERGY_METER = new ThingTypeUID(BINDING_ID, "bus_energy_meter");
58 public static final String THING_LABEL_BUS_ENERGY_METER = "Energy Meter";
59 public static final ThingTypeUID THING_TYPE_BUS_THERMO_SENSOR = new ThingTypeUID(BINDING_ID, "bus_thermo_sensor");
60 public static final String THING_LABEL_BUS_THERMO_SENSOR = "Thermo Sensor";
61 public static final ThingTypeUID THING_TYPE_BUS_THERMO_ZONE = new ThingTypeUID(BINDING_ID, "bus_thermo_zone");
62 public static final String THING_LABEL_BUS_THERMO_ZONE = "Thermo Zone";
63 public static final ThingTypeUID THING_TYPE_BUS_THERMO_CU = new ThingTypeUID(BINDING_ID, "bus_thermo_cu");
64 public static final String THING_LABEL_BUS_THERMO_CU = "Thermo Central Unit";
65 public static final ThingTypeUID THING_TYPE_BUS_CEN_SCENARIO_CONTROL = new ThingTypeUID(BINDING_ID,
66 "bus_cen_scenario_control");
67 public static final String THING_LABEL_BUS_CEN_SCENARIO_CONTROL = "CEN Scenario Control";
68 public static final ThingTypeUID THING_TYPE_BUS_DRY_CONTACT_IR = new ThingTypeUID(BINDING_ID, "bus_dry_contact_ir");
69 public static final String THING_LABEL_BUS_DRY_CONTACT_IR = "Dry Contact/IR";
70 public static final ThingTypeUID THING_TYPE_BUS_CENPLUS_SCENARIO_CONTROL = new ThingTypeUID(BINDING_ID,
71 "bus_cenplus_scenario_control");
72 public static final String THING_LABEL_BUS_CENPLUS_SCENARIO_CONTROL = "CEN+ Scenario Control";
73 public static final ThingTypeUID THING_TYPE_BUS_SCENARIO = new ThingTypeUID(BINDING_ID, "bus_scenario_control");
74 public static final String THING_LABEL_BUS_SCENARIO = "Scenario Control";
75 public static final ThingTypeUID THING_TYPE_BUS_AUX = new ThingTypeUID(BINDING_ID, "bus_aux");
76 public static final String THING_LABEL_BUS_AUX = "Auxiliary";
78 public static final ThingTypeUID THING_TYPE_ZB_ON_OFF_SWITCH = new ThingTypeUID(BINDING_ID, "zb_on_off_switch");
79 public static final String THING_LABEL_ZB_ON_OFF_SWITCH = "ZigBee Switch";
80 public static final ThingTypeUID THING_TYPE_ZB_ON_OFF_SWITCH_2UNITS = new ThingTypeUID(BINDING_ID,
81 "zb_on_off_switch2u");
82 public static final String THING_LABEL_ZB_ON_OFF_SWITCH_2UNITS = "ZigBee 2-units Switch";
83 public static final ThingTypeUID THING_TYPE_ZB_DIMMER = new ThingTypeUID(BINDING_ID, "zb_dimmer");
84 public static final String THING_LABEL_ZB_DIMMER = "ZigBee Dimmer";
85 public static final ThingTypeUID THING_TYPE_ZB_AUTOMATION = new ThingTypeUID(BINDING_ID, "zb_automation");
86 public static final String THING_LABEL_ZB_AUTOMATION = "ZigBee Automation";
88 // #SUPPORTED THINGS SETS
90 public static final Set<ThingTypeUID> GENERIC_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_GENERIC_DEVICE);
92 public static final Set<ThingTypeUID> LIGHTING_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_ZB_ON_OFF_SWITCH,
93 THING_TYPE_ZB_ON_OFF_SWITCH_2UNITS, THING_TYPE_ZB_DIMMER, THING_TYPE_BUS_ON_OFF_SWITCH,
94 THING_TYPE_BUS_DIMMER);
96 public static final Set<ThingTypeUID> AUTOMATION_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_ZB_AUTOMATION,
97 THING_TYPE_BUS_AUTOMATION);
98 // ## Thermoregulation
99 public static final Set<ThingTypeUID> THERMOREGULATION_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_THERMO_ZONE,
100 THING_TYPE_BUS_THERMO_SENSOR, THING_TYPE_BUS_THERMO_CU);
101 // ## Energy Management
102 public static final Set<ThingTypeUID> ENERGY_MANAGEMENT_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_ENERGY_METER);
103 // ## CEN/CEN+ Scenario
104 public static final Set<ThingTypeUID> SCENARIO_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_CEN_SCENARIO_CONTROL,
105 THING_TYPE_BUS_CENPLUS_SCENARIO_CONTROL, THING_TYPE_BUS_DRY_CONTACT_IR);
107 public static final Set<ThingTypeUID> SCENARIO_BASIC_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_SCENARIO);
109 public static final Set<ThingTypeUID> AUX_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_AUX);
111 public static final Set<ThingTypeUID> DEVICE_SUPPORTED_THING_TYPES = Stream
112 .of(LIGHTING_SUPPORTED_THING_TYPES, AUTOMATION_SUPPORTED_THING_TYPES,
113 THERMOREGULATION_SUPPORTED_THING_TYPES, ENERGY_MANAGEMENT_SUPPORTED_THING_TYPES,
114 SCENARIO_SUPPORTED_THING_TYPES, SCENARIO_BASIC_SUPPORTED_THING_TYPES, AUX_SUPPORTED_THING_TYPES,
115 GENERIC_SUPPORTED_THING_TYPES)
116 .flatMap(Collection::stream).collect(Collectors.toCollection(HashSet::new));
117 public static final Set<ThingTypeUID> BRIDGE_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_ZB_GATEWAY,
118 THING_TYPE_BUS_GATEWAY);
119 public static final Set<ThingTypeUID> ALL_SUPPORTED_THING_TYPES = Stream
120 .of(DEVICE_SUPPORTED_THING_TYPES, BRIDGE_SUPPORTED_THING_TYPES).flatMap(Collection::stream)
121 .collect(Collectors.toCollection(HashSet::new));
123 // LIST OF ALL CHANNEL IDs
125 public static final String CHANNEL_SWITCH = "switch";
126 public static final String CHANNEL_SWITCH_01 = "switch_01";
127 public static final String CHANNEL_SWITCH_02 = "switch_02";
128 public static final String CHANNEL_BRIGHTNESS = "brightness";
130 public static final String CHANNEL_SHUTTER = "shutter";
132 public static final String CHANNEL_TEMPERATURE = "temperature";
133 public static final String CHANNEL_FUNCTION = "function";
134 public static final String CHANNEL_TEMP_SETPOINT = "setpointTemperature";
135 public static final String CHANNEL_MODE = "mode";
136 public static final String CHANNEL_FAN_SPEED = "speedFanCoil";
137 public static final String CHANNEL_CONDITIONING_VALVES = "conditioningValves";
138 public static final String CHANNEL_HEATING_VALVES = "heatingValves";
139 public static final String CHANNEL_ACTUATORS = "actuators";
140 public static final String CHANNEL_LOCAL_OFFSET = "localOffset";
141 public static final String CHANNEL_CU_REMOTE_CONTROL = "remoteControl";
142 public static final String CHANNEL_CU_BATTERY_STATUS = "batteryStatus";
143 public static final String CHANNEL_CU_WEEKLY_PROGRAM_NUMBER = "weeklyProgram";
144 public static final String CHANNEL_CU_SCENARIO_PROGRAM_NUMBER = "scenarioProgram";
145 public static final String CHANNEL_CU_FAILURE_DISCOVERED = "failureDiscovered";
146 public static final String CHANNEL_CU_AT_LEAST_ONE_PROBE_OFF = "atLeastOneProbeOff";
147 public static final String CHANNEL_CU_AT_LEAST_ONE_PROBE_PROTECTION = "atLeastOneProbeProtection";
148 public static final String CHANNEL_CU_AT_LEAST_ONE_PROBE_MANUAL = "atLeastOneProbeManual";
150 public static final String CHANNEL_POWER = "power";
151 // scenario button channels
152 public static final String CHANNEL_SCENARIO_BUTTON = "button#";
153 public static final String CHANNEL_TYPE_CEN_BUTTON_EVENT = "cenButtonEvent";
154 public static final String CHANNEL_TYPE_CEN_PLUS_BUTTON_EVENT = "cenPlusButtonEvent";
155 public static final String CHANNEL_DRY_CONTACT_IR = "sensor";
157 public static final String CHANNEL_SCENARIO = "scenario";
159 public static final String CHANNEL_AUX = "aux";
161 // devices config properties
162 public static final String CONFIG_PROPERTY_WHERE = "where";
163 public static final String CONFIG_PROPERTY_SHUTTER_RUN = "shutterRun";
164 public static final String CONFIG_PROPERTY_SCENARIO_BUTTONS = "buttons";
165 public static final String CONFIG_PROPERTY_STANDALONE = "standAlone";
167 // gw config properties
168 public static final String CONFIG_PROPERTY_HOST = "host";
169 public static final String CONFIG_PROPERTY_SERIAL_PORT = "serialPort";
171 public static final String PROPERTY_OWNID = "ownId";
172 public static final String PROPERTY_ZIGBEEID = "zigbeeid";
173 public static final String PROPERTY_FIRMWARE_VERSION = "firmwareVersion";
174 public static final String PROPERTY_MODEL = "model";
175 public static final String PROPERTY_SERIAL_NO = "serialNumber";