Kuna Surveillance Camera Support

Good to know that you had found rtsp!

@marthocoo I installed your hassio custom component and it works like a charm! Thx.

@marthocoo I’m new to hass and just found this thread. I installed the component and it also works well for me.

Very excited about this, as the kuna has been great…all except their monopoly hold on what you can do with it. With your add on, there is much promise that we can work around it. Thanks!

@Corey_Maxim, @HITChris, @radiationnow, @Martso, @Nico74350, @TarheelGrad1998

I’ve just released a new version of the custom component (v3). This one adds support for an actual Camera entity in HA so that you can see the latest snapshot from the camera in the HA frontend.

I’ve also re-packaged the component to make it very easy to install, BUT this requires you to wipe the previous version and be running version 0.86 or higher of Home Assistant. To install the new version:

  1. Remove all files from the previous release from your custom_components directory (e.g. kuna.py, binary_sensor/kuna.py, switch/kuna.py).
  2. cd into your custom_components directory (normal install: ~/.homeassistant/custom_components, hassio: /config/custom_components)
  3. git clone the repo: git clone https://github.com/marthoc/kuna.

That’s it! From now on, when there’s a new release you can just cd into the custom_components/kuna directory and do a git pull.

This release features still images, but the next release will feature support for displaying the actual camera stream in the front end. Please let me know any feedback here or on GitHub!

Quick new release to v3.1 - forgot to bump the underlying python library, which fixes a couple of bugs.

I updated my components and have the new camera entity, so far working well. I haven’t tested any automations yet but certainly will. At the moment it appears the image is of better quality than what is shown in the Kuna app somehow, but it’s hard to get a good read as this camera doesn’t do great in the dark.

The only issue I noticed is the camera status is always “recording” but maybe that’s a side effect of not having the stream, as you mention. Nice work!

@TarheelGrad1998 Thanks for testing! Glad to hear it works.

Regarding the always “recording” - thanks for pointing that out. I made a small fix and bumped to v3.2, now the frontend should show “Recording” only when motion is detected and a recording is happening. Otherwise, the frontend should show “Streaming”.

You can update by cd’ing into the custom_components/kuna directory and doing git pull.

Works great man :ok_hand:

v4 now pushed which allows you to specify update_interval in configuration.yaml if you want to override the default polling interval of 15s (to make the binary_sensor more responsive). This is a non-breaking change as update_interval is an optional parameter.

Last update for today: v5 pushed which allows for “streaming” in the HA frontend when the camera is clicked on. Default is 1 image every 5 seconds when the streaming view is open but you can reduce that interval in configuration.yaml with the stream_interval parameter if you wish (practically speaking, it appears to take roughly 1s to fetch an image from the Kuna API, so don’t go too low).

Validated, at least for my 1 device account. Great work.

Updated, and it’s working well overall.

I am seeing a lot of timeouts in my log…FYI in case this is on the hass side of things:

Request to Kuna API timed out.
8:11 AM deps/lib/python3.6/site-packages/pykuna/kuna.py (ERROR)

Likewise, working well on my single device account (original Kuna kickstarter device, fwiw.)

I’ll try to get this going this weekend, I haven’t had much time to take a good look at it. Thanks for pushing this out!!!

I got it working too, seems to work well so far! The quality is so so, but its dark outside. IMO in the day it will be great!

Thanks So much for this!

Is it possible to add a switch service for the light?

You should get three entities per camera: a binary sensor (motion), a camera (images), and a switch (the light).

The image isn’t great as the thumbnail images from the Kuna API are only 320x240. Once I figure out the best way to proxy the camera stream into HA, the stream should be 720p.

ok, Ty I see them! Strange but it had a different label on it. (The kuna used to be on the front porch but was moved to the backyard, item was renamed before this addon but it kept the same name) However the camera showed as camera.back_yard.

Awesome, im glad its finally working in the front. and im getting use out of the camera again.

Is there any way to use the speaker function maybe as TTS media player or something?

@marthocoo - Thank you for putting this together, I just wanted to reach out and let you know that it’s working for me with two devices (I have two maximus floodlights). Please let me know if you have any questions that I can help answer.

@jlax47 Can you provide what you did? I tried the various steps from above but got hung up somewhere. Thanks mate!