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.structure.scene.constants;
15 import java.util.HashMap;
19 * The {@link SceneEnum} lists all available scenes of digitalSTROM.
21 * @author Alexander Betker - initial contributer
22 * @version digitalSTROM-API 1.14.5
24 * @author Michael Ochel - add new scenes and missing java-doc
25 * @author Mathias Siegele - add new scenes and missing java-doc
28 public enum SceneEnum implements Scene {
31 * see http://developer.digitalstrom.org/Architecture/ds-basics.pdf appendix B, page 44
34 /* Area scene commands */
35 AREA_1_OFF((short) 1), // Set output value to Preset Area 1 Off (Default: Off)
36 AREA_1_ON((short) 6), // Set output value to Preset Area 1 On (Default: On)
37 AREA_1_INCREMENT((short) 43), // Initial command to increment output value
38 AREA_1_DECREMENT((short) 42), // Initial command to decrement output value
39 AREA_1_STOP((short) 52), // Stop output value change at current position
40 AREA_STEPPING_CONTINUE((short) 10), // Next step to increment or decrement
42 AREA_2_OFF((short) 2), // Set output value to Area 2 Off (Default: Off)
43 AREA_2_ON((short) 7), // Set output value to Area 2 On (Default: On)
44 AREA_2_INCREMENT((short) 45), // Initial command to increment output value
45 AREA_2_DECREMENT((short) 44), // Initial command to decrement output value
46 AREA_2_STOP((short) 53), // Stop output value change at current position
48 AREA_3_OFF((short) 3), // Set output value to Area 3 Off (Default: Off)
49 AREA_3_ON((short) 8), // Set output value to Area 3 On (Default: On)
50 AREA_3_INCREMENT((short) 47), // Initial command to increment output value
51 AREA_3_DECREMENT((short) 46), // Initial command to decrement output value
52 AREA_3_STOP((short) 54), // Stop output value change at current position
54 AREA_4_OFF((short) 4), // Set output value to Area 4 Off (Default: Off)
55 AREA_4_ON((short) 9), // Set output value to Area 4 On (Default: On)
56 AREA_4_INCREMENT((short) 49), // Initial command to increment output value
57 AREA_4_DECREMENT((short) 48), // Initial command to decrement output value
58 AREA_4_STOP((short) 55), // Stop output value change at current position
60 /* local pushbutton scene commands */
61 DEVICE_ON((short) 51), // Local on
62 DEVICE_OFF((short) 50), // Local off
63 DEVICE_STOP((short) 15), // Stop output value change at current position
65 /* special scene commands */
66 MINIMUM((short) 13), // Minimum output value
67 MAXIMUM((short) 14), // Maximum output value
68 STOP((short) 15), // Stop output value change at current position
69 AUTO_OFF((short) 40), // slowly fade down to off
71 /* stepping scene commands */
72 INCREMENT((short) 12), // Increment output value (in the basic.pdf it is 11 but its wrong)
73 DECREMENT((short) 11), // Decrement output value (in the basic.pdf it is 12 but its wrong)
76 PRESET_0((short) 0), // Set output value to Preset 0 (Default: Off)
77 PRESET_1((short) 5), // Set output value to Preset 1 (Default: On)
78 PRESET_2((short) 17), // Set output value to Preset 2
79 PRESET_3((short) 18), // Set output value to Preset 3
80 PRESET_4((short) 19), // Set output value to Preset 4
82 PRESET_10((short) 32), // Set output value to Preset 10 (Default: Off)
83 PRESET_11((short) 33), // Set output value to Preset 11 (Default: On)
84 PRESET_12((short) 20), // Set output value to Preset 12
85 PRESET_13((short) 21), // Set output value to Preset 13
86 PRESET_14((short) 22), // Set output value to Preset 14
88 PRESET_20((short) 34), // Set output value to Preset 20 (Default: Off)
89 PRESET_21((short) 35), // Set output value to Preset 21 (Default: On)
90 PRESET_22((short) 23), // Set output value to Preset 22
91 PRESET_23((short) 24), // Set output value to Preset 23
92 PRESET_24((short) 25), // Set output value to Preset 24
94 PRESET_30((short) 36), // Set output value to Preset 30 (Default: Off)
95 PRESET_31((short) 37), // Set output value to Preset 31 (Default: On)
96 PRESET_32((short) 26), // Set output value to Preset 32
97 PRESET_33((short) 27), // Set output value to Preset 33
98 PRESET_34((short) 28), // Set output value to Preset 34
100 PRESET_40((short) 38), // Set output value to Preset 40 (Default: Off)
101 PRESET_41((short) 39), // Set output value to Preset 41 (Default: On)
102 PRESET_42((short) 29), // Set output value to Preset 42
103 PRESET_43((short) 30), // Set output value to Preset 43
104 PRESET_44((short) 31), // Set output value to Preset 44
106 /* group independent scene commands */
107 DEEP_OFF((short) 68),
108 ENERGY_OVERLOAD((short) 66),
110 ZONE_ACTIVE((short) 75),
111 ALARM_SIGNAL((short) 74),
112 AUTO_STANDBY((short) 64),
115 SLEEPING((short) 69),
117 DOOR_BELL((short) 73),
131 private final short sceneNumber;
132 static final Map<Short, SceneEnum> DIGITALSTROM_SCENES = new HashMap<>();
135 for (SceneEnum zs : SceneEnum.values()) {
136 DIGITALSTROM_SCENES.put(zs.getSceneNumber(), zs);
140 private SceneEnum(short sceneNumber) {
141 this.sceneNumber = sceneNumber;
145 * Returns the {@link SceneEnum} for the given scene number.
147 * @param sceneNumber of the {@link SceneEnum}
150 public static SceneEnum getScene(short sceneNumber) {
151 return DIGITALSTROM_SCENES.get(sceneNumber);
155 * Returns true, if the given scene number contains in digitalSTROM scenes, otherwise false.
157 * @param sceneNumber to be checked
158 * @return true, if contains otherwise false
160 public static boolean containsScene(Short sceneNumber) {
161 return DIGITALSTROM_SCENES.keySet().contains(sceneNumber);
165 public Short getSceneNumber() {
166 return this.sceneNumber;