maciej-or / hikvision_next

Home Assistant integration for Hikvision NVRs and IP cameras
115 stars 23 forks source link

Manage Cameras outside the HA Network #249

Closed lebretr closed 2 days ago

lebretr commented 1 week ago

This pull request adds support for accessing Hikvision cameras outside of the Home Assistant network.

Use Case example: Home Assistant is in a house and cameras are in another house. So, HA accesses the cameras with an external address https://mysecondhoud.domain and the cameras send alert messages to HA with the address https://ha.myfirsthouse.domain

For this, on the router of the second house, we have to configure NAT like that: Device Inner port Outside port Info
CAM 1 554 5001 RTSP
CAM 1 443 4001 HTTPS
CAM 2 554 5002 RTSP
CAM 2 443 4002 HTTPS

To manage this use case, the key changes are:

Other changes:

Note: I'm not a python developper so maybe there is better way to test on windows et manage loading several device in one unit test

maciej-or commented 6 days ago

thanks for the contribution, I will help improve the tests