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.devices.deviceparameters.constants;
16 * This enum contains all binary inputs with they id. <br>
18 * @author Michael Ochel - initial contributer
19 * @author Matthias Siegele - initial contributer
21 public enum DeviceBinarayInputEnum {
24 * Taken from http://developer.digitalstrom.org/Architecture/ds-basics.pdf#5f
26 * Input Type | Assigned Index | Natural Device and Description
27 * Presence | 1 | Presence detector
28 * Brightness | 2 | ---
29 * Presence in darkness | 3 | Presence detector with activated internal twilight sensor
30 * Twilight | 4 | Twilight sensor
31 * Motion | 5 | Motion detector
32 * Motion in darkness | 6 | Motion detect or with activated internal twilight sensor
33 * Smoke | 7 | Smoke Detector
34 * Wind strength above limit | 8 | Wind monitor with user-adjusted wind strength threshold
35 * Rain | 9 | Rain monitor
36 * Sun radiation | 10 | Sun light above threshold
37 * Temperature below limit | 11 | Room thermostat with used-adjusted temperature threshold
38 * Battery status is low | 12 | electric battery is running out of power
39 * Window is open | 13 | Window contact
40 * Door is open | 14 | Door contact
41 * Window is tilted | 15 | Window handle; window is tilted instead of fully opened
42 * Garage door is open | 16 | Garage door contact
43 * Sun protection | 17 | Protect against too much sun light
44 * Frost | 18 | Frost detector
45 * --dS-Basics Version: v1.3-branch August 19, 2015, Table 16: Binary input types--
47 * Heating operation on/off | 19 |
48 * Change-over heating/cooling | 20 |
49 * --dS-web-interface server-version: 1.21.1--
52 * Target Function | Assigned Index
54 * --dS-Basics Version: v1.3-branch August 19, 2015, Table 17: Binary input target functions--
58 BRIGHTNESS((short) 2),
59 PRESENCE_IN_DARKNESS((short) 3),
62 MOTION_IN_DARKNESS((short) 6),
64 WIND_STRENGHT_ABOVE_LIMIT((short) 8),
66 SUN_RADIATION((short) 10),
67 TEMPERATION_BELOW_LIMIT((short) 11),
68 BATTERY_STATUS_IS_LOW((short) 12),
69 WINDOW_IS_OPEN((short) 13),
70 DOOR_IS_OPEN((short) 14),
71 WINDOW_IS_TILTED((short) 15),
72 GARAGE_DOOR_IS_OPEN((short) 16),
73 SUN_PROTECTION((short) 17),
75 HEATING_OPERATION_ON_OFF((short) 19),
76 CHANGE_OVER_HEATING_COOLING((short) 20);
78 private final Short binaryInputType;
79 private static DeviceBinarayInputEnum[] deviceBinarayInputs = new DeviceBinarayInputEnum[DeviceBinarayInputEnum
83 for (DeviceBinarayInputEnum deviceBinarayInput : DeviceBinarayInputEnum.values()) {
84 deviceBinarayInputs[deviceBinarayInput.binaryInputType - 1] = deviceBinarayInput;
88 private DeviceBinarayInputEnum(Short binaryInputType) {
89 this.binaryInputType = binaryInputType;
93 * Returns the id of this {@link DeviceBinarayInputEnum}.
97 public Short getBinaryInputType() {
98 return binaryInputType;
102 * Returns the {@link DeviceBinarayInputEnum} of the given id or null, if no {@link DeviceBinarayInputEnum} exist
105 * @param binaryInputTypeID of the {@link DeviceBinarayInputEnum}
106 * @return the {@link DeviceBinarayInputEnum} of the id
108 public static DeviceBinarayInputEnum getdeviceBinarayInput(Short binaryInputTypeID) {
110 return deviceBinarayInputs[binaryInputTypeID - 1];
111 } catch (IndexOutOfBoundsException e) {