[ipcamera| add autoTracking channel for reolink camera (#17488)

Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
This commit is contained in:
Ronny Grun 2024-10-05 09:53:50 +02:00 committed by GitHub
parent d2a785392e
commit 495c527801
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 29 additions and 1 deletions

View File

@ -220,6 +220,7 @@ The channels are kept consistent as much as possible from brand to brand to make
| `animalAlarm` | Switch | RW | Toggles when an animal is in view. |
| `audioAlarm` | Switch | R | When the camera detects noise above a threshold this switch will move to ON. |
| `autoLED` | Switch | RW |When ON this sets a cameras IR LED to automatically turn on or off. |
| `autoTracking` | Switch | RW |Turn the automatic mode for tracking ON or OFF. |
| `autoWhiteLED` | Switch | RW |When ON this sets a cameras visible white LED to automatically turn on or off. |
| `carAlarm` | Switch | RW | When a car is detected the switch will turn ON. |
| `cellMotionAlarm` | Switch | R | ONVIF cameras only will reflect the status of the ONVIF event of the same name. |

View File

@ -148,4 +148,5 @@ public class IpCameraBindingConstants {
public static final String CHANNEL_ENABLE_EMAIL = "enableEmail";
public static final String CHANNEL_ENABLE_PUSH = "enablePush";
public static final String CHANNEL_ENABLE_RECORDINGS = "enableRecordings";
public static final String CHANNEL_AUTO_TRACKING = "autoTracking";
}

View File

@ -508,6 +508,18 @@ public class ReolinkHandler extends ChannelDuplexHandler {
+ ipCameraHandler.cameraConfig.getNvrChannel() + ",\"mode\": 2,\"bright\": " + value
+ "}}}]");
}
break;
case CHANNEL_AUTO_TRACKING:
if (OnOffType.ON.equals(command)) {
ipCameraHandler.sendHttpPOST("/api.cgi?cmd=SetAiCfg" + ipCameraHandler.reolinkAuth,
"[{\"cmd\":\"SetAiCfg\",\"action\":0,\"param\":{\"bSmartTrack\":1,\"channel\": "
+ ipCameraHandler.cameraConfig.getNvrChannel() + " }}]");
} else {
ipCameraHandler.sendHttpPOST("/api.cgi?cmd=SetAiCfg" + ipCameraHandler.reolinkAuth,
"[{\"cmd\":\"SetAiCfg\",\"action\":0,\"param\":{\"bSmartTrack\":0,\"channel\": "
+ ipCameraHandler.cameraConfig.getNvrChannel() + " }}]");
}
break;
}
}

View File

@ -629,6 +629,8 @@ channel-type.ipcamera.audioAlarm.label = Audio Alarm
channel-type.ipcamera.audioAlarm.description = Audio has triggered an Alarm.
channel-type.ipcamera.autoLED.label = Auto LED
channel-type.ipcamera.autoLED.description = Turn the automatic mode for the LED ON and OFF.
channel-type.ipcamera.autoTracking.label = Auto Tracking
channel-type.ipcamera.autoTracking.description = Turn the automatic mode for tracking ON or OFF.
channel-type.ipcamera.autoWhiteLED.label = Auto White LED
channel-type.ipcamera.autoWhiteLED.description = Turn the automatic mode for the visible white LED ON or OFF.
channel-type.ipcamera.carAlarm.label = Car Alarm

View File

@ -2321,10 +2321,11 @@
<channel id="enableFTP" typeId="enableFTP"/>
<channel id="enableEmail" typeId="enableEmail"/>
<channel id="enablePush" typeId="enablePush"/>
<channel id="autoTracking" typeId="autoTracking"/>
</channels>
<properties>
<property name="thingTypeVersion">1</property>
<property name="thingTypeVersion">2</property>
</properties>
<config-description>
@ -3074,4 +3075,10 @@
</options>
</state>
</channel-type>
<channel-type id="autoTracking" advanced="true">
<item-type>Switch</item-type>
<label>Auto Tracking</label>
<description>Turn the automatic mode for tracking ON or OFF.</description>
</channel-type>
</thing:thing-descriptions>

View File

@ -18,6 +18,11 @@
<type>ipcamera:enablePush</type>
</add-channel>
</instruction-set>
<instruction-set targetVersion="2">
<add-channel id="autoTracking">
<type>ipcamera:autoTracking</type>
</add-channel>
</instruction-set>
</thing-type>
<thing-type uid="ipcamera:dahua">