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.livisismarthome.internal;
16 import java.util.stream.Collectors;
17 import java.util.stream.Stream;
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.openhab.core.thing.ThingTypeUID;
23 * The {@link LivisiBindingConstants} class defines common constants, which are
24 * used across the whole binding.
26 * @author Oliver Kuhl - Initial contribution
27 * @author Sven Strohschein - Renamed from Innogy to Livisi
30 public class LivisiBindingConstants {
32 public static final String BINDING_ID = "livisismarthome";
34 public static final String USERNAME = "admin";
36 public static final long REINITIALIZE_DELAY_SECONDS = 30;
37 public static final long BRIDGE_REFRESH_SECONDS = 60;
40 public static final String PROPERTY_ID = "id";
41 public static final String PROPERTY_VERSION = "version";
42 public static final String PROPERTY_LOCATION = "location";
43 public static final String PROPERTY_GEOLOCATION = "geoLocation";
44 public static final String PROPERTY_SOFTWARE_VERSION = "softwareVersion";
45 public static final String PROPERTY_IP_ADDRESS = "ipAddress";
46 public static final String PROPERTY_REGISTRATION_TIME = "registrationTime";
47 public static final String PROPERTY_TIME_OF_ACCEPTANCE = "timeOfAcceptance";
48 public static final String PROPERTY_TIME_OF_DISCOVERY = "timeOfDiscovery";
49 public static final String PROPERTY_BATTERY_POWERED = "batteryPowered";
50 public static final String PROPERTY_DEVICE_TYPE = "deviceType";
51 public static final String PROPERTY_CONFIGURATION_STATE = "configurationState";
52 public static final String PROPERTY_SHC_TYPE = "controllerType";
53 public static final String PROPERTY_TIME_ZONE = "timeZone";
54 public static final String PROPERTY_CURRENT_UTC_OFFSET = "currentUtcOffsetInMinutes";
55 public static final String PROPERTY_PROTOCOL_ID = "protocolId";
56 public static final String PROPERTY_BACKEND_CONNECTION_MONITORED = "backendConnectionMonitored";
57 public static final String PROPERTY_RFCOM_FAILURE_NOTIFICATION = "rfcomFailureNotification";
58 public static final String PROPERTY_DISPLAY_CURRENT_TEMPERATURE = "displayCurrentTemperature";
59 public static final String PROPERTY_METER_ID = "meterId";
60 public static final String PROPERTY_METER_FIRMWARE_VERSION = "meterFirmwareVersion";
62 // List of main device types
63 public static final String DEVICE_SHC = "SHC"; // smarthome controller - the bridge
64 public static final String DEVICE_SHCA = "SHCA"; // smarthome controller version 2
65 public static final String DEVICE_PSS = "PSS"; // pluggable smart switch
66 public static final String DEVICE_PSSO = "PSSO"; // pluggable smart switch outdoor
67 public static final String DEVICE_BT_PSS = "BT-PSS"; // Bluetooth pluggable smart switch
68 public static final String DEVICE_VARIABLE_ACTUATOR = "VariableActuator";
69 public static final String DEVICE_RST = "RST"; // radiator mounted smart thermostat
70 public static final String DEVICE_RST2 = "RST2"; // radiator mounted smart thermostat (newer version)
71 public static final String DEVICE_WRT = "WRT"; // wall mounted room thermostat
72 public static final String DEVICE_WDS = "WDS"; // window door sensor
73 public static final String DEVICE_ISS2 = "ISS2"; // inwall smart switch
74 public static final String DEVICE_WSD = "WSD"; // wall mounted smoke detector
75 public static final String DEVICE_WSD2 = "WSD2"; // wall mounted smoke detector
76 public static final String DEVICE_WMD = "WMD"; // wall mounted motion detector indoor
77 public static final String DEVICE_WMDO = "WMDO"; // wall mounted motion detector outdoor
78 public static final String DEVICE_WSC2 = "WSC2"; // wall mounted smart controller (2 buttons)
79 public static final String DEVICE_BRC8 = "BRC8"; // basic remote controller (8 buttons)
80 public static final String DEVICE_ISC2 = "ISC2"; // in wall smart controller (2 buttons)
81 public static final String DEVICE_ISD2 = "ISD2"; // in wall smart dimmer (2 buttons)
82 public static final String DEVICE_ISR2 = "ISR2"; // in wall smart rollershutter (2 buttons)
83 public static final String DEVICE_PSD = "PSD"; // pluggable smart dimmer
84 public static final String DEVICE_ANALOG_METER = "AnalogMeter";
85 public static final String DEVICE_GENERATION_METER = "GenerationMeter";
86 public static final String DEVICE_SMART_METER = "SmartMeter";
87 public static final String DEVICE_TWO_WAY_METER = "TwoWayMeter";
89 public static final Set<String> SUPPORTED_DEVICES = Set.of(DEVICE_SHC, DEVICE_SHCA, DEVICE_PSS, DEVICE_PSSO,
90 DEVICE_BT_PSS, DEVICE_VARIABLE_ACTUATOR, DEVICE_RST, DEVICE_RST2, DEVICE_WRT, DEVICE_WDS, DEVICE_ISS2,
91 DEVICE_WSD, DEVICE_WSD2, DEVICE_WMD, DEVICE_WMDO, DEVICE_WSC2, DEVICE_BRC8, DEVICE_ISC2, DEVICE_ISD2,
92 DEVICE_ISR2, DEVICE_PSD, DEVICE_ANALOG_METER, DEVICE_GENERATION_METER, DEVICE_SMART_METER,
93 DEVICE_TWO_WAY_METER);
95 public static final Set<String> BATTERY_POWERED_DEVICES = Set.of(DEVICE_ISC2, DEVICE_RST, DEVICE_RST2, DEVICE_WRT,
96 DEVICE_WDS, DEVICE_WSD, DEVICE_WSD2, DEVICE_WMD, DEVICE_WMDO, DEVICE_WSC2, DEVICE_BRC8);
98 // List of all Thing Type UIDs
99 public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "bridge");
100 public static final ThingTypeUID THING_TYPE_PSS = new ThingTypeUID(BINDING_ID, DEVICE_PSS);
101 public static final ThingTypeUID THING_TYPE_PSSO = new ThingTypeUID(BINDING_ID, DEVICE_PSSO);
102 public static final ThingTypeUID THING_TYPE_BT_PSS = new ThingTypeUID(BINDING_ID, DEVICE_BT_PSS);
103 public static final ThingTypeUID THING_TYPE_VARIABLE_ACTUATOR = new ThingTypeUID(BINDING_ID,
104 DEVICE_VARIABLE_ACTUATOR);
105 public static final ThingTypeUID THING_TYPE_RST = new ThingTypeUID(BINDING_ID, DEVICE_RST);
106 public static final ThingTypeUID THING_TYPE_RST2 = new ThingTypeUID(BINDING_ID, DEVICE_RST2);
107 public static final ThingTypeUID THING_TYPE_WRT = new ThingTypeUID(BINDING_ID, DEVICE_WRT);
108 public static final ThingTypeUID THING_TYPE_WDS = new ThingTypeUID(BINDING_ID, DEVICE_WDS);
109 public static final ThingTypeUID THING_TYPE_ISS2 = new ThingTypeUID(BINDING_ID, DEVICE_ISS2);
110 public static final ThingTypeUID THING_TYPE_WSD = new ThingTypeUID(BINDING_ID, DEVICE_WSD);
111 public static final ThingTypeUID THING_TYPE_WSD2 = new ThingTypeUID(BINDING_ID, DEVICE_WSD2);
112 public static final ThingTypeUID THING_TYPE_WMD = new ThingTypeUID(BINDING_ID, DEVICE_WMD);
113 public static final ThingTypeUID THING_TYPE_WMDO = new ThingTypeUID(BINDING_ID, DEVICE_WMDO);
114 public static final ThingTypeUID THING_TYPE_WSC2 = new ThingTypeUID(BINDING_ID, DEVICE_WSC2);
115 public static final ThingTypeUID THING_TYPE_BRC8 = new ThingTypeUID(BINDING_ID, DEVICE_BRC8);
116 public static final ThingTypeUID THING_TYPE_ISC2 = new ThingTypeUID(BINDING_ID, DEVICE_ISC2);
117 public static final ThingTypeUID THING_TYPE_ISD2 = new ThingTypeUID(BINDING_ID, DEVICE_ISD2);
118 public static final ThingTypeUID THING_TYPE_ISR2 = new ThingTypeUID(BINDING_ID, DEVICE_ISR2);
119 public static final ThingTypeUID THING_TYPE_PSD = new ThingTypeUID(BINDING_ID, DEVICE_PSD);
120 public static final ThingTypeUID THING_TYPE_ANALOG_METER = new ThingTypeUID(BINDING_ID, DEVICE_ANALOG_METER);
121 public static final ThingTypeUID THING_TYPE_GENERATION_METER = new ThingTypeUID(BINDING_ID,
122 DEVICE_GENERATION_METER);
123 public static final ThingTypeUID THING_TYPE_SMART_METER = new ThingTypeUID(BINDING_ID, DEVICE_SMART_METER);
124 public static final ThingTypeUID THING_TYPE_TWO_WAY_METER = new ThingTypeUID(BINDING_ID, DEVICE_TWO_WAY_METER);
126 public static final Set<ThingTypeUID> SUPPORTED_DEVICE_THING_TYPES = Set.of(THING_TYPE_PSS, THING_TYPE_PSSO,
127 THING_TYPE_BT_PSS, THING_TYPE_VARIABLE_ACTUATOR, THING_TYPE_RST, THING_TYPE_RST2, THING_TYPE_WRT,
128 THING_TYPE_WDS, THING_TYPE_ISS2, THING_TYPE_WSD, THING_TYPE_WSD2, THING_TYPE_WMD, THING_TYPE_WMDO,
129 THING_TYPE_WSC2, THING_TYPE_BRC8, THING_TYPE_ISC2, THING_TYPE_ISD2, THING_TYPE_ISR2, THING_TYPE_PSD,
130 THING_TYPE_ANALOG_METER, THING_TYPE_GENERATION_METER, THING_TYPE_SMART_METER, THING_TYPE_TWO_WAY_METER);
132 public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Stream
133 .concat(Stream.of(THING_TYPE_BRIDGE), SUPPORTED_DEVICE_THING_TYPES.stream()).collect(Collectors.toSet());
135 // List of all Channel ids
136 public static final String CHANNEL_SWITCH = "switch";
137 public static final String CHANNEL_TARGET_TEMPERATURE = "targetTemperature";
138 public static final String CHANNEL_CURRENT_TEMPERATURE = "currentTemperature";
139 public static final String CHANNEL_HUMIDITY = "humidity";
140 public static final String CHANNEL_CONTACT = "contact";
141 public static final String CHANNEL_SMOKE = "smoke";
142 public static final String CHANNEL_ALARM = "alarm";
143 public static final String CHANNEL_MOTION_COUNT = "motionCount";
144 public static final String CHANNEL_LUMINANCE = "luminance";
145 public static final String CHANNEL_OPERATION_MODE = "operationMode";
146 public static final String CHANNEL_FROST_WARNING = "frostWarning";
147 public static final String CHANNEL_MOLD_WARNING = "moldWarning";
148 public static final String CHANNEL_WINDOW_REDUCTION_ACTIVE = "windowReductionActive";
149 public static final String CHANNEL_BUTTON = "button";
150 public static final String CHANNEL_BUTTON_COUNT = "button%dCount";
151 public static final String CHANNEL_DIMMER = "dimmer";
152 public static final String CHANNEL_ROLLERSHUTTER = "rollershutter";
153 public static final String CHANNEL_BATTERY_LOW = "batteryLow";
154 public static final String CHANNEL_ENERGY_CONSUMPTION_MONTH_KWH = "energyConsumptionMonthKwh";
155 public static final String CHANNEL_ABOLUTE_ENERGY_CONSUMPTION = "absoluteEnergyConsumption";
156 public static final String CHANNEL_ENERGY_CONSUMPTION_MONTH_EURO = "energyConsumptionMonthEuro";
157 public static final String CHANNEL_ENERGY_CONSUMPTION_DAY_EURO = "energyConsumptionDayEuro";
158 public static final String CHANNEL_ENERGY_CONSUMPTION_DAY_KWH = "energyConsumptionDayKwh";
159 public static final String CHANNEL_POWER_CONSUMPTION_WATT = "powerConsumptionWatt";
160 public static final String CHANNEL_ENERGY_GENERATION_MONTH_KWH = "energyGenerationMonthKwh";
161 public static final String CHANNEL_TOTAL_ENERGY_GENERATION = "totalEnergyGeneration";
162 public static final String CHANNEL_ENERGY_GENERATION_MONTH_EURO = "energyGenerationMonthEuro";
163 public static final String CHANNEL_ENERGY_GENERATION_DAY_EURO = "energyGenerationDayEuro";
164 public static final String CHANNEL_ENERGY_GENERATION_DAY_KWH = "energyGenerationDayKwh";
165 public static final String CHANNEL_POWER_GENERATION_WATT = "powerGenerationWatt";
166 public static final String CHANNEL_ENERGY_MONTH_KWH = "energyMonthKwh";
167 public static final String CHANNEL_TOTAL_ENERGY = "totalEnergy";
168 public static final String CHANNEL_ENERGY_MONTH_EURO = "energyMonthEuro";
169 public static final String CHANNEL_ENERGY_DAY_EURO = "energyDayEuro";
170 public static final String CHANNEL_ENERGY_DAY_KWH = "energyDayKwh";
171 public static final String CHANNEL_ENERGY_FEED_MONTH_KWH = "energyFeedMonthKwh";
172 public static final String CHANNEL_TOTAL_ENERGY_FED = "totalEnergyFed";
173 public static final String CHANNEL_ENERGY_FEED_MONTH_EURO = "energyFeedMonthEuro";
174 public static final String CHANNEL_ENERGY_FEED_DAY_EURO = "energyFeedDayEuro";
175 public static final String CHANNEL_ENERGY_FEED_DAY_KWH = "energyFeedDayKwh";
176 public static final String CHANNEL_POWER_WATT = "powerWatt";
177 public static final String CHANNEL_CPU = "cpu";
178 public static final String CHANNEL_DISK = "disk";
179 public static final String CHANNEL_MEMORY = "memory";
180 public static final String CHANNEL_OPERATION_STATUS = "status";
182 // List of channel parameters
183 public static final String INVERT_CHANNEL_PARAMETER = "invert";