Code Monkey home page Code Monkey logo

Comments (18)

tomasbedrich avatar tomasbedrich commented on July 17, 2024 1

Ok, then it seems clear.

We have to redirect user to API domain returned in login request, if Hikconnect service provides such hint.

Thanks for your bug report and cooperation.

from home-assistant-hikconnect.

tomasbedrich avatar tomasbedrich commented on July 17, 2024

Hi, can you please follow the debugging guide so that I know what is the issue?

https://github.com/tomasbedrich/home-assistant-hikconnect/blob/main/DEBUGGING.md

In your case, please ensure you perform the login attempt to have it captured in the logs.

from home-assistant-hikconnect.

jjmuriel avatar jjmuriel commented on July 17, 2024

Hi,
I followed this guide and sent you the logs to your email. Thanks.

from home-assistant-hikconnect.

tomasbedrich avatar tomasbedrich commented on July 17, 2024

It seems strange to me it tries to connect to US API, while you are probably located in Spain, right? Do you have any possible explanation, like VPN, DNS blocking, or..?

from home-assistant-hikconnect.

tomasbedrich avatar tomasbedrich commented on July 17, 2024

Moreover aren't there more logs to send? Maybe in this case it also helps if you send me your whole log file + config file, so that I can explain why it connects to US servers.

from home-assistant-hikconnect.

jjmuriel avatar jjmuriel commented on July 17, 2024

I'm located in South America and the Hik-Connect App was configurated with USA account. I don't use VPN. I'll send you my whole log and config file, but I have some configurations splited in several YAML files. Maybe, I have to change the account to my country? I'll try and post the result.

from home-assistant-hikconnect.

jjmuriel avatar jjmuriel commented on July 17, 2024

If I change the account to my country, I can't add my Hikvision Doorbell in the Hik-Connect App. Instead, with the USA account it works. So, I have to use USA account (no VPN).

from home-assistant-hikconnect.

tomasbedrich avatar tomasbedrich commented on July 17, 2024

Hm, could you please do nslookup api.hik-connect.com from your computer and paste the result here?

from home-assistant-hikconnect.

jjmuriel avatar jjmuriel commented on July 17, 2024

This is the output:

Server:		192.168.111.5
Address:	192.168.111.5#53

Non-authoritative answer:
api.hik-connect.com	canonical name = apiisa.hik-connect.com.
apiisa.hik-connect.com	canonical name = apisa-hik-connect-1930596709.sa-east-1.elb.amazonaws.com.
Name:	apisa-hik-connect-1930596709.sa-east-1.elb.amazonaws.com
Address: 54.233.110.148
Name:	apisa-hik-connect-1930596709.sa-east-1.elb.amazonaws.com
Address: 18.228.49.130

from home-assistant-hikconnect.

jjmuriel avatar jjmuriel commented on July 17, 2024

Thank you @tomasbedrich .

from home-assistant-hikconnect.

tomasbedrich avatar tomasbedrich commented on July 17, 2024

Please try version number 1.1.1 and let me know.

from home-assistant-hikconnect.

jjmuriel avatar jjmuriel commented on July 17, 2024

Hi @tomasbedrich,
Now I can login, but now:
Screen Shot 2022-01-19 at 7 54 08

This error originated from a custom integration.

Logger: custom_components.hikconnect
Source: custom_components/hikconnect/__init__.py:30
Integration: Hik-Connect (documentation, issues)
First occurred: 07:49:14 (4 occurrences)
Last logged: 07:49:51

Unexpected error fetching hikconnect data: unsupported operand type(s) for -: 'NoneType' and 'datetime.datetime'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/hikconnect/__init__.py", line 41, in async_update
    await relogin_if_needed()
  File "/config/custom_components/hikconnect/__init__.py", line 30, in relogin_if_needed
    needed = api.is_refresh_login_needed()
  File "/usr/local/lib/python3.9/site-packages/hikconnect/api.py", line 130, in is_refresh_login_needed
    return (self.login_valid_until - datetime.datetime.now()) < datetime.timedelta(
TypeError: unsupported operand type(s) for -: 'NoneType' and 'datetime.datetime'

from home-assistant-hikconnect.

tomasbedrich avatar tomasbedrich commented on July 17, 2024

Could you please provide logs again to my e-mail?

from home-assistant-hikconnect.

jjmuriel avatar jjmuriel commented on July 17, 2024

Sure, I just sent you the logs.

from home-assistant-hikconnect.

tomasbedrich avatar tomasbedrich commented on July 17, 2024

Can you please try version 1.1.2?

from home-assistant-hikconnect.

jjmuriel avatar jjmuriel commented on July 17, 2024

I did it, now there is not error, but I have 2 devices with the same name and no entities:
image

Device no. 1
image

Device no. 2
image

I have this video doorbell:
https://us.hikvision.com/en/products/more-products/video-intercom/door-station/3-mp-outdoor-wi-fi-smart-doorbell-camera-ds-hd1
I sent you the log file again. Thank you @tomasbedrich .

from home-assistant-hikconnect.

tomasbedrich avatar tomasbedrich commented on July 17, 2024

Okay, I'm glad that you are able to log in, so this bug is fixed.

The issue what you mention is #15. This is expected behavior, because currently the integrations supports locks only. Unfortunately, given your setup, the integration is not going to be useful for you (at least until something else than locks is implemented).

from home-assistant-hikconnect.

jjmuriel avatar jjmuriel commented on July 17, 2024

I understand, thank you.

from home-assistant-hikconnect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.