]> git.basschouten.com Git - openhab-addons.git/blob
dfa7fb81ceb0f6334209f1032acc7a56a60b2a53
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.digitalstrom.internal.lib.serverconnection;
14
15 import java.util.List;
16 import java.util.Map;
17
18 import org.openhab.binding.digitalstrom.internal.lib.climate.constants.ControlModes;
19 import org.openhab.binding.digitalstrom.internal.lib.climate.constants.OperationModes;
20 import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.BaseSensorValues;
21 import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.AssignedSensors;
22 import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.SensorValues;
23 import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.TemperatureControlConfig;
24 import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.TemperatureControlInternals;
25 import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.TemperatureControlStatus;
26 import org.openhab.binding.digitalstrom.internal.lib.climate.jsonresponsecontainer.impl.TemperatureControlValues;
27 import org.openhab.binding.digitalstrom.internal.lib.structure.Apartment;
28 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.Circuit;
29 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.Device;
30 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.CachedMeteringValue;
31 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.DeviceConfig;
32 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.DeviceSceneSpec;
33 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.DeviceParameterClassEnum;
34 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.MeteringTypeEnum;
35 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.MeteringUnitsEnum;
36 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.SensorEnum;
37 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DSID;
38 import org.openhab.binding.digitalstrom.internal.lib.structure.scene.constants.Scene;
39 import org.openhab.binding.digitalstrom.internal.lib.structure.scene.constants.SceneEnum;
40
41 import com.google.gson.JsonArray;
42 import com.google.gson.JsonObject;
43
44 /**
45  * digitalSTROM-API based on dSS-Version higher then 1.14.5.
46  * digitalSTROM documentation can be found at http://developer.digitalstrom.org/Architecture/v1.1/dss-json.pdf
47  *
48  * @author Alexander Betker - initial contributer
49  *
50  * @author Michael Ochel - add missing java-doc, update digitalSTROM-JSON-API as far as possible to the pdf version from
51  *         June 19, 2014 and add checkConnection method and ALL_METERS constant
52  * @author Matthias Siegele - add missing java-doc, update digitalSTROM-JSON-API as far as possible to the pdf version
53  *         from June 19, 2014 and add checkConnection method and ALL_METERS constant
54  */
55 public interface DsAPI {
56
57     /**
58      * Meter field to get all meters by calling {@link #getLatest(String, MeteringTypeEnum, String, MeteringUnitsEnum)}.
59      * It has to be set by meterDSIDs.
60      */
61     static final String ALL_METERS = ".meters(all)";
62
63     /**
64      * Calls the scene sceneNumber on all devices of the apartment. If groupID
65      * or groupName are specified. Only devices contained in this group will be
66      * addressed.
67      *
68      * @param sessionToken can be null, if a
69      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
70      *            registered at the {@link HttpTransport}
71      * @param groupID not required
72      * @param groupName not required
73      * @param sceneNumber required
74      * @param force not required
75      * @return true, if successful
76      */
77     boolean callApartmentScene(String sessionToken, Short groupID, String groupName, Scene sceneNumber, Boolean force);
78
79     /**
80      * Returns all zones
81      *
82      * @param sessionToken can be null, if a
83      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
84      *            registered at the {@link HttpTransport}
85      * @return Apartment
86      */
87     Apartment getApartmentStructure(String sessionToken);
88
89     /**
90      * Returns the list of devices in the apartment. If unassigned is true,
91      * only devices that are not assigned to a zone will be returned.
92      *
93      * @param sessionToken can be null, if a
94      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
95      *            registered at the {@link HttpTransport}
96      * @return List of devices
97      */
98     List<Device> getApartmentDevices(String sessionToken);
99
100     /**
101      * Returns an array containing all digitalSTROM-Meters of the apartment.
102      *
103      * @param sessionToken can be null, if a
104      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
105      *            registered at the {@link HttpTransport}
106      * @return List of all {@link Circuit}s
107      */
108     List<Circuit> getApartmentCircuits(String sessionToken);
109
110     /**
111      * Returns a list of dSID's of all meters(dSMs)
112      *
113      * @param sessionToken can be null, if a
114      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
115      *            registered at the {@link HttpTransport}
116      * @return String-List with dSID's
117      */
118     List<String> getMeterList(String sessionToken);
119
120     /**
121      * Calls the sceneNumber on all devices in the given zone. If groupID or groupName
122      * are specified only devices contained in this group will be addressed.
123      *
124      * @param sessionToken can be null, if a
125      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
126      *            registered at the {@link HttpTransport}
127      * @param zoneID needs either id or name
128      * @param zoneName needs either id or name
129      * @param groupID not required
130      * @param groupName not required
131      * @param sceneNumber required (only a zone/user scene is possible - sceneNumber 0..63 )
132      * @param force not required
133      * @return true on success
134      */
135     boolean callZoneScene(String sessionToken, Integer zoneID, String zoneName, Short groupID, String groupName,
136             SceneEnum sceneNumber, Boolean force);
137
138     /**
139      * Turns the device on. This will call the scene "max" on the device.
140      *
141      * @param sessionToken can be null, if a
142      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
143      *            registered at the {@link HttpTransport}
144      * @param dSID needs either dSID, dSUID or name
145      * @param dSUID needs either dSID, dSUID or name
146      * @param deviceName needs either dSID, dsUID or name
147      * @return true, if successful
148      */
149     boolean turnDeviceOn(String sessionToken, DSID dSID, String dSUID, String deviceName);
150
151     /**
152      * Turns the device off. This will call the scene "min" on the device.
153      *
154      * @param sessionToken can be null, if a
155      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
156      *            registered at the {@link HttpTransport}
157      * @param dSID needs either dSID, dSUID or name
158      * @param dSUID needs either dSID, dSUID or name
159      * @param deviceName needs either dSID, dsUID or name
160      * @return true, if successful
161      */
162     boolean turnDeviceOff(String sessionToken, DSID dSID, String dSUID, String deviceName);
163
164     /**
165      * Sets the output value of device.
166      *
167      * @param sessionToken can be null, if a
168      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
169      *            registered at the {@link HttpTransport}
170      * @param dSID needs either dSID, dSUID or name
171      * @param dSUID needs either dSID, dSUID or name
172      * @param deviceName needs either dSID, dsUID or name
173      * @param value required (0 - 255)
174      * @return true, if successful
175      */
176     boolean setDeviceValue(String sessionToken, DSID dSID, String dSUID, String deviceName, Integer value);
177
178     /**
179      * Gets the value of configuration class at offset index.
180      *
181      * @param sessionToken can be null, if a
182      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
183      *            registered at the {@link HttpTransport}
184      * @param dSID needs either dSID, dSUID or name
185      * @param dSUID needs either dSID, dSUID or name
186      * @param deviceName needs either dSID, dsUID or name
187      * @param clazz required
188      * @param index required
189      * @return config with values
190      */
191     DeviceConfig getDeviceConfig(String sessionToken, DSID dSID, String dSUID, String deviceName,
192             DeviceParameterClassEnum clazz, Integer index);
193
194     /**
195      * Gets the device output value from parameter at the given offset.
196      * The available parameters and offsets depend on the features of the
197      * hardware components.
198      *
199      * @param sessionToken can be null, if a
200      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
201      *            registered at the {@link HttpTransport}
202      * @param dSID needs either dSID, dSUID or name
203      * @param dSUID needs either dSID, dSUID or name
204      * @param deviceName needs either dSID, dsUID or name
205      * @param offset required (known offset e.g. 0)
206      * @return current device output value or -1, if the request was not successful
207      */
208     int getDeviceOutputValue(String sessionToken, DSID dSID, String dSUID, String deviceName, Short offset);
209
210     /**
211      * Sets the device output value at the given offset. The available
212      * parameters and offsets depend on the features of the hardware components.
213      *
214      * @param sessionToken can be null, if a
215      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
216      *            registered at the {@link HttpTransport}
217      * @param dSID needs either dSID, dSUID or name
218      * @param dSUID needs either dSID, dSUID or name
219      * @param deviceName needs either dSID, dsUID or name
220      * @param offset required
221      * @param value required (0 - 65535)
222      * @return true, if successful
223      */
224     boolean setDeviceOutputValue(String sessionToken, DSID dSID, String dSUID, String deviceName, Short offset,
225             Integer value);
226
227     /**
228      * Gets the device configuration for a specific scene command.
229      *
230      * @param sessionToken can be null, if a
231      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
232      *            registered at the {@link HttpTransport}
233      * @param dSID needs either dSID, dSUID or name
234      * @param dSUID needs either dSID, dSUID or name
235      * @param deviceName needs either dSID, dsUID or name
236      * @param sceneID required (0 .. 255)
237      * @return scene configuration
238      */
239     DeviceSceneSpec getDeviceSceneMode(String sessionToken, DSID dSID, String dSUID, String deviceName, Short sceneID);
240
241     /**
242      * Requests the sensor value for a given index.
243      *
244      * @param sessionToken can be null, if a
245      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
246      *            registered at the {@link HttpTransport}
247      * @param dSID needs either dSID, dSUID or name
248      * @param dSUID needs either dSID, dSUID or name
249      * @param deviceName needs either dSID, dsUID or name
250      * @param sensorIndex required
251      * @return sensor value
252      */
253     short getDeviceSensorValue(String sessionToken, DSID dSID, String dSUID, String deviceName, Short sensorIndex);
254
255     /**
256      * Calls scene sceneNumber on the device.
257      *
258      * @param sessionToken can be null, if a
259      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
260      *            registered at the {@link HttpTransport}
261      * @param dSID needs either dSID, dSUID or name
262      * @param dSUID needs either dSID, dSUID or name
263      * @param deviceName needs either dSID, dsUID or name
264      * @param sceneNumber required
265      * @param force not required
266      * @return true, if successful
267      */
268     boolean callDeviceScene(String sessionToken, DSID dSID, String dSUID, String deviceName, Scene sceneNumber,
269             Boolean force);
270
271     /**
272      * Subscribes to an event given by the name. The subscriptionID is a unique id
273      * that is defined by the subscriber. It is possible to subscribe to several events,
274      * using the same subscription id, this allows to retrieve a grouped output of the
275      * events (i.e. get output of all subscribed by the given id).
276      *
277      * @param sessionToken can be null, if a
278      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
279      *            registered at the {@link HttpTransport}
280      * @param eventName required
281      * @param subscriptionID required
282      * @param connectionTimeout to set
283      * @param readTimeout to set
284      * @return true on success
285      */
286     boolean subscribeEvent(String sessionToken, String eventName, Integer subscriptionID, int connectionTimeout,
287             int readTimeout);
288
289     /**
290      * Unsubscribes from an event given by the name. The subscriptionID is a unique
291      * id that was used in the subscribe call.
292      *
293      * @param sessionToken can be null, if a
294      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
295      *            registered at the {@link HttpTransport}
296      * @param eventName required
297      * @param subscriptionID required
298      * @param connectionTimeout to set
299      * @param readTimeout to set
300      * @return true on success
301      */
302     boolean unsubscribeEvent(String sessionToken, String eventName, Integer subscriptionID, int connectionTimeout,
303             int readTimeout);
304
305     /**
306      * Gets event information and output. The subscriptionID is a unique id
307      * that was used in the subscribe call. All events, subscribed with the
308      * given id will be handled by this call. A timeout, in case no events
309      * are taken place, can be specified (in ms). By default the timeout
310      * is disabled: 0 (zero), if no events occur the call will block.
311      *
312      * @param sessionToken can be null, if a
313      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
314      *            registered at the {@link HttpTransport}
315      * @param subscriptionID required
316      * @param timeout optional
317      * @return Event-String
318      */
319     String getEvent(String sessionToken, Integer subscriptionID, Integer timeout);
320
321     /**
322      * Returns the dSS time in UTC seconds since epoch.
323      *
324      * @param sessionToken can be null, if a
325      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
326      *            registered at the {@link HttpTransport}
327      * @return time
328      */
329     int getTime(String sessionToken);
330
331     /**
332      * <b>Description partially taken form digitalSTROM JSON-API:</b><br>
333      * Returns the version of the digitalSTROM-Server software version as {@link Map}.<br>
334      * <br>
335      * <b>Key, value:</b><br>
336      * <ul>
337      * <li><b>version</b> the dSS application version</li>
338      * <li><b>distroVersion</b> the host platform firmware release (since v1.10)</li>
339      * <li><b>Hardware</b> the host platform hardware identifier (since v1.10)</li>
340      * <li><b>Revision</b> the host platform hardware revision number (since v1.10)</li>
341      * <li><b>Serial</b> the host platform hardware serial number (since v1.10)</li>
342      * <li><b>Ethernet</b> the host platform IEEE Mac address (since v1.10)</li>
343      * <li><b>MachineID</b> the host system unique id (since v1.10)</li>
344      * <li><b>Kernel</b> the host system Linux kernel release string (since v1.10)</li>
345      * </ul>
346      *
347      * @return the digitalSTROM-Server software version
348      */
349     Map<String, String> getSystemVersion();
350
351     /**
352      * Creates a new session using the registered application token
353      *
354      * @param applicationToken required
355      * @return sessionToken
356      */
357     String loginApplication(String applicationToken);
358
359     /**
360      * Creates a new session.
361      *
362      * @param user required
363      * @param password required
364      * @return new session token
365      */
366     String login(String user, String password);
367
368     /**
369      * Destroys the session and signs out the user
370      *
371      * @return true, if logout was successful, otherwise false
372      */
373     boolean logout();
374
375     /**
376      * Returns the dSID of the digitalSTROM Server.
377      *
378      * @param sessionToken can be null, if a
379      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
380      *            registered at the {@link HttpTransport}
381      * @return dSID
382      */
383     Map<String, String> getDSID(String sessionToken);
384
385     /**
386      * Returns a token for passwordless login. The token will need to be approved
387      * by a user first, the caller must not be logged in.
388      *
389      * @param applicationName required
390      * @return applicationToken
391      */
392     String requestAppplicationToken(String applicationName);
393
394     /**
395      * Revokes an application token, caller must be logged in.
396      *
397      * @param sessionToken can be null, if a
398      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
399      *            registered at the {@link HttpTransport}
400      * @param applicationToken to login
401      * @return true, if successful, otherwise false
402      */
403     boolean revokeToken(String applicationToken, String sessionToken);
404
405     /**
406      * Enables an application token, caller must be logged in.
407      *
408      * @param sessionToken can be null, if a
409      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
410      *            registered at the {@link HttpTransport}
411      * @param applicationToken required
412      * @return true, if successful, otherwise false
413      */
414     boolean enableApplicationToken(String applicationToken, String sessionToken);
415
416     /**
417      * Returns all resolutions stored on this dSS
418      *
419      * @param sessionToken can be null, if a
420      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
421      *            registered at the {@link HttpTransport}
422      * @return List of resolutions
423      */
424     List<Integer> getResolutions(String sessionToken);
425
426     /**
427      * Returns cached energy meter value or cached power consumption
428      * value in watt (W). The type parameter defines what should
429      * be returned, valid types, 'energyDelta' are 'energy' and
430      * 'consumption' you can also see at {@link MeteringTypeEnum}. 'energy' and 'energyDelta' are available in two
431      * units: 'Wh' (default) and 'Ws' you can also see at {@link MeteringUnitsEnum}. The meterDSIDs parameter follows
432      * the
433      * set-syntax, currently it supports: .meters(dsid1,dsid2,...) and .meters(all)
434      *
435      * @param sessionToken can be null, if a
436      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
437      *            registered at the {@link HttpTransport}
438      * @param type required
439      * @param meterDSIDs required
440      * @param unit optional
441      * @return cached metering values
442      */
443     List<CachedMeteringValue> getLatest(String sessionToken, MeteringTypeEnum type, String meterDSIDs,
444             MeteringUnitsEnum unit);
445
446     /**
447      * Returns cached energy meter value or cached power consumption
448      * value in watt (W). The type parameter defines what should
449      * be returned, valid types, 'energyDelta' are 'energy' and
450      * 'consumption' you can also see at {@link MeteringTypeEnum}. 'energy' and 'energyDelta' are available in two
451      * units: 'Wh' (default) and 'Ws' you can also see at {@link MeteringUnitsEnum}. <br>
452      * The meterDSIDs parameter you can directly pass a {@link List} of the digitalSTROM-Meter dSID's as {@link String}.
453      *
454      * @param sessionToken can be null, if a
455      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
456      *            registered at the {@link HttpTransport}
457      * @param type required
458      * @param meterDSIDs required
459      * @param unit optional
460      * @return cached metering values
461      */
462     List<CachedMeteringValue> getLatest(String sessionToken, MeteringTypeEnum type, List<String> meterDSIDs,
463             MeteringUnitsEnum unit);
464
465     /**
466      * Checks the connection and returns the HTTP-Status-Code.
467      *
468      * @param sessionToken can be null, if a
469      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
470      *            registered at the {@link HttpTransport}
471      * @return HTTP-Status-Code
472      */
473     int checkConnection(String sessionToken);
474
475     /**
476      * Returns the configured scene output value for the given sceneId of the digitalSTROM-Device with the given dSID.
477      * <br>
478      * At array position 0 is the output value and at position 1 the angle value, if the device is a blind.
479      *
480      * @param sessionToken can be null, if a
481      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
482      *            registered at the {@link HttpTransport}
483      * @param dSID needs either dSID, dSUID or name
484      * @param dSUID needs either dSID, dSUID or name
485      * @param deviceName needs either dSID, dsUID or name
486      * @param sceneId required
487      * @return scene value at array position 0 and angle at position 1
488      */
489     int[] getSceneValue(String sessionToken, DSID dSID, String dSUID, String deviceName, Short sceneId);
490
491     /**
492      * Calls the INC scene on the digitalSTROM-Device with the given dSID and returns true if the request was success.
493      *
494      * @param sessionToken can be null, if a
495      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
496      *            registered at the {@link HttpTransport}
497      * @param dSID needs either dSID, dSUID or name
498      * @param dSUID needs either dSID, dSUID or name
499      * @param deviceName needs either dSID, dsUID or name
500      * @return success true otherwise false
501      */
502     boolean increaseValue(String sessionToken, DSID dSID, String dSUID, String deviceName);
503
504     /**
505      * Calls the DEC scene on the digitalSTROM-Device with the given dSID and returns true if the request was
506      * successful.
507      *
508      * @param sessionToken can be null, if a
509      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
510      *            registered at the {@link HttpTransport}
511      * @param dSID needs either dSID, dSUID or name
512      * @param dSUID needs either dSID, dSUID or name
513      * @param deviceName needs either dSID, dsUID or name
514      * @return success true otherwise false
515      */
516     boolean decreaseValue(String sessionToken, DSID dSID, String dSUID, String deviceName);
517
518     /**
519      * Undos the given sceneNumer of the digitalSTROM-Device with the given dSID and returns true if the request was
520      * successful.
521      *
522      * @param sessionToken can be null, if a
523      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
524      *            registered at the {@link HttpTransport}
525      * @param dSID needs either dSID, dSUID or name
526      * @param dSUID needs either dSID, dSUID or name
527      * @param deviceName needs either dSID, dsUID or name
528      * @param sceneNumber required
529      * @return success true otherwise false
530      */
531     boolean undoDeviceScene(String sessionToken, DSID dSID, String dSUID, String deviceName, Scene sceneNumber);
532
533     /**
534      * Undo the given sceneNumer on the digitalSTROM apartment-group with the given groupID or groupName and returns
535      * true
536      * if the request was successful.
537      *
538      * @param sessionToken can be null, if a
539      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
540      *            registered at the {@link HttpTransport}
541      * @param groupID needs either groupID or groupName
542      * @param groupName needs either groupID or groupName
543      * @param sceneNumber required
544      * @return success true otherwise false
545      */
546     boolean undoApartmentScene(String sessionToken, Short groupID, String groupName, Scene sceneNumber);
547
548     /**
549      * Undo the given sceneNumer on the digitalSTROM zone-group with the given zoneID or zoneName and groupID or
550      * groupName and returns true if the request was successful.
551      *
552      * @param sessionToken can be null, if a
553      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
554      *            registered at the {@link HttpTransport}
555      * @param zoneID needs either zoneID or zoneName
556      * @param zoneName needs either zoneID or zoneName
557      * @param groupID needs either groupID or groupName
558      * @param groupName needs either groupID or groupName
559      * @param sceneNumber required
560      * @return success true otherwise false
561      */
562     boolean undoZoneScene(String sessionToken, Integer zoneID, String zoneName, Short groupID, String groupName,
563             SceneEnum sceneNumber);
564
565     /**
566      * Returns user defined name of the digitalSTROM installation.
567      *
568      * @param sessionToken can be null, if a
569      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
570      *            registered at the {@link HttpTransport}
571      * @return name of the digitalSTROM installation
572      */
573     String getInstallationName(String sessionToken);
574
575     /**
576      * Returns user defined name of the zone from the given zone id.
577      *
578      * @param sessionToken can be null, if a
579      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
580      *            registered at the {@link HttpTransport}
581      * @param zoneID required
582      * @return name of the given zone id
583      */
584     String getZoneName(String sessionToken, Integer zoneID);
585
586     /**
587      * Returns user defined name of the device from the given dSID
588      *
589      * @param sessionToken can be null, if a
590      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
591      *            registered at the {@link HttpTransport}
592      * @param dSID needs either dSID or dSUID
593      * @param dSUID needs either dSID or dSUID
594      * @return name of the device with the given dSID or dSUID
595      */
596     String getDeviceName(String sessionToken, DSID dSID, String dSUID);
597
598     /**
599      * Returns user defined name of the circuit from the given dSID.
600      *
601      * @param sessionToken can be null, if a
602      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
603      *            registered at the {@link HttpTransport}
604      * @param dSID required
605      * @return name of the given circuit dSID
606      */
607     String getCircuitName(String sessionToken, DSID dSID);
608
609     /**
610      * Returns user defined name of the scene from the given zoneID, groupID and sceneID.
611      *
612      * @param sessionToken can be null, if a
613      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
614      *            registered at the {@link HttpTransport}
615      * @param zoneID (0 is broadcast)
616      * @param zoneName of the zone
617      * @param groupID (0 is broadcast)
618      * @param sceneID (between 0 and 127)
619      * @return name of the scene otherwise null
620      */
621     String getSceneName(String sessionToken, Integer zoneID, String zoneName, Short groupID, Short sceneID);
622
623     /**
624      * Returns the temperature control status to the given zone.
625      *
626      * @param sessionToken can be null, if a
627      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
628      *            registered at the {@link HttpTransport}
629      * @param zoneID required or zoneName
630      * @param zoneName required or zoneID
631      * @return temperature control status to the given zone
632      */
633     TemperatureControlStatus getZoneTemperatureControlStatus(String sessionToken, Integer zoneID, String zoneName);
634
635     /**
636      * Returns the temperature control configuration of the given zone. It's like the temperature control status added
637      * by the following control values.
638      *
639      * CtrlKp = Control proportional factor
640      * CtrlTs = Control sampling time
641      * CtrlTi = Control integrator time constant
642      * CtrlKd = Control differential factor
643      * CtrlImin = Control minimum integrator value
644      * CtrlImax = Control maximum integrator value
645      * CtrlYmin = Control minimum control value
646      * CtrlYmax = Control maximum control value
647      * CtrlAntiWindUp = Control integrator anti wind up: 0=inactive, 1=active
648      * CtrlKeepFloorWarm = Control mode with higher priority on comfort: 0=inactive, 1=active
649      *
650      * @param sessionToken can be null, if a
651      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
652      *            registered at the {@link HttpTransport}
653      * @param zoneID required or zoneName
654      * @param zoneName required or zoneID
655      * @return temperature control status with configuration parameters
656      */
657     TemperatureControlConfig getZoneTemperatureControlConfig(String sessionToken, Integer zoneID, String zoneName);
658
659     /**
660      * Returns the temperature control values to their control modes of the given zone.
661      * There are following control modes:
662      * <ul>
663      * <li>0 Off</li>
664      * <li>1 Comfort</li>
665      * <li>2 Economy</li>
666      * <li>3 Not Used</li>
667      * <li>4 Night</li>
668      * <li>5 Holiday</li>
669      * <li>6 Cooling</li>
670      * <li>7 CollingOff</li>
671      * </ul>
672      *
673      * @param sessionToken can be null, if a
674      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
675      *            registered at the {@link HttpTransport}
676      * @param zoneID required or zoneName
677      * @param zoneName required or zoneID
678      * @return temperature control values of control modes
679      */
680     TemperatureControlValues getZoneTemperatureControlValues(String sessionToken, Integer zoneID, String zoneName);
681
682     /**
683      * Set the configuration of the zone temperature control.
684      *
685      * @param sessionToken can be null, if a
686      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
687      *            registered at the {@link HttpTransport}
688      * @param zoneID (required alternative zoneName)
689      * @param zoneName (required alternative zoneID)
690      * @param controlDSUID dSUID of the meter or service that runs the control algorithm for this zone (optional)
691      * @param controlMode Control mode, can be one of: 0=off; 1=pid-control; 2=zone-follower; 3=fixed-value; 4=manual
692      *            (Optional)
693      * @param referenceZone Zone number of the reference zone (Optional for ControlMode 2)
694      * @param ctrlOffset Control value offset (Optional for ControlMode 2)
695      * @param emergencyValue Fixed control value in case of malfunction (Optional for ControlMode 1)
696      * @param manualValue Control value for manual mode (Optional for ControlMode 1)
697      * @param ctrlKp Control proportional factor (Optional for ControlMode 1)
698      * @param ctrlTs Control sampling time (Optional for ControlMode 1)
699      * @param ctrlTi Control integrator time constant (Optional for ControlMode 1)
700      * @param ctrlKd Control differential factor (Optional for ControlMode 1)
701      * @param ctrlImin Control minimum integrator value (Optional for ControlMode 1)
702      * @param ctrlImax Control maximum integrator value (Optional for ControlMode 1)
703      * @param ctrlYmin Control minimum control value (Optional for ControlMode 1)
704      * @param ctrlYmax Control maximum control value (Optional for ControlMode 1)
705      * @param ctrlAntiWindUp Control integrator anti wind up (Optional for ControlMode 1)
706      * @param ctrlKeepFloorWarm Control mode with higher priority on comfort (Optional for ControlMode 1)
707      * @return true, if successful
708      */
709     boolean setZoneTemperatureControlConfig(String sessionToken, Integer zoneID, String zoneName, String controlDSUID,
710             Short controlMode, Integer referenceZone, Float ctrlOffset, Float emergencyValue, Float manualValue,
711             Float ctrlKp, Float ctrlTs, Float ctrlTi, Float ctrlKd, Float ctrlImin, Float ctrlImax, Float ctrlYmin,
712             Float ctrlYmax, Boolean ctrlAntiWindUp, Boolean ctrlKeepFloorWarm);
713
714     /**
715      * Returns the assigned Sensor dSUID of a zone.
716      *
717      *
718      * @param sessionToken can be null, if a
719      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
720      *            registered at the {@link HttpTransport}
721      * @param zoneID required or zoneName
722      * @param zoneName required or zoneID
723      * @return assigned Sensor dSUID of the given zone.
724      */
725     AssignedSensors getZoneAssignedSensors(String sessionToken, Integer zoneID, String zoneName);
726
727     /**
728      * Sets the temperature control state of a given zone.<br>
729      * Control states: 0=internal; 1=external; 2=exbackup; 3=emergency
730      *
731      * @param sessionToken can be null, if a
732      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
733      *            registered at the {@link HttpTransport}
734      * @param zoneID required or zoneName
735      * @param zoneName required or zoneID
736      * @param controlState required
737      * @return success true otherwise false
738      */
739     boolean setZoneTemperatureControlState(String sessionToken, Integer zoneID, String zoneName, String controlState);
740
741     /**
742      * Sets the wished temperature (control mode = {@link ControlModes#PID_CONTROL}) or control valve value for a
743      * operation mode, see
744      * {@link OperationModes}.<br>
745      * To set the values a {@link List} with an object array has to be set as controlVlaues parameter. The 1th field has
746      * to be a {@link String} for the {@link OperationModes} name and the 2nd field has to be an {@link Integer} for the
747      * new value. If the control mode is {@link ControlModes#PID_CONTROL} it is the nominal temperature, otherwise it is
748      * the control valve value.
749      *
750      * @param sessionToken can be null, if a
751      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
752      *            registered at the {@link HttpTransport}
753      * @param zoneID required or zoneName
754      * @param zoneName required or zoneID
755      * @param controlValues new control values
756      * @return success true otherwise false
757      */
758     boolean setZoneTemperatureControlValues(String sessionToken, Integer zoneID, String zoneName,
759             List<Object[]> controlValues);
760
761     /**
762      * Returns the value of a Sensor of the given zone.
763      *
764      *
765      * @param sessionToken can be null, if a
766      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
767      *            registered at the {@link HttpTransport}
768      * @param zoneID required or zoneName
769      * @param zoneName required or zoneID
770      * @return value of a Sensor of the given zone
771      */
772     SensorValues getZoneSensorValues(String sessionToken, Integer zoneID, String zoneName);
773
774     /**
775      * Set the source of a sensor in a zone to a given device source address.
776      *
777      * @param sessionToken can be null, if a
778      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
779      *            registered at the {@link HttpTransport}
780      * @param zoneID required or zoneName
781      * @param zoneName required or zoneID
782      * @param sensorType to set
783      * @param dSID to set
784      * @return success true otherwise false
785      */
786     boolean setZoneSensorSource(String sessionToken, Integer zoneID, String zoneName, SensorEnum sensorType, DSID dSID);
787
788     /**
789      * Remove all assignments for a particular sensor type in a zone.
790      *
791      * @param sessionToken can be null, if a
792      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
793      *            registered at the {@link HttpTransport}
794      * @param zoneID required or zoneName
795      * @param zoneName required or zoneID
796      * @param sensorType to clear
797      * @return success true otherwise false
798      *
799      */
800     boolean clearZoneSensorSource(String sessionToken, Integer zoneID, String zoneName, SensorEnum sensorType);
801
802     /**
803      * Returns internal status information of the temperature control of a zone.
804      *
805      * @param sessionToken can be null, if a
806      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
807      *            registered at the {@link HttpTransport}
808      * @param zoneID required or zoneName
809      * @param zoneName required or zoneID
810      * @return internal status information of the temperature control of a zone
811      */
812     TemperatureControlInternals getZoneTemperatureControlInternals(String sessionToken, Integer zoneID,
813             String zoneName);
814
815     /**
816      * Returns the temperature control status of all zones.
817      *
818      * @param sessionToken can be null, if a
819      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
820      *            registered at the {@link HttpTransport}
821      * @return temperature control status of all zones
822      */
823     List<TemperatureControlStatus> getApartmentTemperatureControlStatus(String sessionToken);
824
825     /**
826      * Returns the temperature control status of all zones.
827      *
828      * @param sessionToken can be null, if a
829      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
830      *            registered at the {@link HttpTransport}
831      * @return temperature control status of all zones
832      */
833     Map<Integer, TemperatureControlConfig> getApartmentTemperatureControlConfig(String sessionToken);
834
835     /**
836      * Returns the temperature control status of all zones.
837      *
838      * @param sessionToken can be null, if a
839      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
840      *            registered at the {@link HttpTransport}
841      * @return temperature control status of all zones
842      */
843     Map<Integer, TemperatureControlValues> getApartmentTemperatureControlValues(String sessionToken);
844
845     /**
846      * Returns the assigned Sensor dSUID of all zones.
847      *
848      *
849      * @param sessionToken can be null, if a
850      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
851      *            registered at the {@link HttpTransport}
852      * @return assigned Sensor dSUID of all zones.
853      */
854     Map<Integer, AssignedSensors> getApartmentAssignedSensors(String sessionToken);
855
856     /**
857      * Returns the value of a Sensor of all zones.
858      *
859      * @param sessionToken can be null, if a
860      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
861      *            registered at the {@link HttpTransport}
862      * @return value of a Sensor of all zones
863      */
864     Map<Integer, BaseSensorValues> getApartmentSensorValues(String sessionToken);
865
866     /**
867      * <b>Description taken form digitalSTROM JSON-API:</b><br>
868      * Returns a part of the tree specified by query. All queries start from the root.
869      * The properties to be included have to be put in parentheses. A query to get
870      * all device from zone4 would look like this: ’/apartment/zones/zone4/*(ZoneID,name)’.
871      * More complex combinations (see example below) are also possible.
872      *
873      * @param sessionToken can be null, if a
874      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
875      *            registered at the {@link HttpTransport}
876      * @param query required
877      * @return response as {@link JsonObject}
878      */
879     JsonObject query(String sessionToken, String query);
880
881     /**
882      * <b>Description taken form digitalSTROM JSON-API:</b><br>
883      * Differs from query(1) only in the format of the the returned json struct.<br>
884      * <br>
885      * <i>Folder selects the nodes to descend, Property declares which attributes
886      * we are extracting from the current node. If no properties are declared for a
887      * folder, nothing is extracted, and the node will not show up in the resulting
888      * json structure.</i>
889      *
890      * @param sessionToken can be null, if a
891      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
892      *            registered at the {@link HttpTransport}
893      * @param query required
894      * @return response as {@link JsonObject}
895      */
896     JsonObject query2(String sessionToken, String query);
897
898     /**
899      * <b>Description taken form digitalSTROM JSON-API:</b><br>
900      * Set the output value of a group of devices in a zone to a given value. <br>
901      * <br>
902      * <b>Notice:</b> Setting output values directly bypasses the group state machine
903      * and is not recommended.<br>
904      * <br>
905      * If the group parameters are omitted the command is sent as broadcast
906      * to all devices in the selected zone. <br>
907      * <br>
908      * <b>Notice:</b> Setting output values without a group identification is strongly
909      * unrecommended.<br>
910      *
911      * @param sessionToken can be null, if a
912      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
913      *            registered at the {@link HttpTransport}
914      * @param zoneID or zoneName are required
915      * @param zoneName or zoneID are required
916      * @param groupID optional
917      * @param groupName optional
918      * @param value required
919      * @return true, if request was successful, otherwise false
920      */
921     boolean setZoneOutputValue(String sessionToken, Integer zoneID, String zoneName, Short groupID, String groupName,
922             Integer value);
923
924     /**
925      * <b>Description taken form digitalSTROM JSON-API:</b><br>
926      * Executes the "blink" function on a group of devices in a zone for identification
927      * purposes.
928      *
929      * @param sessionToken can be null, if a
930      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
931      *            registered at the {@link HttpTransport}
932      * @param zoneID or zoneName are required
933      * @param zoneName or zoneID are required
934      * @param groupID optional
935      * @param groupName optional
936      * @return true, if request was successful, otherwise false
937      */
938     boolean zoneBlink(String sessionToken, Integer zoneID, String zoneName, Short groupID, String groupName);
939
940     /**
941      * <b>Description taken form digitalSTROM JSON-API:</b><br>
942      * Send a sensor value to a group of devices in a zone.<br>
943      * If the group parameter is omitted the command is sent as broadcast to
944      * all devices in the selected zone. The reference for the sensor type definitions
945      * can be found in the ds-basics document.
946      *
947      * @param sessionToken can be null, if a
948      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
949      *            registered at the {@link HttpTransport}
950      * @param zoneID or zoneName are required
951      * @param zoneName or zoneID are required
952      * @param groupID optional
953      * @param sourceDSUID optional
954      * @param sensorValue required
955      * @param sensorType required
956      * @return true, if request was successful, otherwise false
957      */
958     boolean pushZoneSensorValue(String sessionToken, Integer zoneID, String zoneName, Short groupID, String sourceDSUID,
959             Float sensorValue, SensorEnum sensorType);
960
961     /**
962      * <b>Description taken form digitalSTROM JSON-API:</b><br>
963      * Returns the string value of the property, this call will fail if the property is
964      * not of type ’string’.
965      *
966      * @param sessionToken can be null, if a
967      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
968      *            registered at the {@link HttpTransport}
969      * @param path to property required
970      * @return {@link String} value of the property
971      */
972     String propertyTreeGetString(String sessionToken, String path);
973
974     /**
975      * <b>Description taken form digitalSTROM JSON-API:</b><br>
976      * Sets the string value of the property, this call will fail if the property is not
977      * of type ’string’.
978      *
979      * @param sessionToken can be null, if a
980      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
981      *            registered at the {@link HttpTransport}
982      * @param path to property required
983      * @return {@link JsonArray} of child nodes
984      */
985     JsonArray propertyTreeGetChildren(String sessionToken, String path);
986
987     /**
988      * <b>Description taken form digitalSTROM JSON-API:</b><br>
989      * Sets the string value of the property, this call will fail if the property is not
990      * of type ’string’.
991      *
992      * @param sessionToken can be null, if a
993      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
994      *            registered at the {@link HttpTransport}
995      * @param path required
996      * @param value required
997      * @return true, if successful
998      */
999     Boolean propertyTreeSetString(String sessionToken, String path, String value);
1000
1001     /**
1002      * <b>Description taken form digitalSTROM JSON-API:</b><br>
1003      * Returns the integer value of the property, this call will fail if the property is
1004      * not of type ’integer’.
1005      *
1006      * @param sessionToken can be null, if a
1007      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1008      *            registered at the {@link HttpTransport}
1009      * @param path required
1010      * @return {@link Integer} value of the property
1011      */
1012     Integer propertyTreeGetInteger(String sessionToken, String path);
1013
1014     /**
1015      * <b>Description taken form digitalSTROM JSON-API:</b><br>
1016      * Sets the integer value of the property, this call will fail if the property is not
1017      * of type ’integer’.
1018      *
1019      * @param sessionToken can be null, if a
1020      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1021      *            registered at the {@link HttpTransport}
1022      * @param path required
1023      * @param value required
1024      * @return true, if successful
1025      */
1026     Boolean propertyTreeSetInteger(String sessionToken, String path, Integer value);
1027
1028     /**
1029      * <b>Description taken form digitalSTROM JSON-API:</b><br>
1030      * Returns the boolean value of the property, this call will fail if the property is
1031      * not of type ’boolean’.
1032      *
1033      * @param sessionToken can be null, if a
1034      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1035      *            registered at the {@link HttpTransport}
1036      * @param path required
1037      * @return {@link Boolean} value of the property
1038      */
1039     Boolean propertyTreeGetBoolean(String sessionToken, String path);
1040
1041     /**
1042      * <b>Description taken form digitalSTROM JSON-API:</b><br>
1043      * Returns the boolean value of the property, this call will fail if the property is
1044      * not of type ’boolean’.
1045      *
1046      * @param sessionToken can be null, if a
1047      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1048      *            registered at the {@link HttpTransport}
1049      * @param path required
1050      * @param value required
1051      * @return true, if successful
1052      */
1053     Boolean propertyTreeSetBoolean(String sessionToken, String path, Boolean value);
1054
1055     /**
1056      * <b>Description taken form digitalSTROM JSON-API:</b><br>
1057      * Returns the type of the property as {@link String}, this can be "none", "string", "integer" or
1058      * "boolean".
1059      *
1060      * @param sessionToken can be null, if a
1061      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1062      *            registered at the {@link HttpTransport}
1063      * @param path required
1064      * @return the type of the property as {@link String}
1065      */
1066     String propertyTreeGetType(String sessionToken, String path);
1067
1068     /**
1069      * Returns the flag values of a property as {@link Map}. The key is the flag type and the value the {@link Boolean}
1070      * value.<br>
1071      * <br>
1072      * Flag types are:<br>
1073      * - READABLE <br>
1074      * - WRITEABLE <br>
1075      * - ARCHIVE <br>
1076      *
1077      * @param sessionToken can be null, if a
1078      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1079      *            registered at the {@link HttpTransport}
1080      * @param path required
1081      * @return the type of the property as {@link String}
1082      */
1083     Map<String, Boolean> propertyTreeGetFlages(String sessionToken, String path);
1084
1085     /**
1086      * <b>Description taken form digitalSTROM JSON-API:</b><br>
1087      * Sets a given flag of a property.
1088      *
1089      * @param sessionToken can be null, if a
1090      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1091      *            registered at the {@link HttpTransport}
1092      * @param path required
1093      * @param flag required
1094      * @param value required
1095      * @return true, if successful
1096      */
1097     Boolean propertyTreeSetFlag(String sessionToken, String path, String flag, Boolean value);
1098
1099     /**
1100      * <b>Description taken form digitalSTROM JSON-API:</b><br>
1101      * Removes a property node.
1102      *
1103      * @param sessionToken can be null, if a
1104      *            {@link org.openhab.binding.digitalstrom.internal.lib.manager.ConnectionManager} is
1105      *            registered at the {@link HttpTransport}
1106      * @param path required
1107      * @return true, if successful
1108      */
1109     Boolean propertyTreeRemove(String sessionToken, String path);
1110 }