Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to connect to Ezviz #32944

Closed
rpablosm opened this issue Mar 18, 2020 · 79 comments
Closed

unable to connect to Ezviz #32944

rpablosm opened this issue Mar 18, 2020 · 79 comments

Comments

@rpablosm
Copy link

The problem

I'm unable to connect to my Ezviz cameras with the new integration.

Environment

  • Home Assistant release with the issue: 0.107.0
  • Last working Home Assistant release (if known): N/A
  • Operating environment (Hass.io/Docker/Windows/etc.): Ubuntu 18.04.4 LTS
  • Integration causing this issue: ezviz
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/ezviz/

Problem-relevant configuration.yaml

camera:
  - platform: ezviz
    username: MY_USER_NAME
    password: MY_PASSWORD
    cameras:
      C123456789:
        username: CAMERA_USER_NAME
        password: CAMERA_VC

Traceback/Error logs



Logger: homeassistant.components.camera
Source: components/ezviz/camera.py:50
Integration: Cámara (documentation, issues)
First occurred: 19:52:34 (1 occurrences)
Last logged: 19:52:34
Error while setting up ezviz platform for camera

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/ezviz/camera.py", line 50, in setup_platform
    cameras = ezviz_client.load_cameras()
  File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 197, in load_cameras
    cameras.append(camera.status())
  File "/usr/local/lib/python3.7/site-packages/pyezviz/camera.py", line 97, in status
    'follow_move': self._switch[TYPE_FOLLOW_MOVE]['enable'],
KeyError: 25



Additional information

I've already checked my user and password in the ezviz application and in the url linked in the documentation

@probot-home-assistant
Copy link

Hey there @BaQs, mind taking a look at this issue as its been labeled with a integration (ezviz) you are listed as a codeowner for? Thanks!

@Harpwn
Copy link

Harpwn commented Mar 18, 2020

Same issue as above with me

@Mimiix
Copy link

Mimiix commented Mar 18, 2020

It does work here(it logs in and it sees it), but it does not show the preview, nor does the PTZ work.

@dasy98
Copy link

dasy98 commented Mar 18, 2020

Same issue

@ohipe
Copy link

ohipe commented Mar 19, 2020

same here.
just to be sure: camera name is free text or should be the same of the one in the app?

@sreknob
Copy link

sreknob commented Mar 19, 2020

Also getting an error when attempting to connect.

2020-03-18 21:04:15 ERROR (MainThread) [homeassistant.components.camera] Error while setting up ezviz platform for camera

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/ezviz/camera.py", line 49, in setup_platform
ezviz_client.login()
File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 240, in login
return self._login()
File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 87, in _login
sessionId = str(response_json["loginSession"]["sessionId"])
KeyError: 'loginSession'

Also not clear on the camera name in config. Is is supposed to be the hostname of the device OR the friendly name OR the serial number of the camera. Needs clarification on the docs...

@bf69
Copy link

bf69 commented Mar 19, 2020

stesso problema

@Mimiix
Copy link

Mimiix commented Mar 19, 2020

just to be sure: camera name is free text or should be the same of the one in the app?

You need to call it the same. It's the part with 1 letter and rest are numbers.

@saverioproscia
Copy link

Hi,
I'm not able to integrate the ezviz cameras.
in my ezviz app the names are not beginning with a letter.
The names are composed by 9 digits.
What i can try?

@sharkgreen
Copy link

Hello, warm regards!
Ezviz integrations - it doesn't work for me.

My Setting in configuration.yaml:

camera:
- platform: ezviz

username: my username of ezviz
password: my password of ezviz
cameras:
  DXXXXXXXX: #DEVICE SERIAL
    username: my username of ezviz /  my username of device #the same error occurs with both
    password: my username of ezviz /  my username of device #the same error occurs with both

Registration details (ERROR)

Logger: homeassistant.components.camera
Source: components/ezviz/camera.py:49
Integration: Cámara (documentation, issues)
First occurred: 2:55:10 (1 occurrences)
Last logged: 2:55:10

