core: unable to connect to Ezviz

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

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 79 (5 by maintainers)

Most upvoted comments

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.

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

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.

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.

Hi everyone, I work for me (with an CTQ6C).

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>

I share my research, hoping that it could help someone:

  • Firstly, I tested my camera with a rtsp url in vlc: rtsp://admin:VERIFICATION_CODE@CAMERA_LOCAL_IP:554

  • Secondly, because it is late and the French confinement is probably starting to steal my mental health, I explored the code and the ezviz API:

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>'
curl -X GET \
  'https://apiieu.ezvizlife.com/v3/userdevices/v1/devices/pagelist?filter=CLOUD,TIME_PLAN,CONNECTION,SWITCH,STATUS,WIFI,STATUS_EXT,NODISTURB,P2P,TTS,KMS,HIDDNS&sessionId=<SESSIONID>' \
  -H 'cache-control: no-cache'

you can get SESSIONID from loginSession.session_id in the first curl Sorry for my prehistoric english 😉

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