In this video I will unbox the latest Sonoff GK-200MP2-B camera that has RTSP support, 360 degree viewing angle, 1080p, night vision, motion detection, two-way audio and it cost around 30 US dollars. After that I will connect it to Home Assistant & Node-RED.
Buy the camera from:
- AliExpress – http://s.click.aliexpress.com/e/_sVWd1j
- Banggood – https://www.banggood.com/custlink/mD3KQuvO8U
- Directly from Sonoff / ITEAD – https://shrsl.com/2qq3u
Table of Contents
For the Home Assistant:
You will need the FFMPEG tool installed on the same device where the Home Assistant is installed. If you followed my tutorial here: https://youtu.be/5JMNHuHv134
or my article here:
https://peyanski.com/raspberry-pi-as-smart-home-hub-video-tutorial/
then you have FFMPEG installed and you are good to go. Otherwise you’ll have to find a way to install it.
Add the lines below to your configuration.yaml file in Home Assistant. Don’t forget to replace the RTSP link with yours
camera: - platform: ffmpeg name: sonoff cam input: -rtsp_transport tcp -i rtsp://rtsp:[email protected]:554/av_stream/ch0
The Sonoff camera is now working with Home Assistant, now I will try to integrate it with Node-RED
For the Node-RED
You will need the FFMPEG tool installed on the same device where the Node-RED is installed, if not then install it using the following
- Enter inside your Node-RED Docker image by using:
docker exec -it nodered /bin/bash - Then update and install ffmpeg using:
- For Alpine linux use APK package manager:
apk update && apk add ffmpeg - For Debian based Linux distributions use:
sudo apt-get update && sudo apt-get install ffmpeg
- For Alpine linux use APK package manager:
- In Node-RED graphical interface through the Manage pallete – add these two plugins:
- node-red-contrib-image-tools
- node-red-contrib-image-output
- Copy and paste the lines below in the Node-RED using the ‘import’ functionality.
[{"id":"41a577c9.ee6c5","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"7edc8975.a2ca2","type":"exec","z":"41a577c9.ee6c5","command":"ffmpeg -f rtsp -i \"rtsp://rtsp:[email protected]:554/av_stream/ch0\" -f image2pipe pipe:1","addpay":false,"append":"","useSpawn":"true","timer":"","oldrc":false,"name":"Decode RTSP stream","x":520,"y":240,"wires":[["738531db.a89da","e2a11b69.d66c88"],["c8fa95b2.b7b268"],["412f5cc8.fc89ec"]]},{"id":"87089176.96e53","type":"inject","z":"41a577c9.ee6c5","name":"Start stream","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":240,"wires":[["7edc8975.a2ca2"]]},{"id":"a8a37b87.1047c8","type":"inject","z":"41a577c9.ee6c5","name":"Pause all streams","topic":"","payload":"SIGSTOP","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":280,"wires":[["b72b3fe3.c933c8"]]},{"id":"a29eac62.280ae8","type":"inject","z":"41a577c9.ee6c5","name":"Resume all streams","topic":"","payload":"SIGCONT","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":320,"wires":[["b72b3fe3.c933c8"]]},{"id":"b72b3fe3.c933c8","type":"change","z":"41a577c9.ee6c5","name":"","rules":[{"t":"set","p":"kill","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":320,"wires":[["7edc8975.a2ca2"]]},{"id":"febfdc6f.9c1e98","type":"inject","z":"41a577c9.ee6c5","name":"Stop all streams","topic":"","payload":"SIGTERM","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":360,"wires":[["b72b3fe3.c933c8"]]},{"id":"738531db.a89da","type":"debug","z":"41a577c9.ee6c5","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":710,"y":100,"wires":[]},{"id":"c8fa95b2.b7b268","type":"debug","z":"41a577c9.ee6c5","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":770,"y":320,"wires":[]},{"id":"412f5cc8.fc89ec","type":"debug","z":"41a577c9.ee6c5","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":710,"y":380,"wires":[]},{"id":"e2a11b69.d66c88","type":"jimp-image","z":"41a577c9.ee6c5","name":"","data":"payload","dataType":"msg","ret":"img","parameter1":"","parameter1Type":"msg","parameter2":"","parameter2Type":"msg","parameter3":"","parameter3Type":"msg","parameter4":"","parameter4Type":"msg","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","parameterCount":0,"jimpFunction":"none","selectedJimpFunction":{"name":"none","fn":"none","description":"Just loads the image.","parameters":[]},"x":710,"y":160,"wires":[["c898e769.05149"]]},{"id":"c898e769.05149","type":"image","z":"41a577c9.ee6c5","name":"","width":160,"data":"payload","dataType":"msg","thumbnail":true,"active":true,"x":860,"y":160,"wires":[]}]
Question for you?
Do you know if there is a better camera for the same budget, let me know in the comments below.
Support my Channel
Any sort of engagement on this channel does really help out a lot with the YouTube algorithm, so make sure you hit the subscribe, Like and Bell buttons If you enjoy this video.
Also feel free to add me on Twitter. I post there pretty much daily.
I really hope that you find this information useful and you now know more about the Sonoff Camera GK-200MP2-B, so you can decide whether you need this camera or not
Thank you for reading / watching, stay safe and see you next time.
Hi Kyril, Thanks for the work you do for the dumb people trying to get into home automation. I have a operational hassio running on ubuntu 20 and updated daily.I got 4 sonoff cameras and used your guide and youtube as a reference. I installed the one sonoff camera on my phone and all works well,but cannot get the the camera to operate on HA.. i have installed FFmpeg via ubuntu . I have only installed one camera. and get an error [libav.rtsp] method DESCRIBE failed: 404 Not Found. in system logs. various people have suggested the changing the rtsp command line with the same result I installed chromium with the same result. I have also reinstalled the ubuntu . with no errors in the logs. Any ideas ?? cheers Jaroslav