Error while setting up ezviz platform for camera
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/ezviz/camera.py", line 49, in setup_platform
ezviz_client.login()
File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 240, in login
return self._login()
File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 87, in _login
sessionId = str(response_json["loginSession"]["sessionId"])
KeyError: 'loginSession'

What is the problem?
Thank you for the support you can provide

@Mimiix
Copy link

Mimiix commented Mar 19, 2020

@sharkgreen You should put this:

username: my username of ezviz APP login
password: my password of ezviz ** APP Password**
cameras:
DXXXXXXXX: #DEVICE SERIAL
username: my username of ezviz / my username of device #the same error occurs with both admin
password: my username of ezviz / my username of device #the same error occurs with both password that is on the sticker on the device itself

@sharkgreen
Copy link

sharkgreen commented Mar 19, 2020

Yes, I am using the same data from the app. I don't understand why the error occurs.
my device is hikvision DS-7204HUHI-K1 and I can visualize it perfectly in the android ezviz app

@ohipe
Copy link

ohipe commented Mar 19, 2020

@D3nnisd my configuration is exactly as yours but not working:

Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/ezviz/camera.py", line 50, in setup_platform
cameras = ezviz_client.load_cameras()
File "/srv/homeassistant/lib/python3.7/site-packages/pyezviz/client.py", line 197, in load_cameras
cameras.append(camera.status())
File "/srv/homeassistant/lib/python3.7/site-packages/pyezviz/camera.py", line 97, in status
'follow_move': self._switch[TYPE_FOLLOW_MOVE]['enable'],
KeyError: 25

@Mimiix
Copy link

Mimiix commented Mar 19, 2020

@sharkgreen What code are you using ? the serial?

@ohipe Thats what i get.You don't have the services either. That issue is : #32981

@damiano75
Copy link

Same problem with Home Assistant 0.107.1 and Hass.io, HassOS 3.12.
I tried also without any camera defined (from the documentation it seems "cameras" is optional), but same problem:

Error while setting up ezviz platform for camera
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/ezviz/camera.py", line 50, in setup_platform
    cameras = ezviz_client.load_cameras()
  File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 197, in load_cameras
    cameras.append(camera.status())
  File "/usr/local/lib/python3.7/site-packages/pyezviz/camera.py", line 97, in status
    'follow_move': self._switch[TYPE_FOLLOW_MOVE]['enable'],
KeyError: 25

@bf69
Copy link

bf69 commented Mar 19, 2020

in my cam the serial is made only of numbers do I have to add "D" ??

@sharkgreen
Copy link

@sharkgreen What code are you using ? the serial?

the device serial, the same one I used to add the device to the app D3######6

camera:

platform: ezviz
username: myemail@gmail.com (my user app ezviz)
password: mypassword_ezviz_
D3######6: (device serial)
username: admin (user device)
password: ab123456 (password device)

@damiano75
Copy link

damiano75 commented Mar 19, 2020

Using my email as username gives me:

Error while setting up ezviz platform for camera
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/ezviz/camera.py", line 49, in setup_platform
    ezviz_client.login()
  File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 240, in login
    return self._login()
  File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 87, in _login
    sessionId = str(response_json["loginSession"]["sessionId"])
KeyError: 'loginSession'

Using user name defined in the app gives me:

Error while setting up ezviz platform for camera
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/ezviz/camera.py", line 50, in setup_platform
    cameras = ezviz_client.load_cameras()
  File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 197, in load_cameras
    cameras.append(camera.status())
  File "/usr/local/lib/python3.7/site-packages/pyezviz/camera.py", line 97, in status
    'follow_move': self._switch[TYPE_FOLLOW_MOVE]['enable'],
KeyError: 25

@sharkgreen
Copy link

Using my email as username give me:

