Add-on: Kuna

Couple of notes -

  • Sensor attr ‘recording_active’ indicates whether the camera’s motion sensor has been tripped
  • Polling is limited to 15 seconds. I don’t think the API involved has been ‘announced’, so I thought this would be safe (re: keep us from getting blacklisted)… but thoughts?
  • The add-on should support multiple cameras, but I only have one, so let me know if there are issues

running hassos , geting errors upon starting the add-on

[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] 00-banner.sh: executing…

parse error: Expected string key before ‘:’ at line 1, column 4
[23:51:19-0400] ERROR ----> Unknown HTTP error occured
parse error: Expected string key before ‘:’ at line 1, column 4
[23:51:19-0400] ERROR ----> Unknown HTTP error occured
Hass.io Add-on: v
parse error: Expected string key before ‘:’ at line 1, column 4
[23:51:20-0400] ERROR ----> Unknown HTTP error occured

parse error: Expected string key before ‘:’ at line 1, column 4
[23:51:20-0400] ERROR ----> Unknown HTTP error occured
From:
parse error: Expected string key before ‘:’ at line 1, column 4
[23:51:24-0400] ERROR ----> Unknown HTTP error occured
By:

parse error: Expected string key before ‘:’ at line 1, column 4
[23:51:30-0400] ERROR ----> Unknown HTTP error occured
armhf / / HA 0.77.3 / SU 130 / stable

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing…
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing…
parse error: Expected string key before ‘:’ at line 1, column 4
[23:51:38-0400] ERROR ----> Unknown HTTP error occured
parse error: Expected string key before ‘:’ at line 1, column 4
[23:51:39-0400] ERROR ----> Unknown HTTP error occured
[23:51:39-0400] INFO ----> You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
exec: fatal: unable to exec bash
: No such file or directory
[cmd] /Kuna/usr/bin/run.sh exited 111
[cont-finish.d] executing container finish scripts…
[cont-finish.d] 99-message.sh: executing…

            Oops! Something went wrong.

We are so sorry, but something went terribly wrong when
starting or running this add-on.

Be sure to check the log above, line by line, for hints.

[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.

Apologies. I bricked the add-on with a bad commit and haven’t had a chance to resolve it. I’ll try correct it within the next few days

1 Like

No worries, just wanted to flag it. Being able to TTS “someone’s at the door” to the basement speakers is worth it in and of itself.

@HITChris, @radiationnow, @djf_jeff, @swiftvic, @Corey_Maxim

I’ve written a custom component for HA that starts to integrate Kuna cameras.

I’ve made a couple of big assumptions about how the API works given that I only have one device and, accordingly, I only know how the Maximus Smart Security Light is modelled in the API. I’m assuming the other Kuna devices work similarly but I’d be happy to hear otherwise so that I can fix and update.

If you would like to test, please grab the release from GitHub: https://github.com/marthoc/kuna/releases. Installation and configuration instructions are in the README. Currently you should get a binary sensor (motion) and switch (control the camera’s light bulb) for each camera in your account - support for an actual camera entity will follow soon, I’m working on it.

And if you’d really like to help out my work, please do the following:

git clone https://github.com/marthoc/pykuna
cd pykuna
git checkout debug
python3 -m venv .
source bin/activate
python debug.py USERNAME PASSWORD

The debug script will log into your account and dump the data for each camera in it. Copy and paste the output into a DM to me. The only “sensitive” data contained in the dump will be your camera’s serial number, but (among other things) I’m trying to figure out if we can determine device model type from the serial number since it doesn’t appear to be indicated in the API response otherwise. For each camera in the dump, please let me know what model it is (i.e. Maximus Smart Security Light, Toucan, etc.) so that I can see if there are variations in the API response between different models of camera.

Thanks!

Apologies, I had something unexpected come up and couldn’t so much as look at HA for 3 months :slight_smile: The one thing keeping me from fixing the add-on is this issue with the newly released webhook component (needed for bringing thumbnails in via the push camera platform). Once resolved, the add-on should be reliable for bringing polling-based status updates and thumbnails into HA.

That said, I poked around with Charles and learned that in addition to allowing certain camera settings to be updated, a live rtsp stream exists. The hassio add-on will be limited to ‘read only’ functionality, but I’m looking forward to seeing what @marthocoo can put together in the form of a fully integrated HA component.

Check this link for the latest release of my custom component including support for a camera entity:

Just bought the smart security light from Costco. Can’t wait to install it. Looks like integration with Hassio is successful…thanks!
My question: when you install this, do you use a smart switch? Or just a dumb switch that is kept on and light controlled via HA or the app? Can you flip this light on and off the old fashioned way with a wall switch? How does that affect the camera? When the switch is off, is the camera always off, too?
Thanks for the information, so I know how best to install.

The wall switch controls all power to the device, so you want it to be always on. (I have a switchguard over mine so people won’t turn it off by mistake.)

Thank you. That’s what I figured but wanted to be sure. Are you happy with this product?

Yes and no. I got it on Kickstarter, long before I got into Home Assistant. As a standalone device, it’s fine; video’s a little slow, but I like having the camera in the light rather than in a doorbell like most similar devices. So, if I never used HA, I’d be happy with it.

But I do use HA. I wish they’d actually have done what the Kickstarter promised and had an actual API instead of having people like marthoc reverse-engineering private APIs so we can integrate into HA. If I was buying now, I think I’d probably pick a different device, one which has actual API support for integration.

Thanks for the feedback. We’re doing a project on the house, and need a new light for the back door. I have a Ring doorbell for the front. I have mixed feelings, but overall it is OK.
This Kuna was on sale at Costco for like 69.99, so I figured once it gets set up, I can always take it back if no good. Hopefully this will get set up within a month or so. I’ll let the contractors install it. I’ll have my hand at the programming!
Thanks again for your help.
David

I picked up the maximus at costco on sale; I was wondering a number of things of how to put this into my home automation and integration, this is fantastic.

With premium service from Kuna you can get “AI” I don’t know if it’ll have facial recognition, but if it does it’d be cool if this API could handle it, then a positive response to a face that it “knows” could automatically unlock doors and stuff (I know risky and insecure, but cool).

Thanks so much for working on this!

I’ve followed the instructions, but can’t complete:
"To enable the integration, add it from the Configuration - Integrations menu in Home Assistant. Click “+”, then “Kuna Smart Home Security”.

There is no option for Kuna in the hassio integration add menu.

What am I missing?

core-ssh:/config/custom_components/kuna# ls
LICENSE           binary_sensor.py  const.py          strings.json
README.md         camera.py         manifest.json     switch.py
__init__.py       config_flow.py    services.yaml

I had a similar issue; ultimately, after updating Home Assistant to the newest version it appeared in that menu and I could set up the integration.

1 Like

I did have this working, but then had to do a fresh install and now can’t get it working due to the same problem as before “There is no option for Kuna in the hassio integration add menu.”

I can’t remember what I did last time to get it to work, but hoping someone can point me in the right direction. How do I add this integration??

1 Like

I also have this same problem. If anyone has the solution

To be honest, it’s probably not much help, but this just sort of worked itself out. Kuna is working again and it’s relatively the same config so not sure what was up. I’ve done a couple of upgrade to hassio so maybe something there cleared the issue???