2 * Copyright (c) 2010-2020 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
14 package org.openhab.binding.ipcamera.internal;
16 import java.util.Arrays;
17 import java.util.HashSet;
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.openhab.core.thing.ThingTypeUID;
24 * The {@link IpCameraBindingConstants} class defines common constants, which
25 * are used across the whole binding.
27 * @author Matthew Skinner - Initial contribution
30 public class IpCameraBindingConstants {
31 private static final String BINDING_ID = "ipcamera";
32 public static final String AUTH_HANDLER = "authorizationHandler";
33 public static final String AMCREST_HANDLER = "amcrestHandler";
34 public static final String COMMON_HANDLER = "commonHandler";
35 public static final String INSTAR_HANDLER = "instarHandler";
37 public static enum FFmpegFormat {
46 // List of all Thing Type UIDs
47 public static final ThingTypeUID THING_TYPE_GROUP = new ThingTypeUID(BINDING_ID, "group");
48 public static final String GENERIC_THING = "generic";
49 public static final ThingTypeUID THING_TYPE_GENERIC = new ThingTypeUID(BINDING_ID, GENERIC_THING);
50 public static final String ONVIF_THING = "onvif";
51 public static final ThingTypeUID THING_TYPE_ONVIF = new ThingTypeUID(BINDING_ID, ONVIF_THING);
52 public static final String AMCREST_THING = "amcrest";
53 public static final ThingTypeUID THING_TYPE_AMCREST = new ThingTypeUID(BINDING_ID, AMCREST_THING);
54 public static final String FOSCAM_THING = "foscam";
55 public static final ThingTypeUID THING_TYPE_FOSCAM = new ThingTypeUID(BINDING_ID, FOSCAM_THING);
56 public static final String HIKVISION_THING = "hikvision";
57 public static final ThingTypeUID THING_TYPE_HIKVISION = new ThingTypeUID(BINDING_ID, HIKVISION_THING);
58 public static final String INSTAR_THING = "instar";
59 public static final ThingTypeUID THING_TYPE_INSTAR = new ThingTypeUID(BINDING_ID, INSTAR_THING);
60 public static final String DAHUA_THING = "dahua";
61 public static final ThingTypeUID THING_TYPE_DAHUA = new ThingTypeUID(BINDING_ID, DAHUA_THING);
62 public static final String DOORBIRD_THING = "doorbird";
63 public static final ThingTypeUID THING_TYPE_DOORBIRD = new ThingTypeUID(BINDING_ID, DOORBIRD_THING);
65 public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = new HashSet<ThingTypeUID>(
66 Arrays.asList(THING_TYPE_ONVIF, THING_TYPE_GENERIC, THING_TYPE_AMCREST, THING_TYPE_DAHUA, THING_TYPE_INSTAR,
67 THING_TYPE_FOSCAM, THING_TYPE_DOORBIRD, THING_TYPE_HIKVISION));
69 public static final Set<ThingTypeUID> GROUP_SUPPORTED_THING_TYPES = new HashSet<ThingTypeUID>(
70 Arrays.asList(THING_TYPE_GROUP));
72 // List of all Thing Config items
73 public static final String CONFIG_IPADDRESS = "ipAddress";
74 public static final String CONFIG_PORT = "port";
75 public static final String CONFIG_ONVIF_PORT = "onvifPort";
76 public static final String CONFIG_SERVER_PORT = "serverPort";
77 public static final String CONFIG_USERNAME = "username";
78 public static final String CONFIG_PASSWORD = "password";
79 public static final String CONFIG_ONVIF_PROFILE_NUMBER = "onvifMediaProfile";
80 public static final String CONFIG_POLL_TIME = "pollTime";
81 public static final String CONFIG_FFMPEG_INPUT = "ffmpegInput";
82 public static final String CONFIG_SNAPSHOT_URL_OVERRIDE = "snapshotUrl";
83 public static final String CONFIG_MJPEG_URL = "mjpegUrl";
84 public static final String CONFIG_FFMPEG_MOTION_INPUT = "alarmInputUrl";
85 public static final String CONFIG_MOTION_URL_OVERRIDE = "customMotionAlarmUrl";
86 public static final String CONFIG_AUDIO_URL_OVERRIDE = "customAudioAlarmUrl";
87 public static final String CONFIG_IMAGE_UPDATE_WHEN = "updateImageWhen";
88 public static final String CONFIG_NVR_CHANNEL = "nvrChannel";
89 public static final String CONFIG_IP_WHITELIST = "ipWhitelist";
90 public static final String CONFIG_FFMPEG_LOCATION = "ffmpegLocation";
91 public static final String CONFIG_FFMPEG_OUTPUT = "ffmpegOutput";
92 public static final String CONFIG_FFMPEG_HLS_OUT_ARGUMENTS = "hlsOutOptions";
93 public static final String CONFIG_FFMPEG_GIF_OUT_ARGUMENTS = "gifOutOptions";
94 public static final String CONFIG_FFMPEG_MP4_OUT_ARGUMENTS = "mp4OutOptions";
95 public static final String CONFIG_FFMPEG_MJPEG_ARGUMENTS = "mjpegOptions";
96 public static final String CONFIG_FFMPEG_MOTION_ARGUMENTS = "motionOptions";
97 public static final String CONFIG_PTZ_CONTINUOUS = "ptzContinuous";
98 public static final String CONFIG_GIF_PREROLL = "gifPreroll";
99 // group thing configs
100 public static final String CONFIG_FIRST_CAM = "firstCamera";
101 public static final String CONFIG_SECOND_CAM = "secondCamera";
102 public static final String CONFIG_THIRD_CAM = "thirdCamera";
103 public static final String CONFIG_FORTH_CAM = "forthCamera";
104 public static final String CONFIG_MOTION_CHANGES_ORDER = "motionChangesOrder";
106 // List of all Channel ids
107 public static final String CHANNEL_POLL_IMAGE = "pollImage";
108 public static final String CHANNEL_RECORDING_GIF = "recordingGif";
109 public static final String CHANNEL_GIF_HISTORY = "gifHistory";
110 public static final String CHANNEL_GIF_HISTORY_LENGTH = "gifHistoryLength";
111 public static final String CHANNEL_RECORDING_MP4 = "recordingMp4";
112 public static final String CHANNEL_MP4_PREROLL = "mp4Preroll";
113 public static final String CHANNEL_MP4_HISTORY = "mp4History";
114 public static final String CHANNEL_MP4_HISTORY_LENGTH = "mp4HistoryLength";
115 public static final String CHANNEL_IMAGE = "image";
116 public static final String CHANNEL_RTSP_URL = "rtspUrl";
117 public static final String CHANNEL_IMAGE_URL = "imageUrl";
118 public static final String CHANNEL_MJPEG_URL = "mjpegUrl";
119 public static final String CHANNEL_HLS_URL = "hlsUrl";
120 public static final String CHANNEL_PAN = "pan";
121 public static final String CHANNEL_TILT = "tilt";
122 public static final String CHANNEL_ZOOM = "zoom";
123 public static final String CHANNEL_EXTERNAL_MOTION = "externalMotion";
124 public static final String CHANNEL_MOTION_ALARM = "motionAlarm";
125 public static final String CHANNEL_LINE_CROSSING_ALARM = "lineCrossingAlarm";
126 public static final String CHANNEL_FACE_DETECTED = "faceDetected";
127 public static final String CHANNEL_ITEM_LEFT = "itemLeft";
128 public static final String CHANNEL_ITEM_TAKEN = "itemTaken";
129 public static final String CHANNEL_AUDIO_ALARM = "audioAlarm";
130 public static final String CHANNEL_ENABLE_MOTION_ALARM = "enableMotionAlarm";
131 public static final String CHANNEL_FFMPEG_MOTION_CONTROL = "ffmpegMotionControl";
132 public static final String CHANNEL_FFMPEG_MOTION_ALARM = "ffmpegMotionAlarm";
133 public static final String CHANNEL_ENABLE_LINE_CROSSING_ALARM = "enableLineCrossingAlarm";
134 public static final String CHANNEL_ENABLE_AUDIO_ALARM = "enableAudioAlarm";
135 public static final String CHANNEL_THRESHOLD_AUDIO_ALARM = "thresholdAudioAlarm";
136 public static final String CHANNEL_ACTIVATE_ALARM_OUTPUT = "activateAlarmOutput";
137 public static final String CHANNEL_ACTIVATE_ALARM_OUTPUT2 = "activateAlarmOutput2";
138 public static final String CHANNEL_ENABLE_EXTERNAL_ALARM_INPUT = "enableExternalAlarmInput";
139 public static final String CHANNEL_TRIGGER_EXTERNAL_ALARM_INPUT = "triggerExternalAlarmInput";
140 public static final String CHANNEL_EXTERNAL_ALARM_INPUT = "externalAlarmInput";
141 public static final String CHANNEL_EXTERNAL_ALARM_INPUT2 = "externalAlarmInput2";
142 public static final String CHANNEL_AUTO_LED = "autoLED";
143 public static final String CHANNEL_ENABLE_LED = "enableLED";
144 public static final String CHANNEL_ENABLE_PIR_ALARM = "enablePirAlarm";
145 public static final String CHANNEL_PIR_ALARM = "pirAlarm";
146 public static final String CHANNEL_CELL_MOTION_ALARM = "cellMotionAlarm";
147 public static final String CHANNEL_ENABLE_FIELD_DETECTION_ALARM = "enableFieldDetectionAlarm";
148 public static final String CHANNEL_FIELD_DETECTION_ALARM = "fieldDetectionAlarm";
149 public static final String CHANNEL_PARKING_ALARM = "parkingAlarm";
150 public static final String CHANNEL_TAMPER_ALARM = "tamperAlarm";
151 public static final String CHANNEL_TOO_DARK_ALARM = "tooDarkAlarm";
152 public static final String CHANNEL_STORAGE_ALARM = "storageAlarm";
153 public static final String CHANNEL_SCENE_CHANGE_ALARM = "sceneChangeAlarm";
154 public static final String CHANNEL_TOO_BRIGHT_ALARM = "tooBrightAlarm";
155 public static final String CHANNEL_TOO_BLURRY_ALARM = "tooBlurryAlarm";
156 public static final String CHANNEL_TEXT_OVERLAY = "textOverlay";
157 public static final String CHANNEL_EXTERNAL_LIGHT = "externalLight";
158 public static final String CHANNEL_DOORBELL = "doorBell";
159 public static final String CHANNEL_LAST_MOTION_TYPE = "lastMotionType";
160 public static final String CHANNEL_GOTO_PRESET = "gotoPreset";
161 public static final String CHANNEL_START_STREAM = "startStream";