Error while setting up ezviz platform for camera
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/ezviz/camera.py", line 49, in setup_platform
    ezviz_client.login()
  File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 240, in login
    return self._login()
  File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 87, in _login
    sessionId = str(response_json["loginSession"]["sessionId"])
KeyError: 'loginSession'

it happens the same to me

@sharkgreen
Copy link

this integration uses the SNMP protocol??

@Mimiix
Copy link

Mimiix commented Mar 19, 2020

@damiano75 The second error has correct login info. That error is becasue of some other bug. check #32981

@damiano75
Copy link

@damiano75 The second error has correct login info. That error is becasue of some other bug. check #32981

Yes, I know, it was just to add some information regarding wich cerdentials I used

@bf69
Copy link

bf69 commented Mar 19, 2020

changing any data after cameras: I always get the same error:

Logger: homeassistant.components.camera
Source: components/ezviz/camera.py:50
Integration: Telecamera (documentation, issues)
First occurred: 14:46:12 (1 occurrences)
Last logged: 14:46:12

Error while setting up ezviz platform for camera
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
return fut.result()
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/ezviz/camera.py", line 50, in setup_platform
cameras = ezviz_client.load_cameras()
File "/srv/homeassistant/lib/python3.7/site-packages/pyezviz/client.py", line 197, in load_cameras
cameras.append(camera.status())
File "/srv/homeassistant/lib/python3.7/site-packages/pyezviz/camera.py", line 97, in status
'follow_move': self._switch[TYPE_FOLLOW_MOVE]['enable'],
KeyError: 25

I use these settings:
platform: ezviz
username: MY_USER_APP / MY_EMAIL
password: MY_PWD_APP
cameras:
123456789: #DEVICE SERIAL
username: admin
password: *****

however it seems that the error is not in the configuration.

@andrearomanoif
Copy link

I have same problem:

Error while setting up ezviz platform for camera
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/ezviz/camera.py", line 50, in setup_platform
cameras = ezviz_client.load_cameras()
File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 197, in load_cameras
cameras.append(camera.status())
File "/usr/local/lib/python3.7/site-packages/pyezviz/camera.py", line 97, in status
'follow_move': self._switch[TYPE_FOLLOW_MOVE]['enable'],
KeyError: 25

@Pakul83
Copy link

Pakul83 commented Mar 19, 2020

Hello there,
I had same problem. I solved it by changing user name from e-mail to username which is set default in ezviz app. You can find it in your account setting (above phone number).

@andrearomanoif
Copy link

Hello there,
I had same problem. I solved it by changing user name from e-mail to username which is set default in ezviz app. You can find it in your account setting (above phone number).

Hello Pakul83.
I have changed configuration but the problem is still present:

My configuration.yaml

EZVIZ

camera:

  • platform: ezviz
    username: "changed email address with username displayed on the Ezviz App"
    password: "myaccountpassword"
    cameras:
    DXXXXXXXX:
    username: admin
    password: "mycampassword"

@Pakul83
Copy link

Pakul83 commented Mar 19, 2020

@andrearomanoif
Does your config look exactly like in your last post? If yes you need to format it correctly. I don't use quotation marks.

Remember to change card config with your camera type. In my case: camera.c6cn_D64150831

@sreknob
Copy link

sreknob commented Mar 19, 2020

For me it doesn’t make a difference if I use username or email, neither work...

@andrearomanoif
Copy link

@andrearomanoif
Does your config look exactly like in your last post? If yes you need to format it correctly. I don't use quotation marks.

Remember to change card config with your camera type. In my case: camera.c6cn_D64150831

I don't use quotation marks. I added them as example. If change username error is always up

@elipinska
Copy link

my solution:

  • Add ffmpeg: to configuration
  • Ezviz config:
camera:
  - platform: ezviz
    username: <GENERATED_EZVIZ_USERNAME>
    password: <PASSWORD>
    cameras:
      D49719753: <-- deviceSerial
        username: admin <-- constant, why not optional with admin as default ?
        password: <verification code next to the QR code>

