RenierM26 / ha-ezviz

Ezviz component for HASSIO, testing latest additions to official integration. (The few I work on at least)
GNU General Public License v3.0
44 stars 21 forks source link

[Feature Request] BC1 Battery Powered Wi-Fi Camera #75

Open uvjim opened 3 years ago

uvjim commented 3 years ago

I have recently purchased an ezviz camera kit model: CS-BC1-B2. I have tried to use this integration to access the cameras (the native one in HASS doesn't find any devices). This integration finds the base station but does not identify any of the cameras.

I'm not sure whether it is best to raise that here or in the underlying library.

Is it possible to support these cameras?

The library identifies the device as the following (serial numbers removed): -

{
  'name': 'Lounge Hub',
  'deviceSerial': '<serial>',
  'fullSerial': '<full_serial>',
  'deviceType': 'CS-W2H-BW300FD',
  'devicePicPrefix': 'https://devpic.ezvizlife.com/device/image/CS-W2H-BW300FD/',
  'version': 'V1.3.1 build 210511',
  'supportExt': '{"46":"1","68":"1","28":"1","171":"4","172":"1","152":"1","232":"0","156":"1","233":"0","354":"1","234":0,"333":"1","377":"1","236":"1","335":"0","237":"1","436":"1","316":"1","92":"1","51":"1","73":"1","30":"0","96":"1","31":"0","10":"1","54":"1","55":"1","13":"0","14":"1","15":"1","59":"1","381":"1","141":"1","285":"1","166":"1","2":"4","222":"1","146":"1","4":"1","5":"1","149":"1","7":"1","106":"1","205":"1","8":"1","80":"1","9":"1"}',
  'status': 1,
  'userDeviceCreateTime': '2021-06-21 11:10:58',
  'casIp': 'eucas.ezvizlife.com',
  'casPort': 6500,
  'channelNumber': 0,
  'hik': False,
  'deviceCategory': 'IGateWay',
  'deviceSubCategory': 'W2H',
  'ezDeviceCapability': '{"262":"1","175":"1","263":"0","264":"1","232":"0","265":"1","233":"0","266":"0","234":1,"267":"1","289":"1","30":"0","31":"0"}',
  'customType': 'CS-W2H-BW300FD',
  'offlineTime': '2021-06-21 12:41:27',
  'offlineNotify': 0,
  'accessPlatform': True,
  'deviceDomain': 'G07264650',
  'instructionBook': 'http://devpic.ezvizlife.com/device/image/CS-W2H-BW300FD/instruction.jpeg',
  'deviceShareInfo': None,
  'feature': None,
  'riskLevel': 0,
  'offlineTimestamp': 1624279287000
}
BartOo commented 3 years ago

did you get it working?

uvjim commented 3 years ago

Afraid not. I have one camera that I don't need to change the state of so I have left that mounted and in position. The second one, which needs arming/disarming based on presence etc, is still in the box and I'm using my existing cameras to cover that area.

Shamshala commented 2 years ago

So that's the reason behind my issue with official integration and this "custom one" does report only Alarm (but it doesn't change/react to anything).

Dammit, I recklessly assumed it's EZVIZ so it should be supported... (for a long term HAuser, quite sad and newbie mistake)

RenierM26 commented 2 years ago

Hi There,

Would anyone be able to test a modification to the pyezviz api? It might be a simple fix to add support for this camera.

in constants.py file, change the following:

COMMON_DEVICE_CATEGORY = "COMMON"

to

COMMON_DEVICE_CATEGORY = "IGateWay"

If this works, I'll update the library to support the device.

BartOo commented 2 years ago

I think I tried it(changed via portainer and rebooted complete device, setting was not changed) and didn't add the other cameras. Do I need to do somerhing else? I'm not superexperienced with this ;-)

Shamshala commented 2 years ago

@RenierM26 Hi and thanks! If I didn't make a mistake I successfully tested it, unfortunately with no difference. Still the same Alarm entity with nothing else for me.

Anything else I can do to help to get it implemented?

According to the Ezviz app it seems like BC1 should be under "BatteryCamera" category. bfgydfybfd

uvjim commented 2 years ago

Hi There,

Would anyone be able to test a modification to the pyezviz api? It might be a simple fix to add support for this camera.

