Kuna Surveillance Camera Support

Refer to this post for up to date instructions: Kuna Surveillance Camera Support

1 Like

@marthocoo thank you! that was where I was getting hung up on. I am 100% now, thanks again!!!

@HITChris @TarheelGrad1998 @radiationnow @Corey_Maxim @jlax47 @GuitarSkater

New version of the component is up: v6.

Major feature of this version is two new services: kuna.enable_notifications and kuna.disable_notifications, which you can use to enable or disable notifications for just one camera or all cameras in an account. I also added a couple of device state attributes to the camera.

Timeouts are nothing more than the request to the Kuna APIā€¦ timing out. Shouldnā€™t be a sign of anything bad going on with the component, just that your connection to the Kuna server is a bit flaky.

Iā€™m going to look into this!

1 Like

@marthocoo - Thanks. I updated by running a git pull on the custom_components/kuna folder and restarting HA.

Whatā€™s the point of the new services? Does it change the setting in the app for ā€œReceive Alertsā€? I guess itā€™s not clear to me what a notification is in this context.

Also thank you again, this is great!

The services disable/enable whether or not Kuna motion detection will trigger an alert to clients (e.g. the Android Kuna app).

Good work @marthocoo

Can you speak to the specific steps if one is running hassio on the RPi3? Thanks for your help

To install on Hass.io:

  1. Install the ssh Add-on.
  2. ssh into the Hass.io system.
  3. cd /config
  4. mkdir custom_components
  5. cd custom_components
  6. git clone https://github.com/marthoc/kuna
  7. Add the required configuration to configuration.yaml.
  8. Restart Home Assistant.
  9. Enjoy!
1 Like

Iā€™m currently looking into:

  1. Supporting the actual camera stream in Home Assistant.
  2. Whether we can create a basic media_player platform for Kuna that would let it function as a tts endpoint in Home Assistant - this will depend on how sound data is sent from the Kuna app to its remote servers, which I still need to investigate.

Other than these features, are there any other features that anyone would like to see as part of this component? Iā€™m trying to get it to be as feature complete as possible before trying to get it incorporated into Home Assistant.

1 Like

@marthocoo

Any chance that you could give me an example of the action to turn on/off these notifications? I would like to append this to and already existing automation. Thanks

Sure thing, hereā€™s a simple automation that turns notifications off on all cameras at sunset:

- alias: Notifications off at sunset - all cameras
  trigger:
    - platform: sun
      event: sunset
  action:
    - service: kuna.disable_notifications

Hereā€™s another one to turn notifications on for one camera when a device tracker leaves home:

- alias: Notifications on when Mark leaves home
  trigger:
    - platform: state
      entity_id: device_tracker.marks_iphone
      from: home
      to: not_home
  action:
    - service: kuna.enable_notifications
      data:
        serial_number: '0000000000'

To find the serial number, you can either use the Kuna app, or go to the entities page, find the camera entity, and one of the state attributes will be the serial number.

1 Like

Not sure how it would be represented in HASS, but itā€™d be really nice to be able to interact with recordings - if only to automatically save clips, or do things with clips when certain criteria are met.

im on .88 and I know theres a new structure for custom components

config/custom_components/kuna/ (kuna files)

but Im getting a error in my configuration.yaml
Component not found: kuna

Am I doing something wrong?

I donā€™t think youā€™re doing anything wrongā€¦ Iā€™m on 88.1 and currently developing on 89dev and the component is working on both. Might be worth deleting the kuna directory in custom_components, restarting HA, then doing a fresh git clone of the kuna repo, then restarting again.

Iā€™ll second the recordings. It would be great to access those that are in the Kuna app and save them off somewhere. Again it gets around their closed system that is really the biggest downside of their product.

If you could get the live stream to show and save into a remote repository (FTP/NAS, etc) would be awesome.

1 Like

thanks for all the work youve done so far. I will second being able to save the live stream to a remote location or even just the motion events.

Anyone have Kuna block access to the api yet?

@radiationnow @Corey_Maxim @TarheelGrad1998 @GuitarSkater @HITChris @Martso @Nico74350 @jlax47 @DKrics @berniebl

New release uploaded to GitHub. Mostly stuff under the hood (component and underlying library are now completely async), but there is also a new feature that will allow you to automatically download recordings. See the GitHub repo for instructions, and let me know if anything isnā€™t clear or not working.

As always, update by cdā€™ing into the custom_components/kuna directory and doing git pull.

3 Likes

Thanks for the notification, very nice of you. Doing a pull now!

Thanks for the update! I will check it out now!

Thanks. Iā€™ve got it up and running now. I changed the automation download to have a folder per camera (folder name is the SN) and the download filename to the label.

- alias: Download Kuna recordings
  trigger:
platform: event
event_type: kuna_event
event_data:
  category: recording
  action:
service: downloader.download_file
data_template:
  url: '{{ trigger.event.data.url }}'
  subdir: '{{ trigger.event.data.serial_number }}'
  filename: '{{ trigger.event.data.label }}'