From 580df7795c25f3c72b143594b2d8cb74595e564a Mon Sep 17 00:00:00 2001 From: Julian Tatsch Date: Sat, 5 May 2018 16:38:17 +0200 Subject: [PATCH] add some more integration howtos --- README.md | 4 +- integration/domoticz/domoticz.md | 12 +++++ integration/homeassistant/homeassistant.md | 4 -- integration/zoneminder/zoneminder.md | 60 ++++++++++++++++++++++ 4 files changed, 75 insertions(+), 5 deletions(-) create mode 100644 integration/domoticz/domoticz.md create mode 100644 integration/zoneminder/zoneminder.md diff --git a/README.md b/README.md index c4fb876..732ecd8 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This repository contains custom firmwares for the following devices: Name | Picture ---- | --- +--- | --- Xiaomi Dafang | ![Dafang](/dafang.png) Xiaomi Xiaofang T20 | ![Xiaofang](/xiaofang.png) Wyzecam V2 | ![Xiaofang](/xiaofang.png) @@ -36,7 +36,9 @@ Start [here](/hacks/technical.md) After install, you can use this [android application](https://play.google.com/apps/testing/io.ext.medinvention.dafangcam) developed by [@medinvention](https://github.com/mmohamed) and available at [GitLab](https://gitlab.com/mmohamed/DafangCam) ## Integration in Home Automation Systems: +[Domoticz](/integration/domoticz/domoticz.md) [Home Assistant](/integration/homeassistant/homeassistant.md) +[Zoneminder](/integration/zoneminder/zoneminder.md) ## Contributions: Any contribution to the development is highly welcome. The best possibility is to open a pull request on GitHub. diff --git a/integration/domoticz/domoticz.md b/integration/domoticz/domoticz.md new file mode 100644 index 0000000..ba22535 --- /dev/null +++ b/integration/domoticz/domoticz.md @@ -0,0 +1,12 @@ +## Xiaomi Dafang Integration in Domoticz + +To control the camera in Domoticz one can create four virtual switches with a script action as on command. +Set a off delay at 1 sec +And as http:// script: + +http://[ip_of_camera]/cgi-bin/action.cgi?cmd=motor_right +http://[ip_of_camera]/cgi-bin/action.cgi?cmd=motor_left +http://[ip_of_camera]/cgi-bin/action.cgi?cmd=motor_top +http://[ip_of_camera]/cgi-bin/action.cgi?cmd=motor_bottom + +For more information please see the [original source](https://gadget-freakz.com/2018/03/xiaomi-1080p-xiaofang-camera-review/). diff --git a/integration/homeassistant/homeassistant.md b/integration/homeassistant/homeassistant.md index 6323e20..8b60dae 100644 --- a/integration/homeassistant/homeassistant.md +++ b/integration/homeassistant/homeassistant.md @@ -1,9 +1,5 @@ ## Xiaomi Dafang Integration in Home Assistant - - - - ### On the Home Assistant side First let's set up your camera stream. Make sure the rtsp-h264 service in the [service control panel](http://dafang/cgi-bin/scripts.cgi) is running and you can connect to [it](rtsp://dafang:8554/unicast) via e.g. vlc player. diff --git a/integration/zoneminder/zoneminder.md b/integration/zoneminder/zoneminder.md new file mode 100644 index 0000000..aa03dd3 --- /dev/null +++ b/integration/zoneminder/zoneminder.md @@ -0,0 +1,60 @@ +## Xiaomi Dafang Integration in Zoneminder + +ZM Setup: + +Click "Add a Monitor" +### General Tab + +Name your camera +Select Source Type of "FFmpeg" +Function (this depends on you, I picked modect) +Left all other settings as-is on this tab +![pic](https://www.dropbox.com/s/j7j6andnl8s62jz/Screenshot%202018-04-30%2011.50.15.png?dl=1) + +### Source Tab + +Source Path: rtsp://XX.XX.XX.XX:8554/unicast (Where XX.XX.XX.XX is the IP of your camera) +Remote Method: UDP (This was the first I tired and it worked, not saying it's the only way. +Target colorspace: 32 bit colour +Capture Width: 1920 +Capture Height: 1080 +The rest as-is ![pic](https://www.dropbox.com/s/4ds8vfb1xohzpd1/Screenshot%202018-04-30%2011.52.42.png?dl=1) +BEFORE you can configure the Control tab + +If you don't see this make sure you enabled OPT_CONTROL in the ZM options +Copy the gist into a file named Xiaomi.pm in /usr/share/perl5/ZoneMinder/Control/ (May be different for your distro, make sure it has the same permissions as the other controls) +Navigate to the control tab for your camera +Click on the "Edit" next to "Control Type" +Click "Add New Control" at the bottom of the popup +Name: "Xiaomi Dafang" +Type: "Fffmpeg" +Protocol: "Xiaomi" (it has to match the .pm file from above) +Can Reset: Yes +Pic: ![pic](https://www.dropbox.com/s/mm0aquc8s9zpul4/Screenshot%202018-04-30%2011.58.31.png?dl=1) + +### Move Tab + +Can move: yes +Can move relative: yes + +Pic: ![pic](https://www.dropbox.com/s/br17kax291ld2vk/Screenshot%202018-04-30%2011.59.42.png?dl=1) + +### Pan Tab + +Can pan: yes + ![pic](https://www.dropbox.com/s/912cznq42khwkkp/Screenshot%202018-04-30%2012.00.13.png?dl=1) + +### Tilt Tab + +Can tilt: yes + ![pic](https://www.dropbox.com/s/dafhvnsbv2v6bvr/Screenshot%202018-04-30%2012.00.44.png?dl=1) + +That's it, now save your new control type and head back to the control tab + +### Control Tab + +Select "Controllable" +Control Type "Xiaomi Dafang" +Control Device: leave this empty +Control Address: root:ismart12@XX.XX.XX.XX (Where XX.XX.XX.XX is the IP of your camera) +![pic](https://www.dropbox.com/s/gd2vrd8cj7d1cbj/Screenshot%202018-04-30%2012.02.19.png?dl=1)