THANK YOU, @ecadagiani, your comment has helped me massively and I finally got the video stream to work! And your English is far from prehistoric, I doubt they had Ezviz cameras back then 😆

@BaQs, might I suggest that the documentation for the Ezviz integration is updated to mention that ffmpeg: is required in configuration.yaml? I think it would also be handy to clarify what is meant by each mentioned username and password, as it wasn't until I came across this thread that I found out what the values should be (and I'd +1 @ecadagiani's suggestion that it would be handy if the integration could set the default username to admin).

@ohipe
Copy link

ohipe commented Apr 2, 2020

Hi @ecadagiani still not working here.
ffmpeg: is already in my configuration since it is the mode I currently use to see Ezviz camera stream in HA.
Maybe is this a model related issue?

@ohipe
Copy link

ohipe commented Apr 3, 2020

hi @BaQs
when I run pyezviz -u 'user@name.com.' -p 'my_password' devices status I receive this error:
from _bz2 import BZ2Compressor, BZ2Decompressor
ModuleNotFoundError: No module named '_bz2'

Could it be the cause of service not working in HA?
What do you suggest? Somwhere I read that python has to be rebuilt to fix this error.
thanks

@ecadagiani
Copy link

ecadagiani commented Apr 4, 2020

Hi @ecadagiani still not working here.
ffmpeg: is already in my configuration since it is the mode I currently use to see Ezviz camera stream in HA.
Maybe is this a model related issue?

