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.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;
41 import com.google.gson.JsonArray;
42 import com.google.gson.JsonObject;
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
48 * @author Alexander Betker - initial contributer
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
55 public interface DsAPI {
58 * Meter field to get all meters by calling {@link #getLatest(String, MeteringTypeEnum, String, MeteringUnitsEnum)}.
59 * It has to be set by meterDSIDs.
61 static final String ALL_METERS = ".meters(all)";
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
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
77 boolean callApartmentScene(String sessionToken, Short groupID, String groupName, Scene sceneNumber, Boolean force);
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}
87 Apartment getApartmentStructure(String sessionToken);
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.
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
98 List<Device> getApartmentDevices(String sessionToken);
101 * Returns an array containing all digitalSTROM-Meters of the apartment.
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
108 List<Circuit> getApartmentCircuits(String sessionToken);
111 * Returns a list of dSID's of all meters(dSMs)
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
118 List<String> getMeterList(String sessionToken);
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.
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
135 boolean callZoneScene(String sessionToken, Integer zoneID, String zoneName, Short groupID, String groupName,
136 SceneEnum sceneNumber, Boolean force);
139 * Turns the device on. This will call the scene "max" on the device.
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
149 boolean turnDeviceOn(String sessionToken, DSID dSID, String dSUID, String deviceName);
152 * Turns the device off. This will call the scene "min" on the device.
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
162 boolean turnDeviceOff(String sessionToken, DSID dSID, String dSUID, String deviceName);
165 * Sets the output value of device.
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
176 boolean setDeviceValue(String sessionToken, DSID dSID, String dSUID, String deviceName, Integer value);
179 * Gets the value of configuration class at offset index.
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
191 DeviceConfig getDeviceConfig(String sessionToken, DSID dSID, String dSUID, String deviceName,
192 DeviceParameterClassEnum clazz, Integer index);
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.
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
208 int getDeviceOutputValue(String sessionToken, DSID dSID, String dSUID, String deviceName, Short offset);
211 * Sets the device output value at the given offset. The available
212 * parameters and offsets depend on the features of the hardware components.
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
224 boolean setDeviceOutputValue(String sessionToken, DSID dSID, String dSUID, String deviceName, Short offset,
228 * Gets the device configuration for a specific scene command.
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
239 DeviceSceneSpec getDeviceSceneMode(String sessionToken, DSID dSID, String dSUID, String deviceName, Short sceneID);
242 * Requests the sensor value for a given index.
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
253 short getDeviceSensorValue(String sessionToken, DSID dSID, String dSUID, String deviceName, Short sensorIndex);
256 * Calls scene sceneNumber on the device.
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
268 boolean callDeviceScene(String sessionToken, DSID dSID, String dSUID, String deviceName, Scene sceneNumber,
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).
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
286 boolean subscribeEvent(String sessionToken, String eventName, Integer subscriptionID, int connectionTimeout,
290 * Unsubscribes from an event given by the name. The subscriptionID is a unique
291 * id that was used in the subscribe call.
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
302 boolean unsubscribeEvent(String sessionToken, String eventName, Integer subscriptionID, int connectionTimeout,
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.
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
319 String getEvent(String sessionToken, Integer subscriptionID, Integer timeout);
322 * Returns the dSS time in UTC seconds since epoch.
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}
329 int getTime(String sessionToken);
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>
335 * <b>Key, value:</b><br>
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>
347 * @return the digitalSTROM-Server software version
349 Map<String, String> getSystemVersion();
352 * Creates a new session using the registered application token
354 * @param applicationToken required
355 * @return sessionToken
357 String loginApplication(String applicationToken);
360 * Creates a new session.
362 * @param user required
363 * @param password required
364 * @return new session token
366 String login(String user, String password);
369 * Destroys the session and signs out the user
371 * @return true, if logout was successful, otherwise false
376 * Returns the dSID of the digitalSTROM Server.
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}
383 Map<String, String> getDSID(String sessionToken);
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.
389 * @param applicationName required
390 * @return applicationToken
392 String requestAppplicationToken(String applicationName);
395 * Revokes an application token, caller must be logged in.
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
403 boolean revokeToken(String applicationToken, String sessionToken);
406 * Enables an application token, caller must be logged in.
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
414 boolean enableApplicationToken(String applicationToken, String sessionToken);
417 * Returns all resolutions stored on this dSS
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
424 List<Integer> getResolutions(String sessionToken);
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
433 * set-syntax, currently it supports: .meters(dsid1,dsid2,...) and .meters(all)
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
443 List<CachedMeteringValue> getLatest(String sessionToken, MeteringTypeEnum type, String meterDSIDs,
444 MeteringUnitsEnum unit);
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}.
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
462 List<CachedMeteringValue> getLatest(String sessionToken, MeteringTypeEnum type, List<String> meterDSIDs,
463 MeteringUnitsEnum unit);
466 * Checks the connection and returns the HTTP-Status-Code.
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
473 int checkConnection(String sessionToken);
476 * Returns the configured scene output value for the given sceneId of the digitalSTROM-Device with the given dSID.
478 * At array position 0 is the output value and at position 1 the angle value, if the device is a blind.
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
489 int[] getSceneValue(String sessionToken, DSID dSID, String dSUID, String deviceName, Short sceneId);
492 * Calls the INC scene on the digitalSTROM-Device with the given dSID and returns true if the request was success.
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
502 boolean increaseValue(String sessionToken, DSID dSID, String dSUID, String deviceName);
505 * Calls the DEC scene on the digitalSTROM-Device with the given dSID and returns true if the request was
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
516 boolean decreaseValue(String sessionToken, DSID dSID, String dSUID, String deviceName);
519 * Undos the given sceneNumer of the digitalSTROM-Device with the given dSID and returns true if the request was
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
531 boolean undoDeviceScene(String sessionToken, DSID dSID, String dSUID, String deviceName, Scene sceneNumber);
534 * Undo the given sceneNumer on the digitalSTROM apartment-group with the given groupID or groupName and returns
536 * if the request was successful.
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
546 boolean undoApartmentScene(String sessionToken, Short groupID, String groupName, Scene sceneNumber);
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.
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
562 boolean undoZoneScene(String sessionToken, Integer zoneID, String zoneName, Short groupID, String groupName,
563 SceneEnum sceneNumber);
566 * Returns user defined name of the digitalSTROM installation.
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
573 String getInstallationName(String sessionToken);
576 * Returns user defined name of the zone from the given zone id.
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
584 String getZoneName(String sessionToken, Integer zoneID);
587 * Returns user defined name of the device from the given dSID
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
596 String getDeviceName(String sessionToken, DSID dSID, String dSUID);
599 * Returns user defined name of the circuit from the given dSID.
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
607 String getCircuitName(String sessionToken, DSID dSID);
610 * Returns user defined name of the scene from the given zoneID, groupID and sceneID.
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
621 String getSceneName(String sessionToken, Integer zoneID, String zoneName, Short groupID, Short sceneID);
624 * Returns the temperature control status to the given zone.
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
633 TemperatureControlStatus getZoneTemperatureControlStatus(String sessionToken, Integer zoneID, String zoneName);
636 * Returns the temperature control configuration of the given zone. It's like the temperature control status added
637 * by the following control values.
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
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
657 TemperatureControlConfig getZoneTemperatureControlConfig(String sessionToken, Integer zoneID, String zoneName);
660 * Returns the temperature control values to their control modes of the given zone.
661 * There are following control modes:
666 * <li>3 Not Used</li>
670 * <li>7 CollingOff</li>
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
680 TemperatureControlValues getZoneTemperatureControlValues(String sessionToken, Integer zoneID, String zoneName);
683 * Set the configuration of the zone temperature control.
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
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
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);
715 * Returns the assigned Sensor dSUID of a zone.
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.
725 AssignedSensors getZoneAssignedSensors(String sessionToken, Integer zoneID, String zoneName);
728 * Sets the temperature control state of a given zone.<br>
729 * Control states: 0=internal; 1=external; 2=exbackup; 3=emergency
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
739 boolean setZoneTemperatureControlState(String sessionToken, Integer zoneID, String zoneName, String controlState);
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.
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
758 boolean setZoneTemperatureControlValues(String sessionToken, Integer zoneID, String zoneName,
759 List<Object[]> controlValues);
762 * Returns the value of a Sensor of the given zone.
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
772 SensorValues getZoneSensorValues(String sessionToken, Integer zoneID, String zoneName);
775 * Set the source of a sensor in a zone to a given device source address.
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
784 * @return success true otherwise false
786 boolean setZoneSensorSource(String sessionToken, Integer zoneID, String zoneName, SensorEnum sensorType, DSID dSID);
789 * Remove all assignments for a particular sensor type in a zone.
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
800 boolean clearZoneSensorSource(String sessionToken, Integer zoneID, String zoneName, SensorEnum sensorType);
803 * Returns internal status information of the temperature control of a zone.
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
812 TemperatureControlInternals getZoneTemperatureControlInternals(String sessionToken, Integer zoneID,
816 * Returns the temperature control status of all zones.
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
823 List<TemperatureControlStatus> getApartmentTemperatureControlStatus(String sessionToken);
826 * Returns the temperature control status of all zones.
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
833 Map<Integer, TemperatureControlConfig> getApartmentTemperatureControlConfig(String sessionToken);
836 * Returns the temperature control status of all zones.
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
843 Map<Integer, TemperatureControlValues> getApartmentTemperatureControlValues(String sessionToken);
846 * Returns the assigned Sensor dSUID of all zones.
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.
854 Map<Integer, AssignedSensors> getApartmentAssignedSensors(String sessionToken);
857 * Returns the value of a Sensor of all zones.
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
864 Map<Integer, BaseSensorValues> getApartmentSensorValues(String sessionToken);
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.
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}
879 JsonObject query(String sessionToken, String query);
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>
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>
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}
896 JsonObject query2(String sessionToken, String query);
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>
902 * <b>Notice:</b> Setting output values directly bypasses the group state machine
903 * and is not recommended.<br>
905 * If the group parameters are omitted the command is sent as broadcast
906 * to all devices in the selected zone. <br>
908 * <b>Notice:</b> Setting output values without a group identification is strongly
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
921 boolean setZoneOutputValue(String sessionToken, Integer zoneID, String zoneName, Short groupID, String groupName,
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
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
938 boolean zoneBlink(String sessionToken, Integer zoneID, String zoneName, Short groupID, String groupName);
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.
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
958 boolean pushZoneSensorValue(String sessionToken, Integer zoneID, String zoneName, Short groupID, String sourceDSUID,
959 Float sensorValue, SensorEnum sensorType);
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’.
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
972 String propertyTreeGetString(String sessionToken, String path);
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
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
985 JsonArray propertyTreeGetChildren(String sessionToken, String path);
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
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
999 Boolean propertyTreeSetString(String sessionToken, String path, String value);
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’.
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
1012 Integer propertyTreeGetInteger(String sessionToken, String path);
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’.
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
1026 Boolean propertyTreeSetInteger(String sessionToken, String path, Integer value);
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’.
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
1039 Boolean propertyTreeGetBoolean(String sessionToken, String path);
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’.
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
1053 Boolean propertyTreeSetBoolean(String sessionToken, String path, Boolean value);
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
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}
1066 String propertyTreeGetType(String sessionToken, String path);
1069 * Returns the flag values of a property as {@link Map}. The key is the flag type and the value the {@link Boolean}
1072 * Flag types are:<br>
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}
1083 Map<String, Boolean> propertyTreeGetFlages(String sessionToken, String path);
1086 * <b>Description taken form digitalSTROM JSON-API:</b><br>
1087 * Sets a given flag of a property.
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
1097 Boolean propertyTreeSetFlag(String sessionToken, String path, String flag, Boolean value);
1100 * <b>Description taken form digitalSTROM JSON-API:</b><br>
1101 * Removes a property node.
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
1109 Boolean propertyTreeRemove(String sessionToken, String path);