in constants.py file, change the following:

COMMON_DEVICE_CATEGORY = "COMMON"

to

COMMON_DEVICE_CATEGORY = "IGateWay"

If this works, I'll update the library to support the device.

I don't actually have these setup at the moment. But I may be able to test tomorrow.

Freddy315pk commented 2 years ago

Since the last update, it works!! HA can see the cameras, but when adding them, it asks for a username and password but I get a hostname/IP address error?

RenierM26 commented 2 years ago

Hi @Freddy315pk,

Did you need to change anything? What version are you using?

Are you getting the error after entering the camera username and password or before?

Freddy315pk commented 2 years ago

Hi @Freddy315pk,

Did you need to change anything? What version are you using?

Are you getting the error after entering the camera username and password or before?

Didn't change anything, just updated to 0.0.8.7 beta version.

I'm getting the error after entering the username and password. I think my problem is, I don't even know which username and password I should enter. The sticker on the camera doesn't have any info on that. The cameras are showing up in the integration with a lot of switches and sensors and there's a seperate integration made for each camera, so there is progress!!

Edit: just updated to 0.0.8.9, same issue. Also tried the verification code on the sticker of the base-station, no luck.

RenierM26 commented 2 years ago

Hi @Freddy315pk,

You could try enabling encryption on the camera, the app might guide you to the correct verification code.

All Ezviz cameras I've encountered so far use the "admin" username and the same verification code used when you setup encryption or manually add a camera. I haven't worked with any cameras connected to a base station yet so it might be different.

Just remember to disable encryption after because the RTSP stream doesn't work when encryption is enabled on the device. (At present at least.)

RenierM26 commented 2 years ago

Hi @Freddy315pk, just read a review on this camera where it looks like it doesn't support RTSP. Might be out of luck for the moment.

The cameras should support WebRTC but I still need to figure out how that works. It looks like I can get all the connection details for this to work but it still needs some figuring out.

Freddy315pk commented 2 years ago

Tried encrypting the camera, doesn't work. Still the same error with IP/hostname. I suspect it has something to do with the fact that the base-station creates a seperate wifi network to the cameras with a different IP address. It's just a guess, my knowledge only goes so far..

Image doesn't work, but I can use the motion detection sensors for Alarmo so I'm very happy! Thanks for the hard work!

Edit: Maybe https://github.com/meetecho/janus-gateway is an option? I have no coding knowledge or experience so I'm just spit-balling here..

Shamshala commented 2 years ago

@RenierM26 Same as for @Freddy315pk, since v0.0.8.7 it miracously started to work as well. Unfortunately some sensors don't update for me (Motion_Trigger, pir_status), still a progress though. 🙂

What surprised me is that even the official integration picked up the RTSP as a "New device" after the update (does the beta update the same package in path for pyEzviz?). Otherwise I'm on the same boat as @Freddy315pk in terms of behaviour of the BC1.

RenierM26 commented 2 years ago

Hi @Shamshala,

The latest api should work with the native hassio integration. All additions/changes to this "beta" integration does make it's way to the native integration, I use this to test repo to test before submitting a pull request for the official integration.

The latest api makes use of the latest endpoint that the Android app uses and more or less mirrors the requests sent to the ezviz servers. I suspect the old page list endpoint was not reporting all the device info correctly.

As far as I can tell, the BC1 doesn't support RTSP so the video feed won't work. I still need to reverse engineer the WebRTC endpoints (or challenge/response) but it should be much easier since HA now officially supports WebRTC.

The motion_trigger sensor makes use of the "alarm list" on the app. If motion detection alerts work in the Ezviz Phone app, it should update this sensor in HA.

janegilring commented 2 years ago

If you get WebRTC to work, how will it work in practice? Will we be able to see still images for the cameras, or will it simply be a link to start live stream?

PS: When 2-factor authentication is enabled, is it still possible to add the EzViz account to HA? I tried, but got an auth error - even though an e-mail with a code was sent.

davi88de commented 2 years ago

Hello everyone! Has anyone managed to integrate bc1 cameras on Home Assistant? Thank you!

marcgiovannoni commented 2 years ago

Any update on WebRTC support? RTSP doesn't seems to be supported on those camera...