Hi, @ohipe
I couldn't help you much, but I can give you some lines of research:

  • Your stream work properly? (you can test with VLC rtsp://admin:VERIFICATION_CODE@CAMERA_LOCAL_IP:554)
  • If your stream work well, you can test the API (i recommend postman, you can import request directly by copying the curl command )
# to transform your password in md5: https://timestampgenerator.com/tools/md5-generator
curl -X POST \
  https://apiieu.ezvizlife.com/v3/users/login \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'cache-control: no-cache' \
  -H 'clientType: 1' \
  -H 'customNo: 1000001' \
  -d 'account=<YOUR_USERNAME>&password=<YOUR_PASSWORD IN MD5>'

# get the sessionId, and add it in your second request
curl -X GET \
  'https://apiieu.ezvizlife.com/v3/userdevices/v1/devices/pagelist?sessionId=<SESSIONID>&filter=CLOUD,TIME_PLAN,CONNECTION,SWITCH,STATUS,WIFI,STATUS_EXT,NODISTURB,P2P,TTS,KMS,HIDDNS' \
  -H 'cache-control: no-cache'
  • If the API works well too:
    Test the ezviz python package, in another virtual-env (or in your computer) that home assistant:
    (try to debug in this other environment, if you break everything, you keep your hass safe)

pip install pyezviz pyezviz github

NB: For me, I also added stream: integration, to try to get ezviz services... but the services are not yet functional for me (#32981)

@fluppie
Copy link

fluppie commented Apr 5, 2020

I have an EZVIZ DB1 doorbell and when I do the login I get:
'NoneType' object is not subscriptable

With debug on:

 --debug devices status
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): apiieu.ezvizlife.com:443
send: b'POST /v3/users/login HTTP/1.1\r\nHost: apiieu.ezvizlife.com\r\nUser-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nContent-Type: application/x-www-form-urlencoded\r\nclientType: 1\r\ncustomNo: 1000001\r\nContent-Length: 127\r\n\r\n'
send: b'account=emailaddress%40gmail.com&password=password&featureCode=92c579faa0902cbfcfcc4fc004ef67e7'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Encoding: gzip
header: Content-Type: application/json;charset=UTF-8
header: Date: Sun, 05 Apr 2020 13:45:39 GMT
header: Server: Tengine
header: Vary: Accept-Encoding
header: Content-Length: 516
header: Connection: keep-alive
DEBUG:urllib3.connectionpool:https://apiieu.ezvizlife.com:443 "POST /v3/users/login HTTP/1.1" 200 516
send: b'GET /v3/userdevices/v1/devices/pagelist?filter=CLOUD HTTP/1.1\r\nHost: apiieu.ezvizlife.com\r\nUser-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nsessionId: 771cc98034e5484087c4950a0f360cfa\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Encoding: gzip
header: Content-Type: application/json;charset=UTF-8
header: Date: Sun, 05 Apr 2020 13:45:39 GMT
header: ETag: "046845c9fbf2bbe6b78c6aecec702bc7d"
header: Server: Tengine
header: Vary: Accept-Encoding
header: Content-Length: 991
header: Connection: keep-alive
DEBUG:urllib3.connectionpool:https://apiieu.ezvizlife.com:443 "GET /v3/userdevices/v1/devices/pagelist?filter=CLOUD HTTP/1.1" 200 991
send: b'GET /v3/userdevices/v1/devices/pagelist?filter=CLOUD%2CTIME_PLAN%2CCONNECTION%2CSWITCH%2CSTATUS%2CWIFI%2CSTATUS_EXT%2CNODISTURB%2CP2P%2CTTS%2CKMS%2CHIDDNS HTTP/1.1\r\nHost: apiieu.ezvizlife.com\r\nUser-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nsessionId: 771cc98034e5484087c4950a0f360cfa\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Encoding: gzip
header: Content-Type: application/json;charset=UTF-8
header: Date: Sun, 05 Apr 2020 13:45:39 GMT
header: ETag: "0579839bead27f1378c7b0a79e1a6227f"
header: Server: Tengine
header: Vary: Accept-Encoding
header: Content-Length: 2013
header: Connection: keep-alive
DEBUG:urllib3.connectionpool:https://apiieu.ezvizlife.com:443 "GET /v3/userdevices/v1/devices/pagelist?filter=CLOUD%2CTIME_PLAN%2CCONNECTION%2CSWITCH%2CSTATUS%2CWIFI%2CSTATUS_EXT%2CNODISTURB%2CP2P%2CTTS%2CKMS%2CHIDDNS HTTP/1.1" 200 2013
send: b'POST /api/device/queryAlgorithmConfig HTTP/1.1\r\nHost: apiieu.ezvizlife.com\r\nUser-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nContent-Length: 75\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n'
send: b'subSerial=C72927227&sessionId=771cc98034e5484087c4950a0f360cfa&clientType=1'
reply: 'HTTP/1.1 200 OK\r\n'
header: Access-Control-Allow-Headers: Content-Type, api_key, Authorization
header: Access-Control-Allow-Methods: GET, POST, DELETE, PUT, PATCH, OPTIONS
header: Access-Control-Allow-Origin: *
header: Content-Encoding: gzip
header: Content-Type: application/json;charset=UTF-8
header: Date: Sun, 05 Apr 2020 13:45:40 GMT
header: Server: Tengine
header: Vary: Accept-Encoding
header: Content-Length: 124
header: Connection: keep-alive
DEBUG:urllib3.connectionpool:https://apiieu.ezvizlife.com:443 "POST /api/device/queryAlgorithmConfig HTTP/1.1" 200 124
'NoneType' object is not subscriptable

@danielmartinezvigo
Copy link

danielmartinezvigo commented Apr 12, 2020

Same here

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/ezviz/camera.py", line 49, in setup_platform
    ezviz_client.login()
  File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 240, in login
    return self._login()
  File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 87, in _login
    sessionId = str(response_json["loginSession"]["sessionId"])
KeyError: 'loginSession'

As @ecadagiani proposed, I'm using curl to debug (apiisa for Uruguay)

  https://apiisa.ezvizlife.com/v3/users/login \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Postman-Token: f1784dd4-de08-f42b-4862-9cbe20cb1044' \
  -H 'clientType: 1' \
  -H 'customNo: 1000001' \
  -d 'account=<USER>&password=<MD5_PASSWORD>'

Response: 504 Gateway Timeout

    "meta": {
        "code": 504,
        "message": "java.lang.IllegalArgumentException: The validated string is empty",
        "moreInfo": null
    }
}

