Comments (18)
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.
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.
Hi,
I followed this guide and sent you the logs to your email. Thanks.
from home-assistant-hikconnect.
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.
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.
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.
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.
Hm, could you please do nslookup api.hik-connect.com
from your computer and paste the result here?
from home-assistant-hikconnect.
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.
Thank you @tomasbedrich .
from home-assistant-hikconnect.
Please try version number 1.1.1 and let me know.
from home-assistant-hikconnect.
Hi @tomasbedrich,
Now I can login, but now:
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.
Could you please provide logs again to my e-mail?
from home-assistant-hikconnect.
Sure, I just sent you the logs.
from home-assistant-hikconnect.
Can you please try version 1.1.2?
from home-assistant-hikconnect.
I did it, now there is not error, but I have 2 devices with the same name and no entities:
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.
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.
I understand, thank you.
from home-assistant-hikconnect.
Related Issues (20)
- Version 1.2.3 still get error HOT 1
- log flooded with error 401 unauthorized messages HOT 11
- Failing to login due to HV's app uses CAPCHA HOT 2
- home-assistant-hikconnect is for home assistant supervisor? HOT 1
- Config flow could not be loaded: {"message":"Invalid handler specified"} HOT 2
- Hikvision Intercom Alarm Status HOT 5
- async_setup_platforms HOT 1
- kamery vidim ale nevidim jejich obraz HOT 1
- Unlock a lock connected to Hikvision indoor station HOT 4
- After updating to version 2.0.0 Hik-connect is missing HOT 4
- Remove old devices HOT 2
- sensor becomes unavailable HOT 5
- Support for new indoor devices
- Added an option to detect the typing of an incorrect code HOT 2
- Check click on button “open gate” HOT 1
- How do you update credentials? HOT 1
- Door Status Sensor
- Hikvision Alarm HOT 1
- Cant autch with addon
- Reley controll on VDP-H3211W HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from home-assistant-hikconnect.