]> git.basschouten.com Git - openhab-addons.git/blob
fd064b6be77d3a81705c4eb5b575e36816ad5c29
[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.structure.devices;
14
15 import java.util.List;
16 import java.util.Map;
17
18 import org.openhab.binding.digitalstrom.internal.lib.config.Config;
19 import org.openhab.binding.digitalstrom.internal.lib.event.constants.EventNames;
20 import org.openhab.binding.digitalstrom.internal.lib.event.types.EventItem;
21 import org.openhab.binding.digitalstrom.internal.lib.sensorjobexecutor.sensorjob.impl.DeviceConsumptionSensorJob;
22 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.DeviceSceneSpec;
23 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.DeviceStateUpdate;
24 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.ApplicationGroup;
25 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.DeviceBinarayInputEnum;
26 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.OutputChannelEnum;
27 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.OutputModeEnum;
28 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.SensorEnum;
29 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DSID;
30 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DeviceBinaryInput;
31 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DeviceSensorValue;
32 import org.openhab.binding.digitalstrom.internal.lib.structure.scene.InternalScene;
33
34 /**
35  * The {@link Device} represents a digitalSTROM internal stored device.
36  *
37  * @author Alexander Betker - Initial contribution
38  * @author Michael Ochel - add methods for ESH, new functionalities and JavaDoc
39  * @author Mathias Siegele - add methods for ESH, new functionalities and JavaDoc
40  */
41 public interface Device extends GeneralDeviceInformation {
42
43     /**
44      * Returns the id of the dS-Meter in which the device is registered.
45      *
46      * @return meterDSID
47      */
48     DSID getMeterDSID();
49
50     /**
51      * Sets the id of the dS-Meter in which the device is registered.
52      *
53      * @param meterDSID to set
54      */
55
56     void setMeterDSID(String meterDSID);
57
58     /**
59      * Returns the hardware info of this device.
60      * You can see all available hardware info at
61      * http://www.digitalstrom.com/Partner/Support/Techn-Dokumentation/
62      *
63      * @return hardware info
64      */
65     String getHWinfo();
66
67     /**
68      * Returns the zone id in which this device is in.
69      *
70      * @return zoneID
71      */
72     int getZoneId();
73
74     /**
75      * Sets the zoneID of this device.
76      *
77      * @param zoneID to set
78      */
79     void setZoneId(int zoneID);
80
81     /**
82      * Returns true, if this device is on, otherwise false.
83      *
84      * @return is on (true = on | false = off)
85      */
86     boolean isOn();
87
88     /**
89      * Adds an on command as {@link DeviceStateUpdate}, if the flag is true or off command, if it is false to the list
90      * of
91      * outstanding commands.
92      *
93      * @param flag (true = on | false = off)
94      */
95     void setIsOn(boolean flag);
96
97     /**
98      * Returns true, if this shade device is open, otherwise false.
99      *
100      * @return is on (true = open | false = closed)
101      */
102     boolean isOpen();
103
104     /**
105      * Adds an open command as {@link DeviceStateUpdate}, if the flag is true or closed command, if it is false to the
106      * list of outstanding commands.
107      *
108      * @param flag (true = open | false = closed)
109      */
110     void setIsOpen(boolean flag);
111
112     /**
113      * Returns true, if this device is dimmable, otherwise false.
114      *
115      * @return is dimmable (true = yes | false = no)
116      */
117     boolean isDimmable();
118
119     /**
120      * Returns true, if this device is a shade device (grey), otherwise false.
121      *
122      * @return is shade (true = yes | false = no)
123      */
124     boolean isShade();
125
126     /**
127      * Returns true, if the device output mode isn't disabled.
128      *
129      * @return have output mode (true = yes | false = no)
130      */
131     boolean isDeviceWithOutput();
132
133     /**
134      * Returns the current functional color group of this device.
135      * For more informations please have a look at {@link FunctionalColorGroupEnum}.
136      *
137      * @return current functional color group
138      */
139     ApplicationGroup getFunctionalColorGroup();
140
141     /**
142      * Sets the functional color group of this device.
143      *
144      * @param fuctionalColorGroup to set
145      */
146     void setFunctionalColorGroup(ApplicationGroup fuctionalColorGroup);
147
148     /**
149      * Returns the current output mode of this device.
150      * Some devices are able to have different output modes e.g. the device GE-KM200 is able to
151      * be in dimm mode, switch mode or disabled.
152      * For more informations please have a look at {@link OutputModeEnum}.
153      *
154      * @return the current output mode of this device
155      */
156     OutputModeEnum getOutputMode();
157
158     List<OutputChannelEnum> getOutputChannels();
159
160     /**
161      * Adds an increase command as {@link DeviceStateUpdate} to the list of outstanding commands.
162      */
163     void increase();
164
165     /**
166      * Adds a decrease command as {@link DeviceStateUpdate} to the list of outstanding commands.
167      */
168     void decrease();
169
170     /**
171      * Returns the current slat position of this device.
172      *
173      * @return current slat position
174      */
175     int getSlatPosition();
176
177     /**
178      * Adds a set slat position command as {@link DeviceStateUpdate} with the given slat position to the list of
179      * outstanding commands.
180      *
181      * @param slatPosition to set
182      */
183     void setSlatPosition(int slatPosition);
184
185     /**
186      * Returns the maximal slat position value of this device.
187      *
188      * @return maximal slat position value
189      */
190     int getMaxSlatPosition();
191
192     /**
193      * Returns the minimal slat position value of this device.
194      *
195      * @return minimal slat position value
196      */
197     int getMinSlatPosition();
198
199     /**
200      * Returns the current output value of this device.
201      * This can be the slat position or the brightness of this device.
202      *
203      * @return current output value
204      */
205     short getOutputValue();
206
207     /**
208      * Adds a set output value command as {@link DeviceStateUpdate} with the given output value to the list of
209      * outstanding commands.
210      *
211      * @param outputValue to set
212      */
213     void setOutputValue(short outputValue);
214
215     /**
216      * Returns the maximal output value of this device.
217      *
218      * @return maximal output value
219      */
220     short getMaxOutputValue();
221
222     /**
223      * Returns a list with group ids which the device is part of.
224      *
225      * @return List of group ids
226      */
227     List<Short> getGroups();
228
229     /**
230      * Adds the given groupID to the group list.
231      *
232      * @param groupID to add
233      */
234     void addGroup(Short groupID);
235
236     /**
237      * Overrides the existing group list with the given new.
238      *
239      * @param newGroupList to set
240      */
241     void setGroups(List<Short> newGroupList);
242
243     /**
244      * Returns the scene output value of this device of the given scene id as {@link Integer} array. The first field is
245      * the output value and the second is the angle value or -1 if no angle value exists.
246      * If the method returns null, this scene id isn't read yet.
247      *
248      * @param sceneID of the scene
249      * @return scene output value and scene angle value or null, if it isn't read out yet
250      */
251     Integer[] getSceneOutputValue(short sceneID);
252
253     /**
254      * Sets the scene output value of this device for the given scene id and scene output value.
255      *
256      * @param sceneId to set
257      * @param sceneOutputValue to set
258      */
259     void setSceneOutputValue(short sceneId, int sceneOutputValue);
260
261     /**
262      * This configuration is very important. The devices can
263      * be configured to not react to some commands (scene calls).
264      * So you can't imply that a device automatically turns on (by default yes,
265      * but if someone configured his own scenes, then maybe not) after a
266      * scene call. This method returns true or false, if the configuration
267      * for this sceneID already has been read
268      *
269      * @param sceneId the sceneID
270      * @return true if this device has the configuration for this specific scene
271      */
272     boolean containsSceneConfig(short sceneId);
273
274     /**
275      * Add the config for this scene. The config has the configuration
276      * for the specific sceneID.
277      *
278      * @param sceneId scene call id
279      * @param sceneSpec config for this sceneID
280      */
281     void addSceneConfig(short sceneId, DeviceSceneSpec sceneSpec);
282
283     /**
284      * Get the config for this scene. The config has the configuration
285      * for the specific sceneID.
286      *
287      * @param sceneId scene call id
288      * @return sceneSpec config for this sceneID
289      */
290     DeviceSceneSpec getSceneConfig(short sceneId);
291
292     /**
293      * Should the device react on this scene call or not .
294      *
295      * @param sceneId scene call id
296      * @return true, if this device should react on this sceneID
297      */
298     boolean doIgnoreScene(short sceneId);
299
300     // follow methods added by Michael Ochel and Matthias Siegele
301     /**
302      * Returns true, if all sensor data are up to date or false if some have to be updated.
303      *
304      * @return is up to date (true = yes | false = no)
305      */
306     boolean isSensorDataUpToDate();
307
308     /**
309      * Sets the priority to refresh the data of the sensors to the given priorities.
310      * They can be never, low, medium or high.
311      *
312      * @param powerConsumptionRefreshPriority to set
313      * @param electricMeterRefreshPriority to set
314      * @param energyMeterRefreshPriority to set
315      */
316     void setSensorDataRefreshPriority(String powerConsumptionRefreshPriority, String electricMeterRefreshPriority,
317             String energyMeterRefreshPriority);
318
319     /**
320      * Returns true, if the device is up to date.
321      *
322      * @return digitalSTROM-Device is up to date (true = yes | false = no)
323      */
324     boolean isDeviceUpToDate();
325
326     /**
327      * Returns the next {@link DeviceStateUpdate} to update the digitalSTROM-Device on the digitalSTROM-Server.
328      *
329      * @return DeviceStateUpdate for digitalSTROM-Device
330      */
331     DeviceStateUpdate getNextDeviceUpdateState();
332
333     /**
334      * Update the internal stored device object.
335      *
336      * @param deviceStateUpdate to update
337      */
338     void updateInternalDeviceState(DeviceStateUpdate deviceStateUpdate);
339
340     /**
341      * Call the given {@link InternalScene} on this {@link Device} and updates it.
342      *
343      * @param scene to call
344      */
345     void callInternalScene(InternalScene scene);
346
347     /**
348      * Undo the given {@link InternalScene} on this {@link Device} and updates it.
349      *
350      * @param scene to undo
351      */
352     void undoInternalScene(InternalScene scene);
353
354     /**
355      * Initial a call scene for the given scene number.
356      *
357      * @param sceneNumber to call
358      */
359     void callScene(Short sceneNumber);
360
361     /**
362      * Returns the current active {@link InternalScene}, otherwise null.
363      *
364      * @return active {@link InternalScene} or null
365      */
366     InternalScene getAcitiveScene();
367
368     /**
369      * Undo the active scene if a scene is active.
370      */
371     void undoScene();
372
373     /**
374      * Checks the scene configuration for the given scene number and initial a scene configuration reading with the
375      * given priority if no scene configuration exists.
376      *
377      * @param sceneNumber to check
378      * @param prio to update
379      */
380     void checkSceneConfig(Short sceneNumber, short prio);
381
382     /**
383      * Sets the given output mode as new output mode of this {@link Device}.
384      *
385      * @param newOutputMode to set
386      */
387     void setOutputMode(OutputModeEnum newOutputMode);
388
389     /**
390      * Returns a {@link List} of all saved scene-IDs configurations.
391      *
392      * @return a {@link List} of all saved scene-IDs
393      */
394     List<Short> getSavedScenes();
395
396     /**
397      * Initializes an internal device update as call scene for the given scene number.
398      *
399      * @param sceneNumber to call
400      */
401     void internalCallScene(Short sceneNumber);
402
403     /**
404      * Initializes an internal device update as undo scene.
405      */
406     void internalUndoScene();
407
408     /**
409      * Returns true, if this {@link Device} is a device with a switch output mode.
410      *
411      * @return true, if it is a switch otherwise false
412      */
413     boolean isSwitch();
414
415     /**
416      * Sets the given {@link Config} as new {@link Config}.
417      *
418      * @param config to set
419      */
420     void setConfig(Config config);
421
422     /**
423      * Returns the current angle position of the {@link Device}.
424      *
425      * @return current angle position
426      */
427     short getAnglePosition();
428
429     /**
430      * Adds a set angle value command as {@link DeviceStateUpdate} with the given angle value to the list of
431      * outstanding commands.
432      *
433      * @param angle to set
434      */
435     void setAnglePosition(int angle);
436
437     /**
438      * Sets the scene output value and scene output angle of this device for the given scene id, scene output value and
439      * scene output angle.
440      *
441      * @param sceneId to set
442      * @param value to set
443      * @param angle to set
444      */
445     void setSceneOutputValue(short sceneId, int value, int angle);
446
447     /**
448      * Returns the max angle value of the slat.
449      *
450      * @return max slat angle
451      */
452     int getMaxSlatAngle();
453
454     /**
455      * Returns the min angle value of the slat.
456      *
457      * @return min slat angle
458      */
459     int getMinSlatAngle();
460
461     /**
462      * Returns true, if it is a blind device.
463      *
464      * @return is blind (true = yes | false = no
465      */
466     boolean isBlind();
467
468     /**
469      * Saves scene configurations from the given sceneProperties in the {@link Device}. <br>
470      * The {@link Map} has to be like the following format:
471      * <ul>
472      * <li><b>Key:</b> scene[sceneID]</li>
473      * <li><b>Value:</b> {Scene: [sceneID], dontcare: [don't care flag], localPrio: [local prio flag], specialMode:
474      * [special mode flag]}(0..1), {sceneValue: [scene value], sceneAngle: [scene angle]}(0..1))</li>
475      * </ul>
476      *
477      * @param sceneProperties to save
478      */
479     void saveConfigSceneSpecificationIntoDevice(Map<String, String> sceneProperties);
480
481     /**
482      * Returns the min output value.
483      *
484      * @return min output value
485      */
486     short getMinOutputValue();
487
488     /**
489      * Adds a slat increase command as {@link DeviceStateUpdate} to the list of outstanding commands.
490      */
491     void increaseSlatAngle();
492
493     /**
494      * Adds a slat decrease command as {@link DeviceStateUpdate} to the list of outstanding commands.
495      */
496     void decreaseSlatAngle();
497
498     /**
499      * Saves scene configurations from the given sceneProperties in the {@link Device}. <br>
500      * <br>
501      * <b>The {@link String} has to be like the following format:</b><br>
502      * {[sceneID] = }(1){Scene: [sceneID], dontcare: [don't care flag], localPrio: [local prio flag], specialMode:
503      * [special mode flag]}(0..1), {sceneValue: [sceneValue]{, sceneAngle: [scene angle]}(0..1)}{\n}(0..1)<br>
504      * <br>
505      * e.g. "10 = Scene: PRESET_4, dontcare: false, localPrio: false, specialMode: false, flashMode: false, sceneValue:
506      * 0\n"
507      *
508      * @param propertries to save
509      */
510     void saveConfigSceneSpecificationIntoDevice(String propertries);
511
512     /**
513      * Returns true, if this {@link Device} is a sensor device. That means, that this {@link Device} has no output
514      * channel
515      * ({@link OutputModeEnum#DISABLED}), but climate sensors.
516      *
517      * @return true, if it is a sensor device
518      */
519     boolean isSensorDevice();
520
521     /**
522      * Returns true, if this {@link Device} is a heating device. That means, that the output mode of this {@link Device}
523      * is one of the following modes {@link OutputModeEnum#PWM} or {@link OutputModeEnum#SWITCH} and the
524      * {@link FuncNameAndColorGroupEnum} is {@link FuncNameAndColorGroupEnum#HEATING}.
525      *
526      * @return true, if it is a heating device
527      */
528     boolean isHeatingDevice();
529
530     /**
531      * Sets the refresh priority for the given power sensor as {@link SensorEnum}. <br>
532      * <b>Note:</b><br>
533      * 1. The device must have this sensor type, otherwise the set has no effect.<br>
534      * <br>
535      * 2. Valid priorities are:<br>
536      * - {@link Config#REFRESH_PRIORITY_NEVER}<br>
537      * - {@link Config#REFRESH_PRIORITY_LOW}<br>
538      * - {@link Config#REFRESH_PRIORITY_MEDIUM}<br>
539      * - {@link Config#REFRESH_PRIORITY_HIGH}<br>
540      * <br>
541      * 3. Valid sensor types are:<br>
542      * - {@link SensorEnum#POWER_CONSUMPTION}<br>
543      * - {@link SensorEnum#OUTPUT_CURRENT}<br>
544      * - {@link SensorEnum#ELECTRIC_METER}<br>
545      * - {@link SensorEnum#ACTIVE_POWER}<br>
546      *
547      * @param powerSensorType the power sensor to set
548      * @param refreshPriority the new refresh priority
549      */
550     void setSensorDataRefreshPriority(SensorEnum powerSensorType, String refreshPriority);
551
552     /**
553      * Returns the refresh priority of the given power sensor type as {@link SensorEnum}. If the sensor type is not
554      * supported by
555      * this {@link Device} or it is not a power sensor it will be returned null.
556      *
557      * @param powerSensorType of the sensor
558      * @return the refresh priority
559      */
560     String getPowerSensorRefreshPriority(SensorEnum powerSensorType);
561
562     /**
563      * Returns a {@link List} with all power sensors, which are supported by this {@link Device}.
564      *
565      * @return all supported power sensors
566      */
567     List<SensorEnum> getPowerSensorTypes();
568
569     /**
570      * Returns a {@link List} with all climate sensors, which are supported by this {@link Device}.
571      *
572      * @return all supported climate sensors
573      */
574     List<SensorEnum> getClimateSensorTypes();
575
576     /**
577      * Returns all {@link DeviceSensorValue}'s of this {@link Device}.
578      *
579      * @return list of all {@link DeviceSensorValue}'s
580      */
581     List<DeviceSensorValue> getDeviceSensorValues();
582
583     /**
584      * Sets the given {@link DeviceSensorValue}. That means the given {@link DeviceSensorValue} will be added, if this
585      * type of {@link DeviceSensorValue} does not exist before, otherwise the existing {@link DeviceSensorValue} will be
586      * updated,
587      * if the given {@link DeviceSensorValue} is newer.
588      *
589      * @param deviceSensorValue the new device sensor value
590      */
591     void setDeviceSensorValue(DeviceSensorValue deviceSensorValue);
592
593     /**
594      * Returns the {@link DeviceSensorValue} of the given sensor type as {@link SensorEnum} or null, if no
595      * {@link DeviceSensorValue} exists for the given sensor type.
596      *
597      * @param sensorType of the sensor
598      * @return the {@link DeviceSensorValue} or null
599      */
600     DeviceSensorValue getDeviceSensorValue(SensorEnum sensorType);
601
602     /**
603      * Returns the {@link DeviceSensorValue} of the given sensor index as {@link Short} or null, if no
604      * {@link DeviceSensorValue} exists for the given sensor index.
605      *
606      * @param sensorIndex of the sensor
607      * @return the {@link DeviceSensorValue} or null
608      */
609     DeviceSensorValue getDeviceSensorValue(Short sensorIndex);
610
611     /**
612      * Returns the sensor index for the given sensor type as {@link SensorEnum} of the {@link Device} or null, if the
613      * sensor type does not exist. It will be needed to readout the current sensor value of the digitalSTROM device.
614      *
615      * @param sensorType of the sensor
616      * @return sensor index for the sensor type
617      */
618     Short getSensorIndex(SensorEnum sensorType);
619
620     /**
621      * Returns the sensor type as {@link SensorEnum} of the given sensor index or null, if the given sensor type does
622      * not exist.
623      *
624      * @param sensorIndex of the sensor
625      * @return the sensor type or null
626      */
627     SensorEnum getSensorType(Short sensorIndex);
628
629     /**
630      * Returns the internal digitalSTROM sensor value for the given sensor type as {@link SensorEnum}, if the sensor
631      * type exists and the value is valid. The resolution can be found at {@link SensorEnum}.
632      *
633      * @param sensorType of the sensor
634      * @return the internal digitalSTROM sensor value or null
635      */
636     Integer getDsSensorValue(SensorEnum sensorType);
637
638     /**
639      * Returns the internal digitalSTROM sensor value for the given sensor index as {@link Short}, if the sensor
640      * index exists and the value is valid. The resolution can be found at {@link SensorEnum}.
641      *
642      * @param sensorIndex of the sensor
643      * @return the internal digitalSTROM sensor value or null
644      */
645     Integer getDsSensorValue(Short sensorIndex);
646
647     /**
648      * Returns the float sensor value for the given sensor type as {@link SensorEnum}, if the sensor
649      * type exists and the value is valid. The resolution can be found at {@link SensorEnum}.
650      *
651      * @param sensorType of the sensor
652      * @return the float sensor value or null
653      */
654     Float getFloatSensorValue(SensorEnum sensorType);
655
656     /**
657      * Returns the float sensor value for the given sensor index as {@link Short}, if the sensor
658      * index exists and the value is valid. The resolution can be found at {@link SensorEnum}.
659      *
660      * @param sensorIndex of the sensor
661      * @return the float sensor value or null
662      */
663     Float getFloatSensorValue(Short sensorIndex);
664
665     /**
666      * Sets the float sensor value for a given sensor type as {@link SensorEnum}. If the sensor type does not exist, it
667      * will be returned false.
668      *
669      * @param sensorType of the sensor
670      * @param floatSensorValue the new float sensor value
671      * @return true, if it was successful, otherwise false
672      */
673     boolean setFloatSensorValue(SensorEnum sensorType, Float floatSensorValue);
674
675     /**
676      * Sets the float sensor value for a given sensor index as {@link Short}. If the sensor type does not exist, it
677      * will be returned false.
678      *
679      * @param sensorIndex of the sensor
680      * @param floatSensorValue the new float sensor value
681      * @return true, if it was successful, otherwise false
682      */
683     boolean setFloatSensorValue(Short sensorIndex, Float floatSensorValue);
684
685     /**
686      * Sets the internal digitalSTROM sensor value for a given sensor index as {@link Short}. If the sensor index does
687      * not exist, it will be returned false.
688      *
689      * @param sensorIndex of the sensor
690      * @param dSSensorValue the new internal digitalSTROM sensor value
691      * @return true, if it was successful, otherwise false
692      */
693     boolean setDsSensorValue(Short sensorIndex, Integer dSSensorValue);
694
695     /**
696      * Sets the internal digitalSTROM sensor value for a given sensor type as {@link SensorEnum}. If the sensor type
697      * does
698      * not exist, it will be returned false.
699      *
700      * @param sensorType of the sensor
701      * @param dSSensorValue the new internal digitalSTROM sensor value
702      * @return true, if it was successful, otherwise false
703      */
704     boolean setDsSensorValue(SensorEnum sensorType, Integer dSSensorValue);
705
706     /**
707      * Sets the internal digitalSTROM and float sensor value for a given sensor index as {@link Short}. If the sensor
708      * index does not exist, it will be returned false.
709      *
710      * @param sensorIndex of the sensor
711      * @param dSSensorValue the new internal digitalSTROM sensor value
712      * @param floatSensorValue the new float sensor value
713      * @return true, if it was successful, otherwise false
714      */
715     boolean setDsSensorValue(Short sensorIndex, Integer dSSensorValue, Float floatSensorValue);
716
717     /**
718      * Sets the internal digitalSTROM and float sensor value for a given sensor type as {@link SensorEnum}. If the
719      * sensor type does not exist, it will be returned false.
720      *
721      * @param sensorType of the sensor
722      * @param dSSensorValue the new internal digitalSTROM sensor value
723      * @param floatSensorValue the new float sensor value
724      * @return true, if it was successful, otherwise false
725      */
726     boolean setDsSensorValue(SensorEnum sensorType, Integer dSSensorValue, Float floatSensorValue);
727
728     /**
729      * Returns true, if this {@link Device} has sensors, otherwise false.
730      *
731      * @return true, if device has sensors
732      */
733     boolean hasSensors();
734
735     /**
736      * Returns true, if this {@link Device} has climate sensors, otherwise false.
737      *
738      * @return true, if device has climate sensors
739      */
740     boolean hasClimateSensors();
741
742     /**
743      * Returns true, if this {@link Device} has power sensors, otherwise false.
744      *
745      * @return true, if device has power sensors
746      */
747     boolean hasPowerSensors();
748
749     /**
750      * Only needed for {@link DeviceConsumptionSensorJob}'s. To set the internal digitalSTROM sensor value please use
751      * {@link #setDsSensorValue(SensorEnum, Integer)}.
752      *
753      * @param sensorType of the sensor
754      * @param value new value
755      */
756     void setDeviceSensorDsValueBySensorJob(SensorEnum sensorType, Integer value);
757
758     /**
759      * Enables the internal sensor echo box for {@link EventNames#DEVICE_SENSOR_VALUE} events.
760      */
761     void enableSensorEchoBox();
762
763     /**
764      * Disables the internal sensor echo box for {@link EventNames#DEVICE_SENSOR_VALUE} events.
765      */
766     void disableSensorEchoBox();
767
768     /**
769      * Returns true, if the internal sensor echo box is enabled, otherwise false.
770      *
771      * @return true, if the internal sensor echo box is enabled
772      */
773     boolean isSensorEchoBoxEnabled();
774
775     /**
776      * Sets the {@link DeviceSensorValue} through an {@link EventItem} of the type
777      * {@link EventNames#DEVICE_SENSOR_VALUE}.
778      *
779      * @param event of the sensor update
780      */
781     void setDeviceSensorByEvent(EventItem event);
782
783     /**
784      * Returns true, if the refresh priority of the given power sensor type as {@link SensorEnum} is equals
785      * {@link Config#REFRESH_PRIORITY_NEVER}, otherwise false.
786      *
787      * @param powerSensorType of the sensor
788      * @return true, if refresh priority is never
789      */
790     boolean checkPowerSensorRefreshPriorityNever(SensorEnum powerSensorType);
791
792     /**
793      * Returns true, if the given sensor type as {@link SensorEnum} is supported by this {@link Device}, otherwise
794      * false.
795      *
796      * @param sensorType of the sensor
797      * @return true, if the sensor type is supported
798      */
799     boolean supportsSensorType(SensorEnum sensorType);
800
801     /**
802      * Returns true, if this {@link Device} is a temperature controlled device, otherwise false. That means, that the
803      * output mode is one of the output modes in
804      * {@link OutputModeEnum#outputModeIsTemperationControlled(OutputModeEnum)}.
805      *
806      * @return true, if this {@link Device} is a temperature controlled
807      */
808     boolean isTemperatureControlledDevice();
809
810     /**
811      * Returns true, if this {@link Device} is a binary input device. That means it have no output mode
812      * ({@link OutputModeEnum#DISABLED}), but {@link DeviceBinaryInput}'s.
813      *
814      * @return true, if this {@link Device} is a binary input device
815      */
816     boolean isBinaryInputDevice();
817
818     /**
819      * Returns a {@link List} which contains all currently configured {@link DeviceBinaryInput}'s.
820      *
821      * @return list with all configured {@link DeviceBinaryInput}'s
822      */
823     List<DeviceBinaryInput> getBinaryInputs();
824
825     /**
826      * Returns the {@link DeviceBinaryInput} of the given binary input type as {@link DeviceBinarayInputEnum}} or null,
827      * if the binary input type does not exist.
828      *
829      * @param binaryInputType of the {@link DeviceBinaryInput}
830      * @return the {@link DeviceBinaryInput} or null
831      */
832     DeviceBinaryInput getBinaryInput(DeviceBinarayInputEnum binaryInputType);
833
834     /**
835      * Returns the state of the given binary input type as {@link DeviceBinarayInputEnum}} or null, if the binary input
836      * type does not exist.
837      *
838      * @param binaryInputType of the {@link DeviceBinaryInput}
839      * @return state of the given binary input type or null
840      */
841     Short getBinaryInputState(DeviceBinarayInputEnum binaryInputType);
842
843     /**
844      * Sets the state of an existing {@link DeviceBinaryInput}. If the given {@link DeviceBinarayInputEnum} does not
845      * exist, it will returned false, otherwise true.
846      *
847      * @param binaryInputType of the {@link DeviceBinaryInput}
848      * @param newState the new state
849      * @return true, if it was successful, otherwise false
850      */
851     boolean setBinaryInputState(DeviceBinarayInputEnum binaryInputType, Short newState);
852
853     /**
854      * Sets the given {@link List} of {@link DeviceBinaryInput}'s as supported binary inputs.
855      *
856      * @param newBinaryInputs to set
857      */
858     void setBinaryInputs(List<DeviceBinaryInput> newBinaryInputs);
859
860     /**
861      * Returns true, if the given power sensor type as {@link SensorEnum} is up to date and does not need a refresh,
862      * otherwise it will returned false.
863      *
864      * @param powerSensorType of the sensor
865      * @return true, if the power sensor is up to date
866      */
867     boolean isPowerSensorUpToDate(SensorEnum powerSensorType);
868
869     /**
870      * Returns a {@link List} of all supported sensor types as {@link SensorEnum}.
871      *
872      * @return all supported sensor types
873      */
874     List<SensorEnum> getSensorTypes();
875 }