In this video I'm going to show you how to integrate a Neos smart camera into
Home Assistant. Make sure you stick around, if you like what you see hit the
subscribe button below and keep an eye out for more videos!
Hi I'm Will from Will Surridge Tech, and today we're going to integrate a Neos
smart camera into Home Assistant. If you haven't already, make sure you check out
part 1 of this series where I show you how to flash the Neos camera with
custom defang firmware. So let's get going! So we have a Neos camera, we've
removed all the cloud rubbish from it, and we're now running it on custom dafang
firmware, which is great, but what we want to do is be able to see it and
control it from within Home Assistant. Viewing is easy - we're going to make use
of the RTSP feed, but to make it work we're going to need to change a few
settings, so let's head over to the interface for the camera. In here we're
going to want to change our bitrate to 500, our video size to 1280x720, and
our video mode to VBR. We're also going to want to copy the RTSP stream URL here,
so we can paste it into Home Assistant later on. If we head over to Home Assistant, we
can add a new camera. As usual I've got mine referenced in a separate folder but
you can add them to the main config file if you prefer. What we're going to do is
add a generic camera, we can name it, add the user name and password - by default
these are 'root' and 'ismart12', but you may have already changed it in the
camera interface. We have basic authentication, add a still image URL, and
a stream URL. The stream URL is the RTSP stream that we copied from our camera
interface. We set the frame rate 5, verify SSL to false, and the scan interval to 5.
Now some of these functions relate to the still image URL as opposed to the
RTSP feed but we may find we want to use the still image later on. We now need to
get our still image URL, so we head back over to the camera interface and under
the video settings there's a section that says video test - we press get image
and it'll open a new window with an image of the camera. We copy the URL of this
window and we paste this into our still image URL in Home Assistant. Once that's
done we can save, check our config, and restart Home Assistant. Once it's
restarted a new camera entity should appear. You might find that the feed
is a bit slow to load, this could just be the first time it loadsm but if it's
happening every time then you may want to change your bitrate and video size
back in the camera settings. You can also change the video mode but I'm not really
sure what each of them does - if you know please let me know in the comments below!
The preload stream function is great if you're running on a high powered
computer because it will preload the stream for you so you don't have to wait
for it to buffer every time you click on it. If you're running on a weaker
computer like a Raspberry Pi then I recommend you don't do this,
or at least don't do it on too many cameras. If you find that your stream is
great, then you can always increase the bitrate and increase the video size to
get a better quality stream, if not then you keep fiddling until you get a good
enough stream for you. I found that these settings work really well for my front
door camera but don't seem to be working as well for this camera. If however
you're finding that the RTSP feed is just absolutely useless, and won't load
for you, and doesn't work, then you can always use the still image URL instead.
Instead of getting live motion with a continuous video stream, you just get the
single snapshot image and it'll refresh that every second or so. This isn't
continuous motion but it should be enough to see what's going on, or see
whether there is actually someone at your front door or not! To do this we
need to comment out the RTSP stream from our camera configuration file, and
restart Home Assistant. Now we can move on to using MQTT to control the camera
and its features. I won't go into detail of setting up an MQTT broker but I'm
using the mosquito broker in the add-on store. To do this we're going to need to
change some configuration files, and we're going to do that by SSHing into
our camera. So we open up a command line and we type ssh root@ and then the IP
address of your camera so ssh root@192.168.0.1 42 in my case. It's going to
ask for a password the default password is ismart12. We now need to go cd ..
and then cd system/sdcard/config. If you type ls you should see a list of
all the files in this folder. In there there should be a file called mqtt.conf.dist
We're going to copy this to create an
mqtt.conf file. So we use the command cp mqtt.conf.dist mqtt.conf
Once copied we're going to need to edit it to do that we type vi mqtt.conf
We then type i to enter edit mode, and then we need to add the user name,
password, and host IP address of our broker. So for me that's the IP address of
my Home Assistant setup. We can then change the location and device name to
what we want to appear as the topic of our MQTT later. So mine's going to be
camera/diningroom. We can scroll down and we need to uncomment the
auto-discovery for Home Assistant - that means it'll automatically pop up and we
don't need to go and find it ourselves. We're also going to change the light
sensor to hw that means it's going to use the built-in LDR to detect the light
levels, as opposed to trying to figure it out using the image and software based
problems instead. Once we're happy we need to save it and exit - so we hit
escape hit :wq enter. Once happy we can close the terminal window and head back
to our camera interface. We're going to want to restart the camera here and then
head into services, and scroll down, and then we want to turn on MQTT status and
MQTT control. We're also going to want these to auto run so they automatically
happen every time you restart the camera. Now we can head over to the log file of
our MQTT breaker and we can see there's been a new connection from this camera.
If that hasn't happened then you may need to restart your MQTT broker or your
camera to get it to appear. Once it appears you can head over to your
integrations and you'll see a new device will be
listed. If we click through, we can see all sorts of levels of control now, from
LED control, to motion detection, from recording, to night mode. I won't go into
too much detail about motion detection but you
can see that there's a motion detection sensor which will be clear or detected,
and then there's a snapshot of the last motion event which you can make use of
in your integrations and your automations. I was really hoping I'd be
able to show you how to get your camera stream onto your TV. Unfortunately Google
cast doesn't seem to accept RTSP streams. If you know workaround for this,
and how to get your camera stream onto your TV then please let me know in the
comments below as it would be great to know! But ignoring that, we do have a Neos
camera integrated into Home Assistant. Make sure you click Subscribe below and
hit the bell icon to find out more about my smart tech, and how you can build
yourself the ultimate smart home!