The downloader component automatically creates the subdir if it doesn’t exist. Good call on the extension, I’ll add that now.
I might change the folder name from SN to a friendly name through a template or with an automation per camera (with the SN as a condition on the trigger).
Would it be possible to add the camera name (as defined in home assistant) to the event?
When I restart I get:
Request to Kuna API timed out
There was an error logging into Kuna: No Kuna API token response returned, check username and password.
Setup failed for kuna: Component ‘kuna’ did not return boolean if setup was successful. Disabling component.
Timeouts in Kuna for me are common, though. I’m not sure if there’s a way to fix that…my network is pretty good. Maybe they are throttling me?
Or it may be my network, since my ecobee is doing similar:
Error connecting to Ecobee. Possible connectivity outage.
Seems fairly unlikely that they are throttling you and more likely, given your ecobee issues also, that there’s something flaky with your internet connection? The underlying pykuna library specifies 3 seconds as a timeout value, and I can get a response from the API in less than a half a second for a normal request. I know you remarked before that you saw lots of timeouts in your log, but I can say that I’ve actually never seen a timeout in either use or testing.
I’d be interested to hear others’ experiences on this as well.
Strange that it’s not coming back up, especially since it does seem to be working for others (rules out something I screwed up in the library at least). Out of interest, what version of HASS and python are you using? Do you have the Kuna app installed on an iPhone or Android?
You could use Postman to try to interact with the API directly. The auth url (that you seem to have trouble hitting) is at https://server.kunasystems.com/api/v1/account/auth. To obtain an auth token you need to make a POST request to that url with the json body:
If that times out then there’s some issue with your connection to Kuna I think? You could also tracert that. If it works then I’ve got to dig deeper for the problem.
I’m in Canada, not USA. What’s odd is that it’s working from your app.
I think at this point it seems like it’s not related to the component…? Since the post request you are sending from postman should return a json response: {“token”:“longtokenstring”}.
Yeah, I’m fairly confident it’s not the component either. Just bummer that it’s not working for me, and apparently I’m the only one. That’s why I’m looking for regional differences or something, but I can’t imagine why CA would be different than US.
I posted that from my work network, I get a token returned. When I do it from my home network, I get the “Sorry but the requested page is unavailable due to a server hiccup.”
So I feel like they’ve done something specific to my IP, or something.
I’m getting the same ‘No Kuna API’ thing upon HA container restart that @TarheelGrad1998 is -
Didn’t have the issue at all with v6. The component does however load without issue if I reboot the VM, which I guess completely destroys the homeassistant container
I’m starting to wonder if its related to the change from sync to async under the hood. After you “reboot the VM” does it work from then on?
I have myself experienced an issue where new dependencies for a custom component are sometimes not installed properly after a restart - though this still wouldn’t answer @TarheelGrad1998’s issue with not being able to get a token returned even from Postman. The strange thing is if you can’t use Postman, then the Kuna App shouldn’t work either as the API calls are the exact same. I’m boggled by this.
Still wasn’t working for me today. Then I realized my work machine still had the Content-Type = application/json header. Once I added that to my home machine, I get the token immediately. Don’t use my home machine to code usually.
Does the hass code add that header?
I may try to dig a bit myself later. I’m a MS developer but blind to python.
This could be it… I think that requests (the sync python http client) may add the content type automatically and so I never worried about setting it. I’ll add it to the library and release a new update later today.
Hi there!
Still having an issue when upgrading to the last version, same one than @HITChris.
*** Extract from log ***
Setup failed for kuna: Component ‘kuna’ did not return boolean if setup was successful. Disabling component.
18:57 setup.py (ERROR)
There was an error logging into Kuna: No Kuna API token response returned, check username and password.
18:57 custom_components/kuna/init.py (ERROR)
Request to Kuna API timed out
18:57 deps/lib/python3.7/site-packages/pykuna/kuna.py (ERROR)