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.digitalstrom.internal.lib.serverconnection;
15 import java.util.List;
18 import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.BaseSensorValues;
19 import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.AssignedSensors;
20 import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.SensorValues;
21 import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.TemperatureControlConfig;
22 import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.TemperatureControlInternals;
23 import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.TemperatureControlStatus;
24 import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.TemperatureControlValues;
25 import org.openhab.binding.digitalstrom.internal.lib.structure.Apartment;
26 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.Circuit;
27 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.Device;
28 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.CachedMeteringValue;
29 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.DeviceConfig;
30 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.DeviceSceneSpec;
31 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.DeviceParameterClassEnum;
32 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.MeteringTypeEnum;
33 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.MeteringUnitsEnum;
34 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.SensorEnum;
35 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DSID;
36 import org.openhab.binding.digitalstrom.internal.lib.structure.scene.constants.Scene;
37 import org.openhab.binding.digitalstrom.internal.lib.structure.scene.constants.SceneEnum;
39 import com.google.gson.JsonArray;
40 import com.google.gson.JsonObject;
43 * digitalSTROM-API based on dSS-Version higher then 1.14.5.
44 * digitalSTROM documentation can be found at http://developer.digitalstrom.org/Architecture/v1.1/dss-json.pdf
46 * @author Alexander Betker - Initial contribution
48 * @author Michael Ochel - add missing java-doc, update digitalSTROM-JSON-API as far as possible to the pdf version from
49 * June 19, 2014 and add checkConnection method and ALL_METERS constant
50 * @author Matthias Siegele - add missing java-doc, update digitalSTROM-JSON-API as far as possible to the pdf version
51 * from June 19, 2014 and add checkConnection method and ALL_METERS constant
53 public interface DsAPI {
56 * Meter field to get all meters by calling {@link #getLatest(String, MeteringTypeEnum, String, MeteringUnitsEnum)}.
57 * It has to be set by meterDSIDs.
59 static final String ALL_METERS = ".meters(all)";
62 * Calls the scene sceneNumber on all devices of the apartment. If groupID
63 * or groupName are specified. Only devices contained in this group will be
66 * @param sessionToken can be null, if a
67 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
68 * registered at the {@link HttpTransport}
69 * @param groupID not required
70 * @param groupName not required
71 * @param sceneNumber required
72 * @param force not required
73 * @return true, if successful
75 boolean callApartmentScene(String sessionToken, Short groupID, String groupName, Scene sceneNumber, Boolean force);
80 * @param sessionToken can be null, if a
81 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
82 * registered at the {@link HttpTransport}
85 Apartment getApartmentStructure(String sessionToken);
88 * Returns the list of devices in the apartment. If unassigned is true,
89 * only devices that are not assigned to a zone will be returned.
91 * @param sessionToken can be null, if a
92 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
93 * registered at the {@link HttpTransport}
94 * @return List of devices
96 List<Device> getApartmentDevices(String sessionToken);
99 * Returns an array containing all digitalSTROM-Meters of the apartment.
101 * @param sessionToken can be null, if a
102 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
103 * registered at the {@link HttpTransport}
104 * @return List of all {@link Circuit}s
106 List<Circuit> getApartmentCircuits(String sessionToken);
109 * Returns a list of dSID's of all meters(dSMs)
111 * @param sessionToken can be null, if a
112 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
113 * registered at the {@link HttpTransport}
114 * @return String-List with dSID's
116 List<String> getMeterList(String sessionToken);
119 * Calls the sceneNumber on all devices in the given zone. If groupID or groupName
120 * are specified only devices contained in this group will be addressed.
122 * @param sessionToken can be null, if a
123 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
124 * registered at the {@link HttpTransport}
125 * @param zoneID needs either id or name
126 * @param zoneName needs either id or name
127 * @param groupID not required
128 * @param groupName not required
129 * @param sceneNumber required (only a zone/user scene is possible - sceneNumber 0..63 )
130 * @param force not required
131 * @return true on success
133 boolean callZoneScene(String sessionToken, Integer zoneID, String zoneName, Short groupID, String groupName,
134 SceneEnum sceneNumber, Boolean force);
137 * Turns the device on. This will call the scene "max" on the device.
139 * @param sessionToken can be null, if a
140 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
141 * registered at the {@link HttpTransport}
142 * @param dSID needs either dSID, dSUID or name
143 * @param dSUID needs either dSID, dSUID or name
144 * @param deviceName needs either dSID, dsUID or name
145 * @return true, if successful
147 boolean turnDeviceOn(String sessionToken, DSID dSID, String dSUID, String deviceName);
150 * Turns the device off. This will call the scene "min" on the device.
152 * @param sessionToken can be null, if a
153 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
154 * registered at the {@link HttpTransport}
155 * @param dSID needs either dSID, dSUID or name
156 * @param dSUID needs either dSID, dSUID or name
157 * @param deviceName needs either dSID, dsUID or name
158 * @return true, if successful
160 boolean turnDeviceOff(String sessionToken, DSID dSID, String dSUID, String deviceName);
163 * Sets the output value of device.
165 * @param sessionToken can be null, if a
166 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
167 * registered at the {@link HttpTransport}
168 * @param dSID needs either dSID, dSUID or name
169 * @param dSUID needs either dSID, dSUID or name
170 * @param deviceName needs either dSID, dsUID or name
171 * @param value required (0 - 255)
172 * @return true, if successful
174 boolean setDeviceValue(String sessionToken, DSID dSID, String dSUID, String deviceName, Integer value);
177 * Gets the value of configuration class at offset index.
179 * @param sessionToken can be null, if a
180 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
181 * registered at the {@link HttpTransport}
182 * @param dSID needs either dSID, dSUID or name
183 * @param dSUID needs either dSID, dSUID or name
184 * @param deviceName needs either dSID, dsUID or name
185 * @param clazz required
186 * @param index required
187 * @return config with values
189 DeviceConfig getDeviceConfig(String sessionToken, DSID dSID, String dSUID, String deviceName,
190 DeviceParameterClassEnum clazz, Integer index);
193 * Gets the device output value from parameter at the given offset.
194 * The available parameters and offsets depend on the features of the
195 * hardware components.
197 * @param sessionToken can be null, if a
198 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
199 * registered at the {@link HttpTransport}
200 * @param dSID needs either dSID, dSUID or name
201 * @param dSUID needs either dSID, dSUID or name
202 * @param deviceName needs either dSID, dsUID or name
203 * @param offset required (known offset e.g. 0)
204 * @return current device output value or -1, if the request was not successful
206 int getDeviceOutputValue(String sessionToken, DSID dSID, String dSUID, String deviceName, Short offset);
209 * Sets the device output value at the given offset. The available
210 * parameters and offsets depend on the features of the hardware components.
212 * @param sessionToken can be null, if a
213 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
214 * registered at the {@link HttpTransport}
215 * @param dSID needs either dSID, dSUID or name
216 * @param dSUID needs either dSID, dSUID or name
217 * @param deviceName needs either dSID, dsUID or name
218 * @param offset required
219 * @param value required (0 - 65535)
220 * @return true, if successful
222 boolean setDeviceOutputValue(String sessionToken, DSID dSID, String dSUID, String deviceName, Short offset,
226 * Gets the device configuration for a specific scene command.
228 * @param sessionToken can be null, if a
229 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
230 * registered at the {@link HttpTransport}
231 * @param dSID needs either dSID, dSUID or name
232 * @param dSUID needs either dSID, dSUID or name
233 * @param deviceName needs either dSID, dsUID or name
234 * @param sceneID required (0 .. 255)
235 * @return scene configuration
237 DeviceSceneSpec getDeviceSceneMode(String sessionToken, DSID dSID, String dSUID, String deviceName, Short sceneID);
240 * Requests the sensor value for a given index.
242 * @param sessionToken can be null, if a
243 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
244 * registered at the {@link HttpTransport}
245 * @param dSID needs either dSID, dSUID or name
246 * @param dSUID needs either dSID, dSUID or name
247 * @param deviceName needs either dSID, dsUID or name
248 * @param sensorIndex required
249 * @return sensor value
251 short getDeviceSensorValue(String sessionToken, DSID dSID, String dSUID, String deviceName, Short sensorIndex);
254 * Calls scene sceneNumber on the device.
256 * @param sessionToken can be null, if a
257 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
258 * registered at the {@link HttpTransport}
259 * @param dSID needs either dSID, dSUID or name
260 * @param dSUID needs either dSID, dSUID or name
261 * @param deviceName needs either dSID, dsUID or name
262 * @param sceneNumber required
263 * @param force not required
264 * @return true, if successful
266 boolean callDeviceScene(String sessionToken, DSID dSID, String dSUID, String deviceName, Scene sceneNumber,
270 * Subscribes to an event given by the name. The subscriptionID is a unique id
271 * that is defined by the subscriber. It is possible to subscribe to several events,
272 * using the same subscription id, this allows to retrieve a grouped output of the
273 * events (i.e. get output of all subscribed by the given id).
275 * @param sessionToken can be null, if a
276 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
277 * registered at the {@link HttpTransport}
278 * @param eventName required
279 * @param subscriptionID required
280 * @param connectionTimeout to set
281 * @param readTimeout to set
282 * @return true on success
284 boolean subscribeEvent(String sessionToken, String eventName, Integer subscriptionID, int connectionTimeout,
288 * Unsubscribes from an event given by the name. The subscriptionID is a unique
289 * id that was used in the subscribe call.
291 * @param sessionToken can be null, if a
292 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
293 * registered at the {@link HttpTransport}
294 * @param eventName required
295 * @param subscriptionID required
296 * @param connectionTimeout to set
297 * @param readTimeout to set
298 * @return true on success
300 boolean unsubscribeEvent(String sessionToken, String eventName, Integer subscriptionID, int connectionTimeout,
304 * Gets event information and output. The subscriptionID is a unique id
305 * that was used in the subscribe call. All events, subscribed with the
306 * given id will be handled by this call. A timeout, in case no events
307 * are taken place, can be specified (in ms). By default the timeout
308 * is disabled: 0 (zero), if no events occur the call will block.
310 * @param sessionToken can be null, if a
311 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
312 * registered at the {@link HttpTransport}
313 * @param subscriptionID required
314 * @param timeout optional
315 * @return Event-String
317 String getEvent(String sessionToken, Integer subscriptionID, Integer timeout);
320 * Returns the dSS time in UTC seconds since epoch.
322 * @param sessionToken can be null, if a
323 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
324 * registered at the {@link HttpTransport}
327 int getTime(String sessionToken);
330 * <b>Description partially taken form digitalSTROM JSON-API:</b><br>
331 * Returns the version of the digitalSTROM-Server software version as {@link Map}.<br>
333 * <b>Key, value:</b><br>
335 * <li><b>version</b> the dSS application version</li>
336 * <li><b>distroVersion</b> the host platform firmware release (since v1.10)</li>
337 * <li><b>Hardware</b> the host platform hardware identifier (since v1.10)</li>
338 * <li><b>Revision</b> the host platform hardware revision number (since v1.10)</li>
339 * <li><b>Serial</b> the host platform hardware serial number (since v1.10)</li>
340 * <li><b>Ethernet</b> the host platform IEEE Mac address (since v1.10)</li>
341 * <li><b>MachineID</b> the host system unique id (since v1.10)</li>
342 * <li><b>Kernel</b> the host system Linux kernel release string (since v1.10)</li>
345 * @return the digitalSTROM-Server software version
347 Map<String, String> getSystemVersion();
350 * Creates a new session using the registered application token
352 * @param applicationToken required
353 * @return sessionToken
355 String loginApplication(String applicationToken);
358 * Creates a new session.
360 * @param user required
361 * @param password required
362 * @return new session token
364 String login(String user, String password);
367 * Destroys the session and signs out the user
369 * @return true, if logout was successful, otherwise false
374 * Returns the dSID of the digitalSTROM Server.
376 * @param sessionToken can be null, if a
377 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
378 * registered at the {@link HttpTransport}
381 Map<String, String> getDSID(String sessionToken);
384 * Returns a token for passwordless login. The token will need to be approved
385 * by a user first, the caller must not be logged in.
387 * @param applicationName required
388 * @return applicationToken
390 String requestAppplicationToken(String applicationName);
393 * Revokes an application token, caller must be logged in.
395 * @param sessionToken can be null, if a
396 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
397 * registered at the {@link HttpTransport}
398 * @param applicationToken to login
399 * @return true, if successful, otherwise false
401 boolean revokeToken(String applicationToken, String sessionToken);
404 * Enables an application token, caller must be logged in.
406 * @param sessionToken can be null, if a
407 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
408 * registered at the {@link HttpTransport}
409 * @param applicationToken required
410 * @return true, if successful, otherwise false
412 boolean enableApplicationToken(String applicationToken, String sessionToken);
415 * Returns all resolutions stored on this dSS
417 * @param sessionToken can be null, if a
418 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
419 * registered at the {@link HttpTransport}
420 * @return List of resolutions
422 List<Integer> getResolutions(String sessionToken);
425 * Returns cached energy meter value or cached power consumption
426 * value in watt (W). The type parameter defines what should
427 * be returned, valid types, 'energyDelta' are 'energy' and
428 * 'consumption' you can also see at {@link MeteringTypeEnum}. 'energy' and 'energyDelta' are available in two
429 * units: 'Wh' (default) and 'Ws' you can also see at {@link MeteringUnitsEnum}. The meterDSIDs parameter follows
431 * set-syntax, currently it supports: .meters(dsid1,dsid2,...) and .meters(all)
433 * @param sessionToken can be null, if a
434 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
435 * registered at the {@link HttpTransport}
436 * @param type required
437 * @param meterDSIDs required
438 * @param unit optional
439 * @return cached metering values
441 List<CachedMeteringValue> getLatest(String sessionToken, MeteringTypeEnum type, String meterDSIDs,
442 MeteringUnitsEnum unit);
445 * Returns cached energy meter value or cached power consumption
446 * value in watt (W). The type parameter defines what should
447 * be returned, valid types, 'energyDelta' are 'energy' and
448 * 'consumption' you can also see at {@link MeteringTypeEnum}. 'energy' and 'energyDelta' are available in two
449 * units: 'Wh' (default) and 'Ws' you can also see at {@link MeteringUnitsEnum}. <br>
450 * The meterDSIDs parameter you can directly pass a {@link List} of the digitalSTROM-Meter dSID's as {@link String}.
452 * @param sessionToken can be null, if a
453 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
454 * registered at the {@link HttpTransport}
455 * @param type required
456 * @param meterDSIDs required
457 * @param unit optional
458 * @return cached metering values
460 List<CachedMeteringValue> getLatest(String sessionToken, MeteringTypeEnum type, List<String> meterDSIDs,
461 MeteringUnitsEnum unit);
464 * Checks the connection and returns the HTTP-Status-Code.
466 * @param sessionToken can be null, if a
467 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
468 * registered at the {@link HttpTransport}
469 * @return HTTP-Status-Code
471 int checkConnection(String sessionToken);
474 * Returns the configured scene output value for the given sceneId of the digitalSTROM-Device with the given dSID.
476 * At array position 0 is the output value and at position 1 the angle value, if the device is a blind.
478 * @param sessionToken can be null, if a
479 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
480 * registered at the {@link HttpTransport}
481 * @param dSID needs either dSID, dSUID or name
482 * @param dSUID needs either dSID, dSUID or name
483 * @param deviceName needs either dSID, dsUID or name
484 * @param sceneId required
485 * @return scene value at array position 0 and angle at position 1
487 int[] getSceneValue(String sessionToken, DSID dSID, String dSUID, String deviceName, Short sceneId);
490 * Calls the INC scene on the digitalSTROM-Device with the given dSID and returns true if the request was success.
492 * @param sessionToken can be null, if a
493 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
494 * registered at the {@link HttpTransport}
495 * @param dSID needs either dSID, dSUID or name
496 * @param dSUID needs either dSID, dSUID or name
497 * @param deviceName needs either dSID, dsUID or name
498 * @return success true otherwise false
500 boolean increaseValue(String sessionToken, DSID dSID, String dSUID, String deviceName);
503 * Calls the DEC scene on the digitalSTROM-Device with the given dSID and returns true if the request was
506 * @param sessionToken can be null, if a
507 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
508 * registered at the {@link HttpTransport}
509 * @param dSID needs either dSID, dSUID or name
510 * @param dSUID needs either dSID, dSUID or name
511 * @param deviceName needs either dSID, dsUID or name
512 * @return success true otherwise false
514 boolean decreaseValue(String sessionToken, DSID dSID, String dSUID, String deviceName);
517 * Undos the given sceneNumer of the digitalSTROM-Device with the given dSID and returns true if the request was
520 * @param sessionToken can be null, if a
521 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
522 * registered at the {@link HttpTransport}
523 * @param dSID needs either dSID, dSUID or name
524 * @param dSUID needs either dSID, dSUID or name
525 * @param deviceName needs either dSID, dsUID or name
526 * @param sceneNumber required
527 * @return success true otherwise false
529 boolean undoDeviceScene(String sessionToken, DSID dSID, String dSUID, String deviceName, Scene sceneNumber);
532 * Undo the given sceneNumer on the digitalSTROM apartment-group with the given groupID or groupName and returns
534 * if the request was successful.
536 * @param sessionToken can be null, if a
537 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
538 * registered at the {@link HttpTransport}
539 * @param groupID needs either groupID or groupName
540 * @param groupName needs either groupID or groupName
541 * @param sceneNumber required
542 * @return success true otherwise false
544 boolean undoApartmentScene(String sessionToken, Short groupID, String groupName, Scene sceneNumber);
547 * Undo the given sceneNumer on the digitalSTROM zone-group with the given zoneID or zoneName and groupID or
548 * groupName and returns true if the request was successful.
550 * @param sessionToken can be null, if a
551 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
552 * registered at the {@link HttpTransport}
553 * @param zoneID needs either zoneID or zoneName
554 * @param zoneName needs either zoneID or zoneName
555 * @param groupID needs either groupID or groupName
556 * @param groupName needs either groupID or groupName
557 * @param sceneNumber required
558 * @return success true otherwise false
560 boolean undoZoneScene(String sessionToken, Integer zoneID, String zoneName, Short groupID, String groupName,
561 SceneEnum sceneNumber);
564 * Returns user defined name of the digitalSTROM installation.
566 * @param sessionToken can be null, if a
567 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
568 * registered at the {@link HttpTransport}
569 * @return name of the digitalSTROM installation
571 String getInstallationName(String sessionToken);
574 * Returns user defined name of the zone from the given zone id.
576 * @param sessionToken can be null, if a
577 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
578 * registered at the {@link HttpTransport}
579 * @param zoneID required
580 * @return name of the given zone id
582 String getZoneName(String sessionToken, Integer zoneID);
585 * Returns user defined name of the device from the given dSID
587 * @param sessionToken can be null, if a
588 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
589 * registered at the {@link HttpTransport}
590 * @param dSID needs either dSID or dSUID
591 * @param dSUID needs either dSID or dSUID
592 * @return name of the device with the given dSID or dSUID
594 String getDeviceName(String sessionToken, DSID dSID, String dSUID);
597 * Returns user defined name of the circuit from the given dSID.
599 * @param sessionToken can be null, if a
600 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
601 * registered at the {@link HttpTransport}
602 * @param dSID required
603 * @return name of the given circuit dSID
605 String getCircuitName(String sessionToken, DSID dSID);
608 * Returns user defined name of the scene from the given zoneID, groupID and sceneID.
610 * @param sessionToken can be null, if a
611 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
612 * registered at the {@link HttpTransport}
613 * @param zoneID (0 is broadcast)
614 * @param zoneName of the zone
615 * @param groupID (0 is broadcast)
616 * @param sceneID (between 0 and 127)
617 * @return name of the scene otherwise null
619 String getSceneName(String sessionToken, Integer zoneID, String zoneName, Short groupID, Short sceneID);
622 * Returns the temperature control status to the given zone.
624 * @param sessionToken can be null, if a
625 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
626 * registered at the {@link HttpTransport}
627 * @param zoneID required or zoneName
628 * @param zoneName required or zoneID
629 * @return temperature control status to the given zone
631 TemperatureControlStatus getZoneTemperatureControlStatus(String sessionToken, Integer zoneID, String zoneName);
634 * Returns the temperature control configuration of the given zone. It's like the temperature control status added
635 * by the following control values.
637 * CtrlKp = Control proportional factor
638 * CtrlTs = Control sampling time
639 * CtrlTi = Control integrator time constant
640 * CtrlKd = Control differential factor
641 * CtrlImin = Control minimum integrator value
642 * CtrlImax = Control maximum integrator value
643 * CtrlYmin = Control minimum control value
644 * CtrlYmax = Control maximum control value
645 * CtrlAntiWindUp = Control integrator anti wind up: 0=inactive, 1=active
646 * CtrlKeepFloorWarm = Control mode with higher priority on comfort: 0=inactive, 1=active
648 * @param sessionToken can be null, if a
649 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
650 * registered at the {@link HttpTransport}
651 * @param zoneID required or zoneName
652 * @param zoneName required or zoneID
653 * @return temperature control status with configuration parameters
655 TemperatureControlConfig getZoneTemperatureControlConfig(String sessionToken, Integer zoneID, String zoneName);
658 * Returns the temperature control values to their control modes of the given zone.
659 * There are following control modes:
664 * <li>3 Not Used</li>
668 * <li>7 CollingOff</li>
671 * @param sessionToken can be null, if a
672 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
673 * registered at the {@link HttpTransport}
674 * @param zoneID required or zoneName
675 * @param zoneName required or zoneID
676 * @return temperature control values of control modes
678 TemperatureControlValues getZoneTemperatureControlValues(String sessionToken, Integer zoneID, String zoneName);
681 * Set the configuration of the zone temperature control.
683 * @param sessionToken can be null, if a
684 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
685 * registered at the {@link HttpTransport}
686 * @param zoneID (required alternative zoneName)
687 * @param zoneName (required alternative zoneID)
688 * @param controlDSUID dSUID of the meter or service that runs the control algorithm for this zone (optional)
689 * @param controlMode Control mode, can be one of: 0=off; 1=pid-control; 2=zone-follower; 3=fixed-value; 4=manual
691 * @param referenceZone Zone number of the reference zone (Optional for ControlMode 2)
692 * @param ctrlOffset Control value offset (Optional for ControlMode 2)
693 * @param emergencyValue Fixed control value in case of malfunction (Optional for ControlMode 1)
694 * @param manualValue Control value for manual mode (Optional for ControlMode 1)
695 * @param ctrlKp Control proportional factor (Optional for ControlMode 1)
696 * @param ctrlTs Control sampling time (Optional for ControlMode 1)
697 * @param ctrlTi Control integrator time constant (Optional for ControlMode 1)
698 * @param ctrlKd Control differential factor (Optional for ControlMode 1)
699 * @param ctrlImin Control minimum integrator value (Optional for ControlMode 1)
700 * @param ctrlImax Control maximum integrator value (Optional for ControlMode 1)
701 * @param ctrlYmin Control minimum control value (Optional for ControlMode 1)
702 * @param ctrlYmax Control maximum control value (Optional for ControlMode 1)
703 * @param ctrlAntiWindUp Control integrator anti wind up (Optional for ControlMode 1)
704 * @param ctrlKeepFloorWarm Control mode with higher priority on comfort (Optional for ControlMode 1)
705 * @return true, if successful
707 boolean setZoneTemperatureControlConfig(String sessionToken, Integer zoneID, String zoneName, String controlDSUID,
708 Short controlMode, Integer referenceZone, Float ctrlOffset, Float emergencyValue, Float manualValue,
709 Float ctrlKp, Float ctrlTs, Float ctrlTi, Float ctrlKd, Float ctrlImin, Float ctrlImax, Float ctrlYmin,
710 Float ctrlYmax, Boolean ctrlAntiWindUp, Boolean ctrlKeepFloorWarm);
713 * Returns the assigned Sensor dSUID of a zone.
716 * @param sessionToken can be null, if a
717 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
718 * registered at the {@link HttpTransport}
719 * @param zoneID required or zoneName
720 * @param zoneName required or zoneID
721 * @return assigned Sensor dSUID of the given zone.
723 AssignedSensors getZoneAssignedSensors(String sessionToken, Integer zoneID, String zoneName);
726 * Sets the temperature control state of a given zone.<br>
727 * Control states: 0=internal; 1=external; 2=exbackup; 3=emergency
729 * @param sessionToken can be null, if a
730 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
731 * registered at the {@link HttpTransport}
732 * @param zoneID required or zoneName
733 * @param zoneName required or zoneID
734 * @param controlState required
735 * @return success true otherwise false
737 boolean setZoneTemperatureControlState(String sessionToken, Integer zoneID, String zoneName, String controlState);
740 * Sets the wished temperature (control mode =
741 * {@link org.openhab.binding.digitalstrom.internal.lib.climate.constants.ControlModes#PID_CONTROL}) or control
743 * operation mode, see {@link org.openhab.binding.digitalstrom.internal.lib.climate.constants.OperationModes}.<br>
744 * To set the values a {@link List} with an object array has to be set as controlVlaues parameter. The 1th field has
745 * to be a {@link String} for the
746 * {@link org.openhab.binding.digitalstrom.internal.lib.climate.constants.OperationModes}
747 * name and the 2nd field has to be an {@link Integer} for the
748 * new value. If the control mode is
749 * {@link org.openhab.binding.digitalstrom.internal.lib.climate.constants.ControlModes#PID_CONTROL} it is the
750 * nominal temperature, otherwise it is
751 * the control valve value.
753 * @param sessionToken can be null, if a
754 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
755 * registered at the {@link HttpTransport}
756 * @param zoneID required or zoneName
757 * @param zoneName required or zoneID
758 * @param controlValues new control values
759 * @return success true otherwise false
761 boolean setZoneTemperatureControlValues(String sessionToken, Integer zoneID, String zoneName,
762 List<Object[]> controlValues);
765 * Returns the value of a Sensor of the given zone.
768 * @param sessionToken can be null, if a
769 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
770 * registered at the {@link HttpTransport}
771 * @param zoneID required or zoneName
772 * @param zoneName required or zoneID
773 * @return value of a Sensor of the given zone
775 SensorValues getZoneSensorValues(String sessionToken, Integer zoneID, String zoneName);
778 * Set the source of a sensor in a zone to a given device source address.
780 * @param sessionToken can be null, if a
781 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
782 * registered at the {@link HttpTransport}
783 * @param zoneID required or zoneName
784 * @param zoneName required or zoneID
785 * @param sensorType to set
787 * @return success true otherwise false
789 boolean setZoneSensorSource(String sessionToken, Integer zoneID, String zoneName, SensorEnum sensorType, DSID dSID);
792 * Remove all assignments for a particular sensor type in a zone.
794 * @param sessionToken can be null, if a
795 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
796 * registered at the {@link HttpTransport}
797 * @param zoneID required or zoneName
798 * @param zoneName required or zoneID
799 * @param sensorType to clear
800 * @return success true otherwise false
803 boolean clearZoneSensorSource(String sessionToken, Integer zoneID, String zoneName, SensorEnum sensorType);
806 * Returns internal status information of the temperature control of a zone.
808 * @param sessionToken can be null, if a
809 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
810 * registered at the {@link HttpTransport}
811 * @param zoneID required or zoneName
812 * @param zoneName required or zoneID
813 * @return internal status information of the temperature control of a zone
815 TemperatureControlInternals getZoneTemperatureControlInternals(String sessionToken, Integer zoneID,
819 * Returns the temperature control status of all zones.
821 * @param sessionToken can be null, if a
822 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
823 * registered at the {@link HttpTransport}
824 * @return temperature control status of all zones
826 List<TemperatureControlStatus> getApartmentTemperatureControlStatus(String sessionToken);
829 * Returns the temperature control status of all zones.
831 * @param sessionToken can be null, if a
832 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
833 * registered at the {@link HttpTransport}
834 * @return temperature control status of all zones
836 Map<Integer, TemperatureControlConfig> getApartmentTemperatureControlConfig(String sessionToken);
839 * Returns the temperature control status of all zones.
841 * @param sessionToken can be null, if a
842 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
843 * registered at the {@link HttpTransport}
844 * @return temperature control status of all zones
846 Map<Integer, TemperatureControlValues> getApartmentTemperatureControlValues(String sessionToken);
849 * Returns the assigned Sensor dSUID of all zones.
852 * @param sessionToken can be null, if a
853 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
854 * registered at the {@link HttpTransport}
855 * @return assigned Sensor dSUID of all zones.
857 Map<Integer, AssignedSensors> getApartmentAssignedSensors(String sessionToken);
860 * Returns the value of a Sensor of all zones.
862 * @param sessionToken can be null, if a
863 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
864 * registered at the {@link HttpTransport}
865 * @return value of a Sensor of all zones
867 Map<Integer, BaseSensorValues> getApartmentSensorValues(String sessionToken);
870 * <b>Description taken form digitalSTROM JSON-API:</b><br>
871 * Returns a part of the tree specified by query. All queries start from the root.
872 * The properties to be included have to be put in parentheses. A query to get
873 * all device from zone4 would look like this: ’/apartment/zones/zone4/*(ZoneID,name)’.
874 * More complex combinations (see example below) are also possible.
876 * @param sessionToken can be null, if a
877 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
878 * registered at the {@link HttpTransport}
879 * @param query required
880 * @return response as {@link JsonObject}
882 JsonObject query(String sessionToken, String query);
885 * <b>Description taken form digitalSTROM JSON-API:</b><br>
886 * Differs from query(1) only in the format of the the returned json struct.<br>
888 * <i>Folder selects the nodes to descend, Property declares which attributes
889 * we are extracting from the current node. If no properties are declared for a
890 * folder, nothing is extracted, and the node will not show up in the resulting
891 * json structure.</i>
893 * @param sessionToken can be null, if a
894 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
895 * registered at the {@link HttpTransport}
896 * @param query required
897 * @return response as {@link JsonObject}
899 JsonObject query2(String sessionToken, String query);
902 * <b>Description taken form digitalSTROM JSON-API:</b><br>
903 * Set the output value of a group of devices in a zone to a given value. <br>
905 * <b>Notice:</b> Setting output values directly bypasses the group state machine
906 * and is not recommended.<br>
908 * If the group parameters are omitted the command is sent as broadcast
909 * to all devices in the selected zone. <br>
911 * <b>Notice:</b> Setting output values without a group identification is strongly
914 * @param sessionToken can be null, if a
915 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
916 * registered at the {@link HttpTransport}
917 * @param zoneID or zoneName are required
918 * @param zoneName or zoneID are required
919 * @param groupID optional
920 * @param groupName optional
921 * @param value required
922 * @return true, if request was successful, otherwise false
924 boolean setZoneOutputValue(String sessionToken, Integer zoneID, String zoneName, Short groupID, String groupName,
928 * <b>Description taken form digitalSTROM JSON-API:</b><br>
929 * Executes the "blink" function on a group of devices in a zone for identification
932 * @param sessionToken can be null, if a
933 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
934 * registered at the {@link HttpTransport}
935 * @param zoneID or zoneName are required
936 * @param zoneName or zoneID are required
937 * @param groupID optional
938 * @param groupName optional
939 * @return true, if request was successful, otherwise false
941 boolean zoneBlink(String sessionToken, Integer zoneID, String zoneName, Short groupID, String groupName);
944 * <b>Description taken form digitalSTROM JSON-API:</b><br>
945 * Send a sensor value to a group of devices in a zone.<br>
946 * If the group parameter is omitted the command is sent as broadcast to
947 * all devices in the selected zone. The reference for the sensor type definitions
948 * can be found in the ds-basics document.
950 * @param sessionToken can be null, if a
951 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
952 * registered at the {@link HttpTransport}
953 * @param zoneID or zoneName are required
954 * @param zoneName or zoneID are required
955 * @param groupID optional
956 * @param sourceDSUID optional
957 * @param sensorValue required
958 * @param sensorType required
959 * @return true, if request was successful, otherwise false
961 boolean pushZoneSensorValue(String sessionToken, Integer zoneID, String zoneName, Short groupID, String sourceDSUID,
962 Float sensorValue, SensorEnum sensorType);
965 * <b>Description taken form digitalSTROM JSON-API:</b><br>
966 * Returns the string value of the property, this call will fail if the property is
967 * not of type ’string’.
969 * @param sessionToken can be null, if a
970 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
971 * registered at the {@link HttpTransport}
972 * @param path to property required
973 * @return {@link String} value of the property
975 String propertyTreeGetString(String sessionToken, String path);
978 * <b>Description taken form digitalSTROM JSON-API:</b><br>
979 * Sets the string value of the property, this call will fail if the property is not
982 * @param sessionToken can be null, if a
983 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
984 * registered at the {@link HttpTransport}
985 * @param path to property required
986 * @return {@link JsonArray} of child nodes
988 JsonArray propertyTreeGetChildren(String sessionToken, String path);
991 * <b>Description taken form digitalSTROM JSON-API:</b><br>
992 * Sets the string value of the property, this call will fail if the property is not
995 * @param sessionToken can be null, if a
996 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
997 * registered at the {@link HttpTransport}
998 * @param path required
999 * @param value required
1000 * @return true, if successful
1002 Boolean propertyTreeSetString(String sessionToken, String path, String value);
1005 * <b>Description taken form digitalSTROM JSON-API:</b><br>
1006 * Returns the integer value of the property, this call will fail if the property is
1007 * not of type ’integer’.
1009 * @param sessionToken can be null, if a
1010 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1011 * registered at the {@link HttpTransport}
1012 * @param path required
1013 * @return {@link Integer} value of the property
1015 Integer propertyTreeGetInteger(String sessionToken, String path);
1018 * <b>Description taken form digitalSTROM JSON-API:</b><br>
1019 * Sets the integer value of the property, this call will fail if the property is not
1020 * of type ’integer’.
1022 * @param sessionToken can be null, if a
1023 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1024 * registered at the {@link HttpTransport}
1025 * @param path required
1026 * @param value required
1027 * @return true, if successful
1029 Boolean propertyTreeSetInteger(String sessionToken, String path, Integer value);
1032 * <b>Description taken form digitalSTROM JSON-API:</b><br>
1033 * Returns the boolean value of the property, this call will fail if the property is
1034 * not of type ’boolean’.
1036 * @param sessionToken can be null, if a
1037 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1038 * registered at the {@link HttpTransport}
1039 * @param path required
1040 * @return {@link Boolean} value of the property
1042 Boolean propertyTreeGetBoolean(String sessionToken, String path);
1045 * <b>Description taken form digitalSTROM JSON-API:</b><br>
1046 * Returns the boolean value of the property, this call will fail if the property is
1047 * not of type ’boolean’.
1049 * @param sessionToken can be null, if a
1050 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1051 * registered at the {@link HttpTransport}
1052 * @param path required
1053 * @param value required
1054 * @return true, if successful
1056 Boolean propertyTreeSetBoolean(String sessionToken, String path, Boolean value);
1059 * <b>Description taken form digitalSTROM JSON-API:</b><br>
1060 * Returns the type of the property as {@link String}, this can be "none", "string", "integer" or
1063 * @param sessionToken can be null, if a
1064 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1065 * registered at the {@link HttpTransport}
1066 * @param path required
1067 * @return the type of the property as {@link String}
1069 String propertyTreeGetType(String sessionToken, String path);
1072 * Returns the flag values of a property as {@link Map}. The key is the flag type and the value the {@link Boolean}
1075 * Flag types are:<br>
1080 * @param sessionToken can be null, if a
1081 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1082 * registered at the {@link HttpTransport}
1083 * @param path required
1084 * @return the type of the property as {@link String}
1086 Map<String, Boolean> propertyTreeGetFlages(String sessionToken, String path);
1089 * <b>Description taken form digitalSTROM JSON-API:</b><br>
1090 * Sets a given flag of a property.
1092 * @param sessionToken can be null, if a
1093 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1094 * registered at the {@link HttpTransport}
1095 * @param path required
1096 * @param flag required
1097 * @param value required
1098 * @return true, if successful
1100 Boolean propertyTreeSetFlag(String sessionToken, String path, String flag, Boolean value);
1103 * <b>Description taken form digitalSTROM JSON-API:</b><br>
1104 * Removes a property node.
1106 * @param sessionToken can be null, if a
1107 * {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1108 * registered at the {@link HttpTransport}
1109 * @param path required
1110 * @return true, if successful
1112 Boolean propertyTreeRemove(String sessionToken, String path);