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.innogysmarthome.internal;
15 import java.util.Collections;
17 import java.util.stream.Collectors;
18 import java.util.stream.Stream;
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.openhab.core.thing.ThingTypeUID;
24 * The {@link InnogyBindingConstants} class defines common constants, which are
25 * used across the whole binding.
27 * @author Oliver Kuhl - Initial contribution
30 public class InnogyBindingConstants {
32 public static final String BINDING_ID = "innogysmarthome";
34 // brands and client ids
35 public static final String BRAND_INNOGY_SMARTHOME = "innogy_smarthome";
36 public static final String DEFAULT_BRAND = BRAND_INNOGY_SMARTHOME;
38 public static final String CLIENT_ID_INNOGY_SMARTHOME = "24635748";
39 public static final String CLIENT_SECRET_INNOGY_SMARTHOME = "no secret";
40 public static final String REDIRECT_URL_INNOGY_SMARTHOME = "https://www.openhab.org/oauth/innogy/innogy-smarthome.html";
42 public static final String CONFIG_AUTH_CODE = "authcode";
44 public static final long REINITIALIZE_DELAY_SECONDS = 30;
47 public static final String API_VERSION = "1.1";
48 public static final String WEBSOCKET_API_URL_EVENTS = "wss://api.services-smarthome.de/API/" + API_VERSION
49 + "/events?token={token}";
52 public static final String PROPERTY_ID = "id";
53 public static final String PROPERTY_VERSION = "Version";
54 public static final String PROPERTY_LOCATION = "Location";
55 public static final String PROPERTY_GEOLOCATION = "Geo Location";
56 public static final String PROPERTY_SOFTWARE_VERSION = "Software version";
57 public static final String PROPERTY_IP_ADDRESS = "IP address";
58 public static final String PROPERTY_REGISTRATION_TIME = "Registration Time";
59 public static final String PROPERTY_TIME_OF_ACCEPTANCE = "Time of acceptance";
60 public static final String PROPERTY_TIME_OF_DISCOVERY = "Time of discovery";
61 public static final String PROPERTY_BATTERY_POWERED = "Battery powered";
62 public static final String PROPERTY_DEVICE_TYPE = "Device Type";
63 public static final String PROPERTY_CONFIGURATION_STATE = "Configuration state";
64 public static final String PROPERTY_SHC_TYPE = "Controller Type";
65 public static final String PROPERTY_TIME_ZONE = "Time Zone";
66 public static final String PROPERTY_CURRENT_UTC_OFFSET = "Current UTC offset (minutes)";
67 public static final String PROPERTY_PROTOCOL_ID = "Protocol ID";
68 public static final String PROPERTY_BACKEND_CONNECTION_MONITORED = "Backend connection monitored";
69 public static final String PROPERTY_RFCOM_FAILURE_NOTIFICATION = "RFComm failure notification";
70 public static final String PROPERTY_DISPLAY_CURRENT_TEMPERATURE = "Display current temperature";
71 public static final String PROPERTY_METER_ID = "Meter ID";
72 public static final String PROPERTY_METER_FIRMWARE_VERSION = "Meter firmware version";
74 // List of main device types
75 public static final String DEVICE_SHC = "SHC"; // smarthome controller - the bridge
76 public static final String DEVICE_SHCA = "SHCA"; // smarthome controller version 2
77 public static final String DEVICE_PSS = "PSS"; // pluggable smart switch
78 public static final String DEVICE_PSSO = "PSSO"; // pluggable smart switch outdoor
79 public static final String DEVICE_BT_PSS = "BT-PSS"; // Bluetooth pluggable smart switch
80 public static final String DEVICE_VARIABLE_ACTUATOR = "VariableActuator";
81 public static final String DEVICE_RST = "RST"; // radiator mounted smart thermostat
82 public static final String DEVICE_RST2 = "RST2"; // radiator mounted smart thermostat (newer version)
83 public static final String DEVICE_WRT = "WRT"; // wall mounted room thermostat
84 public static final String DEVICE_WDS = "WDS"; // window door sensor
85 public static final String DEVICE_ISS2 = "ISS2"; // inwall smart switch
86 public static final String DEVICE_WSD = "WSD"; // wall mounted smoke detector
87 public static final String DEVICE_WSD2 = "WSD2"; // wall mounted smoke detector
88 public static final String DEVICE_WMD = "WMD"; // wall mounted motion detector indoor
89 public static final String DEVICE_WMDO = "WMDO"; // wall mounted motion detector outdoor
90 public static final String DEVICE_WSC2 = "WSC2"; // wall mounted smart controller (2 buttons)
91 public static final String DEVICE_BRC8 = "BRC8"; // basic remote controller (8 buttons)
92 public static final String DEVICE_ISC2 = "ISC2"; // in wall smart controller (2 buttons)
93 public static final String DEVICE_ISD2 = "ISD2"; // in wall smart dimmer (2 buttons)
94 public static final String DEVICE_ISR2 = "ISR2"; // in wall smart rollershutter (2 buttons)
95 public static final String DEVICE_PSD = "PSD"; // pluggable smart dimmer
96 public static final String DEVICE_ANALOG_METER = "AnalogMeter";
97 public static final String DEVICE_GENERATION_METER = "GenerationMeter";
98 public static final String DEVICE_SMART_METER = "SmartMeter";
99 public static final String DEVICE_TWO_WAY_METER = "TwoWayMeter";
101 public static final Set<String> SUPPORTED_DEVICES = Collections.unmodifiableSet(Stream
102 .of(DEVICE_SHC, DEVICE_SHCA, DEVICE_PSS, DEVICE_PSSO, DEVICE_BT_PSS, DEVICE_VARIABLE_ACTUATOR, DEVICE_RST,
103 DEVICE_RST2, DEVICE_WRT, DEVICE_WDS, DEVICE_ISS2, DEVICE_WSD, DEVICE_WSD2, DEVICE_WMD, DEVICE_WMDO,
104 DEVICE_WSC2, DEVICE_BRC8, DEVICE_ISC2, DEVICE_ISD2, DEVICE_ISR2, DEVICE_PSD, DEVICE_ANALOG_METER,
105 DEVICE_GENERATION_METER, DEVICE_SMART_METER, DEVICE_TWO_WAY_METER)
106 .collect(Collectors.toSet()));
108 public static final Set<String> BATTERY_POWERED_DEVICES = Collections
109 .unmodifiableSet(Stream.of(DEVICE_RST, DEVICE_RST2, DEVICE_WRT, DEVICE_WDS, DEVICE_WSD, DEVICE_WSD2,
110 DEVICE_WMD, DEVICE_WMDO, DEVICE_WSC2, DEVICE_BRC8).collect(Collectors.toSet()));
112 // List of all Thing Type UIDs
113 public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "bridge");
114 public static final ThingTypeUID THING_TYPE_PSS = new ThingTypeUID(BINDING_ID, DEVICE_PSS);
115 public static final ThingTypeUID THING_TYPE_PSSO = new ThingTypeUID(BINDING_ID, DEVICE_PSSO);
116 public static final ThingTypeUID THING_TYPE_BT_PSS = new ThingTypeUID(BINDING_ID, DEVICE_BT_PSS);
117 public static final ThingTypeUID THING_TYPE_VARIABLE_ACTUATOR = new ThingTypeUID(BINDING_ID,
118 DEVICE_VARIABLE_ACTUATOR);
119 public static final ThingTypeUID THING_TYPE_RST = new ThingTypeUID(BINDING_ID, DEVICE_RST);
120 public static final ThingTypeUID THING_TYPE_RST2 = new ThingTypeUID(BINDING_ID, DEVICE_RST2);
121 public static final ThingTypeUID THING_TYPE_WRT = new ThingTypeUID(BINDING_ID, DEVICE_WRT);
122 public static final ThingTypeUID THING_TYPE_WDS = new ThingTypeUID(BINDING_ID, DEVICE_WDS);
123 public static final ThingTypeUID THING_TYPE_ISS2 = new ThingTypeUID(BINDING_ID, DEVICE_ISS2);
124 public static final ThingTypeUID THING_TYPE_WSD = new ThingTypeUID(BINDING_ID, DEVICE_WSD);
125 public static final ThingTypeUID THING_TYPE_WSD2 = new ThingTypeUID(BINDING_ID, DEVICE_WSD2);
126 public static final ThingTypeUID THING_TYPE_WMD = new ThingTypeUID(BINDING_ID, DEVICE_WMD);
127 public static final ThingTypeUID THING_TYPE_WMDO = new ThingTypeUID(BINDING_ID, DEVICE_WMDO);
128 public static final ThingTypeUID THING_TYPE_WSC2 = new ThingTypeUID(BINDING_ID, DEVICE_WSC2);
129 public static final ThingTypeUID THING_TYPE_BRC8 = new ThingTypeUID(BINDING_ID, DEVICE_BRC8);
130 public static final ThingTypeUID THING_TYPE_ISC2 = new ThingTypeUID(BINDING_ID, DEVICE_ISC2);
131 public static final ThingTypeUID THING_TYPE_ISD2 = new ThingTypeUID(BINDING_ID, DEVICE_ISD2);
132 public static final ThingTypeUID THING_TYPE_ISR2 = new ThingTypeUID(BINDING_ID, DEVICE_ISR2);
133 public static final ThingTypeUID THING_TYPE_PSD = new ThingTypeUID(BINDING_ID, DEVICE_PSD);
134 public static final ThingTypeUID THING_TYPE_ANALOG_METER = new ThingTypeUID(BINDING_ID, DEVICE_ANALOG_METER);
135 public static final ThingTypeUID THING_TYPE_GENERATION_METER = new ThingTypeUID(BINDING_ID,
136 DEVICE_GENERATION_METER);
137 public static final ThingTypeUID THING_TYPE_SMART_METER = new ThingTypeUID(BINDING_ID, DEVICE_SMART_METER);
138 public static final ThingTypeUID THING_TYPE_TWO_WAY_METER = new ThingTypeUID(BINDING_ID, DEVICE_TWO_WAY_METER);
140 public static final Set<ThingTypeUID> SUPPORTED_DEVICE_THING_TYPES = Collections.unmodifiableSet(
141 Stream.of(THING_TYPE_PSS, THING_TYPE_PSSO, THING_TYPE_BT_PSS, THING_TYPE_VARIABLE_ACTUATOR, THING_TYPE_RST,
142 THING_TYPE_RST2, THING_TYPE_WRT, THING_TYPE_WDS, THING_TYPE_ISS2, THING_TYPE_WSD, THING_TYPE_WSD2,
143 THING_TYPE_WMD, THING_TYPE_WMDO, THING_TYPE_WSC2, THING_TYPE_BRC8, THING_TYPE_ISC2, THING_TYPE_ISD2,
144 THING_TYPE_ISR2, THING_TYPE_PSD, THING_TYPE_ANALOG_METER, THING_TYPE_GENERATION_METER,
145 THING_TYPE_SMART_METER, THING_TYPE_TWO_WAY_METER).collect(Collectors.toSet()));
147 // List of all Channel ids
148 public static final String CHANNEL_SWITCH = "switch";
149 public static final String CHANNEL_SET_TEMPERATURE = "set_temperature";
150 public static final String CHANNEL_TEMPERATURE = "temperature";
151 public static final String CHANNEL_HUMIDITY = "humidity";
152 public static final String CHANNEL_CONTACT = "contact";
153 public static final String CHANNEL_SMOKE = "smoke";
154 public static final String CHANNEL_ALARM = "alarm";
155 public static final String CHANNEL_MOTION_COUNT = "motion_count";
156 public static final String CHANNEL_LUMINANCE = "luminance";
157 public static final String CHANNEL_OPERATION_MODE = "operation_mode";
158 public static final String CHANNEL_FROST_WARNING = "frost_warning";
159 public static final String CHANNEL_MOLD_WARNING = "mold_warning";
160 public static final String CHANNEL_WINDOW_REDUCTION_ACTIVE = "window_reduction_active";
161 public static final String CHANNEL_BUTTON = "button";
162 public static final String CHANNEL_BUTTON_COUNT = "button%d_count";
163 public static final String CHANNEL_DIMMER = "dimmer";
164 public static final String CHANNEL_ROLLERSHUTTER = "rollershutter";
165 public static final String CHANNEL_BATTERY_LOW = "battery_low";
166 public static final String CHANNEL_ENERGY_CONSUMPTION_MONTH_KWH = "energy_consumption_month_kwh";
167 public static final String CHANNEL_ABOLUTE_ENERGY_CONSUMPTION = "absolute_energy_consumption";
168 public static final String CHANNEL_ENERGY_CONSUMPTION_MONTH_EURO = "energy_consumption_month_euro";
169 public static final String CHANNEL_ENERGY_CONSUMPTION_DAY_EURO = "energy_consumption_day_euro";
170 public static final String CHANNEL_ENERGY_CONSUMPTION_DAY_KWH = "energy_consumption_day_kwh";
171 public static final String CHANNEL_POWER_CONSUMPTION_WATT = "power_consumption_watt";
172 public static final String CHANNEL_ENERGY_GENERATION_MONTH_KWH = "energy_generation_month_kwh";
173 public static final String CHANNEL_TOTAL_ENERGY_GENERATION = "total_energy_generation";
174 public static final String CHANNEL_ENERGY_GENERATION_MONTH_EURO = "energy_generation_month_euro";
175 public static final String CHANNEL_ENERGY_GENERATION_DAY_EURO = "energy_generation_day_euro";
176 public static final String CHANNEL_ENERGY_GENERATION_DAY_KWH = "energy_generation_day_kwh";
177 public static final String CHANNEL_POWER_GENERATION_WATT = "power_generation_watt";
178 public static final String CHANNEL_ENERGY_MONTH_KWH = "energy_month_kwh";
179 public static final String CHANNEL_TOTAL_ENERGY = "total_energy";
180 public static final String CHANNEL_ENERGY_MONTH_EURO = "energy_month_euro";
181 public static final String CHANNEL_ENERGY_DAY_EURO = "energy_day_euro";
182 public static final String CHANNEL_ENERGY_DAY_KWH = "energy_day_kwh";
183 public static final String CHANNEL_ENERGY_FEED_MONTH_KWH = "energy_feed_month_kwh";
184 public static final String CHANNEL_TOTAL_ENERGY_FED = "total_energy_fed";
185 public static final String CHANNEL_ENERGY_FEED_MONTH_EURO = "energy_feed_month_euro";
186 public static final String CHANNEL_ENERGY_FEED_DAY_EURO = "energy_feed_day_euro";
187 public static final String CHANNEL_ENERGY_FEED_DAY_KWH = "energy_feed_day_kwh";
188 public static final String CHANNEL_POWER_WATT = "power_watt";
189 public static final String CHANNEL_CPU = "cpu";
190 public static final String CHANNEL_DISK = "disk";
191 public static final String CHANNEL_MEMORY = "memory";