Seems to be a bug from ezviz services 😢

@Alessandro1981
Copy link

same issue...i see there is a discussion also on hassio forum: https://community.home-assistant.io/t/new-ezviz-integration-has-error/179570/13

@jp181278
Copy link

Hy guys I have a CTQ2C so a still camera 1080p the camera works perfectly with the rstp ffmpeg configuration but when I try to Setup the ezviz service I got back:

Error while setting up ezviz platform for camera
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/ezviz/camera.py", line 50, in setup_platform
cameras = ezviz_client.load_cameras()
File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 197, in load_cameras
cameras.append(camera.status())
File "/usr/local/lib/python3.7/site-packages/pyezviz/camera.py", line 97, in status
'follow_move': self._switch[TYPE_FOLLOW_MOVE]['enable'],
KeyError: 25

So it seems that when it try to Setup the followmove part that is not there for my camera it crash.

By the way I am an Italian user

@deliantwo
Copy link

I've followed the latest suggestions as putting the ffmpeg: in configuration, the autogenerated username, etc. but I was still getting a "KeyError: 25".

Than I've updated the camera firmware to the latest version and played a bit with the app profile settings, like "my shares" ( or similar I've the app in my native language ), cloudplay or "logout 3rd party account", just opening the menus, I've changed nothing.

I don't know what exactly did the trick but now it works.

Maybe it can helps someone.

@jp181278
Copy link

jp181278 commented Apr 27, 2020

Can you post some image about the app config?
Which camera di you nave?

@deliantwo
Copy link

Can you post some image about the app config?
Which camera di you nave?

I have a cs-cv310.
I was talking about the android app, If it wasn't clear, with default settings.

@Schmedu
Copy link

Schmedu commented May 10, 2020

I've followed the latest suggestions as putting the ffmpeg: in configuration, the autogenerated username, etc. but I was still getting a "KeyError: 25".

Than I've updated the camera firmware to the latest version and played a bit with the app profile settings, like "my shares" ( or similar I've the app in my native language ), cloudplay or "logout 3rd party account", just opening the menus, I've changed nothing.

I don't know what exactly did the trick but now it works.

Maybe it can helps someone.

Updating to the newest camera firmware did the trick for me. Thanks for the suggestion!

@damiano75
Copy link

damiano75 commented May 11, 2020 via email

@jp181278
Copy link

I've android phone with ezviz official app a CTQ2C CS-CV206 camera with the last Sw available v5.2.7 build 200310 and I've the 25 Error that keeps coming, the configuration of the app is the out of the box one.

@ghost
Copy link

ghost commented May 17, 2020

