Ezlo WIFI / IP Device Generator plugin Templates on the marketplace (Hikvision Cams)

With the Ezlo IP Device Generator plugin (formally called WIFI Device Generator) it is possible for users to create device templates and share them with other users, by publishing their templates to the Marketplace.

I was playing around with this today and I have published two templates for controlling somethings on Hikvision IP cameras.

  1. Start or Stop Manual Recording on the camera, using this template you can create a virtual ON / OFF switch device into your Ezlo dashboard / Vera mobile app.

Turning ON the virtual switch will start manual recording, turning OFF the virtual switch will stop manual recording on the camera.

You could then use this virtual switch in your Meshbot rules Actions, for example a true action could be to turn on the virtual switch to start recording when an armed sensor is tripped and the false action could be to turn off the virtual switch to stop the camera recording etc.

You need to copy down the template from the Marketplace to the “My Wifi Device Templates” area then press the button to create your device.

Give your virtual switch device a name. Enter the local IP address of your Hikvision camera and use port 80. Enter admin as the user name and enter your cameras admin password and click the “Create Device” button.

Now in the dashboard and Vera mobile app you will see your new ON / OFF virtual switch etc.

image

To test its working turn ON the virtual switch for a few minutes then turn it OFF again, you can then login to your cameras admin page and go to “Playback”

“Manual” recordings are marked as Yellow in the timeline. If you click on the yellow marker and then press the “Play” button, that clip should then playback etc.

  1. The second template I made, creates a virtual ON / OFF switch to control the “Motion Detection” setting and enables or disables that particular setting.

Configuration → Event → Basic Event → Motion Detection Tab → Enable Motion Detection

Note - To test if your ON / OFF virtual switch is actually changing this setting, you may need to refresh your browser each time, to monitor if that tick box is being enabled or disabled when using the virtual switch. It doesn’t seem to change dynamically.

Having the virtual switch turned ON enables the “Motion Detection” setting. Having the virtual switch turned OFF disables the “Motion Detection” setting.

image

To use this template again you need to copy it down from the marketplace to your “My Wifi Device Templates” area and then click the create device button.

Again you need to give your virtual switch device a name. Enter the local IP address of your Hikvision camera and use port 80. Enter admin as the user name and enter your cameras admin password and click the “Create Device” button.

If you have several Hikvision cameras, you can create multiple virtual switches from these templates. Just change the local IP address to the address of your next camera etc.

2 Likes

And for those of you wanting to know a bit more about how I created my templates.

  1. Start or Stop Recording Template


I’m using the Hikvision ISAPI HTTP API of the camera(s).

Start Recording (On)

Content Type Field - application/x-www-form-urlencoded

HTTP Method = PUT

WiFi Device Command field - /ISAPI/ContentMgmt/record/control/manual/start/tracks/101

Stop Recording (Off)

Content Type Field - application/x-www-form-urlencoded

HTTP Method = PUT

WiFi Device Command field - /ISAPI/ContentMgmt/record/control/manual/stop/tracks/101

I used the 101 main stream if you want to use the 102 sub-stream instead then you would need to edit these commands.

  1. “Motion Detection” setting enabled or disabled


For changing this particular setting on a camera I have to send a HTTP request with an XML data payload

“Motion Detection” Setting Enabled (On)

Data field - <MotionDetection xmlns="http://www.hikvision.com/ver20/XMLSchema" version="2.0"> <enabled>true</enabled> <MotionDetectionLayout version="2.0"> </MotionDetectionLayout> </MotionDetection>

Content Type Field - application/xml

HTTP Method = PUT

WiFi Device Command field - /ISAPI/System/Video/inputs/channels/1/motionDetection

“Motion Detection” Setting Disabled (Off)

Data field - <MotionDetection xmlns="http://www.hikvision.com/ver20/XMLSchema" version="2.0"> <enabled>false</enabled> <MotionDetectionLayout version="2.0"> </MotionDetectionLayout> </MotionDetection>

Content Type Field - application/xml

HTTP Method = PUT

WiFi Device Command field - /ISAPI/System/Video/inputs/channels/1/motionDetection

3 Likes

great work @cw-kid !
Controlling IP based devices now becomes easy.

15 posts were merged into an existing topic: Ezlo - WiFi device generator plugin is on the Market place