Xiaomi Camera

From Domoticz
Jump to: navigation, search


Xiaomi camera.png

Credit goes to Deennoo for his original [ http://domo-attitude.fr/camera-xiaomi-xiaofang-flux-jpg-domoticz-jeedom/ french article]


The small xiaomi xiaofang camera is a cheap but good camera that is compatible with Domoticz when you apply a little easy hack. (thanks to Deennoo and rosty!!) The hack enables the ability to use JPG-streams in Domoticz.

You can buy it at this page I think there isn't another good cam for the same price.

Note: Xiaomi recently released a new version of this camera. This new model (xiaofang 1s) uses a different chipset and cannot be used with the hack described here. Instead you need to use the hack for the dafang camera available at this page. With this hack the xiofang 1s can also work with domoticz. To know which camera you have (xiaofang or xiaofang 1s) you need to look at the sticker on the box of the camera because the camera themselves look the same.


  1. IP camera performance: Motion Detection,Night Vision,Real-time video capture and recording
  2. Wireless: WiFi 802.11 b/g/n
  3. Motion Detection Distance: 9m
  4. Micro Sd-port
  5. Sensor: CMOS
  6. Sensor size (inch): 1/2.7
  7. Resolution: 1920 × 1080
  8. Audio Input: Built-in mic.
  9. Audio Output: Built-in speaker
  10. CO2 alarm
  11. Smoke detector

Package Contents: 1 x Xiaomi IP Camera, 1 x Power Cord

When using the camera in mi-home you can use the microphone, speaker, CO2-detector and smokedetector. But in domoticz those options are not available.


Some thinks don't work as mentioned before but what works is:

  1. nightvision,
  2. pictures with the resolution of 1920x1080,
  3. easy to integration in domoticz.

So you loose the audio/mihome-app, motion.

But 'hey!' getting it in Domoticz is more important ;)


  1. Connect the camera to your local network with the Mi Home application ( Android or IOS) and note its ip in the about / network section and give it a fixed ip in your router.
  2. Download this ZIP file:firmware download
  3. Extract ZIP File
  4. Flash the .img image with Win32Disk Manager on a microSD card. Make sure you format/wipe the card before.
  5. If the camera is unplugged, power it without a microSD card
  6. Wait for the blue light to stop flashing. You might hear a Chinese voice.
  7. Insert the micro SD card you flashed in step 4
  8. The camera automatically executes snxautorun.sh and makes a sound notification (tudu tudu)
  9. Surf in your browser to: http: // IP-CAMERA from step 1 / cgi-bin / status for example:
  1. If you get a 404 Not Found page , it means that the snx_autorun.sh script did not launch properly
  2. Go to this page and check if the SD card is correctly mounted and repeat step 5

http: //IP-CAMERA/cgi-bin/hello.cgi Once everything is OK, access the camera page via a WEB browser: http: // IP-CAMERA / cgi-bin / status
You arrive on the main page of the WEB server, you can initially give a name to your camera and set the time zone.
If you have no reason to change the network information (Wifi SSID and Wifi key) then click Apply, the camera restarts and will be accessible in RTSP.
You are ready to roll!

in Domoticz

go to Settings / More Options / Camera. Add the camera and fill in the same IP as used above.
If you want yo be informed when somebody presses the doorbell click on the camera, and add a device below. 5.png
on the switches page you see the cam. but edit you doorbell and give it a notification. you see the camera icon by your doorbell.

next time somebody rings the doorbell, a snapshot from camera is taken and send to you mail (if that's enabled in you notifications.)