This is my camera config ( I don't know why the pictures is not shown up)

camera:

  • platform: ffmpeg
    name: (Name your camera)
    input: rtsp://admin:(verification code under camera@(your camera ip address):554

*you need to delete the brackets first.

@engal89
Copy link

engal89 commented May 23, 2020

Hi,
i try to write a recap about my studies on the component, hope to help @BaQs and the community to solve some issues.
I'm moving my first steps in python so i'm not already able to do commits. But i want to help.
I was one of the people that has this problem:

File "/srv/homeassistant/lib/python3.7/site-packages/pyezviz/camera.py", line 97, in status
'follow_move': self._switch[TYPE_FOLLOW_MOVE]['enable'],
KeyError: 25

i try to update my manifest version of pyezviz (in home assistant) but the problem was still here. So i comment manually all about motion detect on code (about 3 line of code, notthing hard) and the component seems to work correctly.
So i think that, with the version of pyezviz that is in the develop branch, maybe this problem will be solved. I don't know when will be release.
At this point there was another 2 problem:

  1. video stream was not working (message "...does not support play stream service" of default camera components.
  2. no one of the services mentioned in ezviz component page was present

So for solve the stream problem i try to empty the method stream_source(self) of ezviz component leaving only the return with my rtsp link (brutal simply string) and now the stream work. So i think there is a problem in that method, but i can't find it.
I'm starting to work on the services problem, hope to find something about.

@AngelofromTurin
Copy link

Ciao,
provo a scrivere un riassunto dei miei studi sul componente, spero di aiutare @BaQs e la community a risolvere alcuni problemi.
Sto muovendo i miei primi passi in Python, quindi non sono già in grado di fare commit. Ma voglio aiutare.
Ero una delle persone che ha questo problema:

File "/srv/homeassistant/lib/python3.7/site-packages/pyezviz/camera.py", line 97, in status
'follow_move': self._switch[TYPE_FOLLOW_MOVE]['enable'],
KeyError: 25

provo ad aggiornare la mia versione manifest di pyezviz (in home assistant) ma il problema era ancora qui. Quindi commento manualmente tutto sul rilevamento del movimento sul codice (circa 3 righe di codice, niente di difficile) e il componente sembra funzionare correttamente.
Quindi penso che, con la versione di pyezviz che si trova nel ramo di sviluppo, forse questo problema sarà risolto. Non so quando sarà rilasciato.
A questo punto c'era un altro 2 problema:

  1. il flusso video non funzionava (il messaggio "... non supporta il servizio di riproduzione flusso" dei componenti predefiniti della videocamera.
  2. nessuno dei servizi menzionati nella pagina del componente ezviz era presente

Quindi per risolvere il problema del flusso provo a svuotare il metodo stream_source (self) del componente ezviz lasciando solo il ritorno con il mio link rtsp (brutale semplicemente stringa) e ora il flusso funziona. Quindi penso che ci sia un problema in quel metodo, ma non riesco a trovarlo.
Sto iniziando a lavorare sul problema dei servizi, spero di trovare qualcosa.

hi
can show the 3 line of code you comment ? i will try to follow youre way...
thank you

@ohipe
Copy link

ohipe commented May 27, 2020

hi everybody,
I solved the issue of FOLLOW_MOVE just commenting all lines where this parameter was used in the camera-py. My cameras have not this option so it could be ok to me. Now The component starts correctly, I can see camera properties but.... two random cameras have been defined in HA (not the one I put in my config) and no serves have been created at all...

@jpdavidson
Copy link

Any answers yet, been fiddling with CS-CV310 for some time trying to get it connected. Have read through all the posts here and tried everything to no avail so far. But now I will try a little harder as I see the matter hasn't been solved yet - I'm no programmer, I just dabble and delve when needs amust.

@engal89
Copy link

engal89 commented May 29, 2020

Ciao,
provo a scrivere un riassunto dei miei studi sul componente, spero di aiutare @BaQs e la community a risolvere alcuni problemi.
Sto muovendo i miei primi passi in Python, quindi non sono già in grado di fare commit. Ma voglio aiutare.
Ero una delle persone che ha questo problema:

File "/srv/homeassistant/lib/python3.7/site-packages/pyezviz/camera.py", line 97, in status
'follow_move': self._switch[TYPE_FOLLOW_MOVE]['enable'],
KeyError: 25

provo ad aggiornare la mia versione manifest di pyezviz (in home assistant) ma il problema era ancora qui. Quindi commento manualmente tutto sul rilevamento del movimento sul codice (circa 3 righe di codice, niente di difficile) e il componente sembra funzionare correttamente.
Quindi penso che, con la versione di pyezviz che si trova nel ramo di sviluppo, forse questo problema sarà risolto. Non so quando sarà rilasciato.
A questo punto c'era un altro 2 problema:

  1. il flusso video non funzionava (il messaggio "... non supporta il servizio di riproduzione flusso" dei componenti predefiniti della videocamera.
  2. nessuno dei servizi menzionati nella pagina del componente ezviz era presente

Quindi per risolvere il problema del flusso provo a svuotare il metodo stream_source (self) del componente ezviz lasciando solo il ritorno con il mio link rtsp (brutale semplicemente stringa) e ora il flusso funziona. Quindi penso che ci sia un problema in quel metodo, ma non riesco a trovarlo.
Sto iniziando a lavorare sul problema dei servizi, spero di trovare qualcosa.

hi
can show the 3 line of code you comment ? i will try to follow youre way...
thank you

Hi i've made a pull request in the pyezviz project. I think you can see there what i've done.
If the fix will be part of a new release of pyezviz i will try to fix the HA component.

@engal89
Copy link

engal89 commented May 29, 2020

hi everybody,
I solved the issue of FOLLOW_MOVE just commenting all lines where this parameter was used in the camera-py. My cameras have not this option so it could be ok to me. Now The component starts correctly, I can see camera properties but.... two random cameras have been defined in HA (not the one I put in my config) and no serves have been created at all...

I've seen that the component add also my second camera (that i've not configured in configuration.yaml) so, maybe are some old referencies to old camera or passed wrong configuration in your account?

@hongnhan100
Copy link

Hello, warm regards!
Ezviz integrations - it doesn't work for me.

My Setting in configuration.yaml:

camera:
- platform: ezviz

username: my username of ezviz
password: my password of ezviz
cameras:
  DXXXXXXXX: #DEVICE SERIAL
    username: my username of ezviz /  my username of device #the same error occurs with both
    password: my username of ezviz /  my username of device #the same error occurs with both

Registration details (ERROR)

Logger: homeassistant.components.camera
Source: components/ezviz/camera.py:49
Integration: Cámara (documentation, issues)
First occurred: 2:55:10 (1 occurrences)
Last logged: 2:55:10

Error while setting up ezviz platform for camera
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/ezviz/camera.py", line 49, in setup_platform
ezviz_client.login()
File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 240, in login
return self._login()
File "/usr/local/lib/python3.7/site-packages/pyezviz/client.py", line 87, in _login
sessionId = str(response_json["loginSession"]["sessionId"])
KeyError: 'loginSession'

What is the problem?
Thank you for the support you can provide

When I changed location in Ezviz app to UK,I connect success

@lemonlatte
Copy link

lemonlatte commented Jun 21, 2020

When I changed location in Ezviz app to UK,I connect success

I think the root cause is that when the plugin requests to https://apiieu.ezvizlife.com/v3/users/login, you will receive a response to redirect a local api server. For example:

{"meta":{"code":1100,"message":"","moreInfo":null},"loginArea":{"apiDomain":"apiisgp.ezvizlife.com","webDomain":"isgp.ezvizlife.com","areaName":"","areaId":}}

Switching the app location to EU works for me as well.

@bilalbayasut
Copy link

how to switch the app location to EU ? as It's immutable

@lemonlatte
Copy link

lemonlatte commented Jul 6, 2020

how to switch the app location to EU ? as It's immutable

Sorry. It is not a switching. I logged out and re-selected an EU country and signed up for a new account.

@antoweb
Copy link

antoweb commented Sep 3, 2020

Same problem here my serial start with E is a ezviz C6N
Sorry wrong pwd used. Works good also with C6N

@BigHomie90
Copy link

Hi, i am getting the following error.

Log Details (ERROR)
Logger: homeassistant.components.camera
Source: components/ezviz/camera.py:50
Integration: Camera (documentation, issues)
First occurred: 11:31:57 AM (1 occurrences)
Last logged: 11:31:57 AM

Error while setting up ezviz platform for camera
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 184, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/ezviz/camera.py", line 50, in setup_platform
    cameras = ezviz_client.load_cameras()
  File "/usr/local/lib/python3.8/site-packages/pyezviz/client.py", line 197, in load_cameras
    cameras.append(camera.status())
  File "/usr/local/lib/python3.8/site-packages/pyezviz/camera.py", line 96, in status
    'state_led': self._switch[TYPE_STATE_LED]['enable'],
KeyError: 3

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests