Really great solution, I had worked on something similar for quite a while but never published it, good on you!
I have 3 camera’s configured and they are showing up in HA but all of the Entities for each camera are shown as Unavailable.
Device info
DS-2CD2335FWD-I (IPCamera)
by Hikvision
Firmware: Camera Firmware V5.5.61 (build 180718)
Entities
Driveway CH1 Attended Baggage Unavailable
Driveway CH1 Bad Video Unavailable
Driveway CH1 Disk Error Unavailable
Driveway CH1 Disk Full Unavailable
Driveway CH1 Face Detection Unavailable
...
Some of the logs, let me know if you want the rest via github:
DEBUG Camera coms{camera=Driveway id=driveway}: hyper::client::connect::http: connected to 10.1.10.27:80
DEBUG hyper::proto::h1::io: flushed 377 bytes
INFO Camera coms{camera=Front Yard id=front_yard}: hik_sink::hikapi::camera: Camera connection established
DEBUG hik_sink::mqtt::connection: Camera event id="front_yard" event=Connected { info: DeviceInfo { device_name: "Front Yard", device_id: "XXXXXX", model: "DS-2CD2342WD-I", serial_number: "DS-2CD2342WD-XXXX", mac_address: "c4:2f:90:XXXXX", firmware_version: "V5.4.5", firmware_release_date: "build 170124", device_type: "IPCamera" }, triggers: [TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: Motion }, hik_id: "VMD-1", description: "VMD Event trigger Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: Tamper }, hik_id: "tamper-1", description: "shelteralarm Event trigger Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: DiskFull }, hik_id: "diskfull", description: "exception Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: DiskError }, hik_id: "diskerror", description: "exception Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: NicBroken }, hik_id: "nicbroken", description: "exception Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: IpConflict }, hik_id: "ipconflict", description: "exception Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: IllegalAccess }, hik_id: "illaccess", description: "exception Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: LineDetection }, hik_id: "linedetection-1", description: "Linedetection Event trigger Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: FieldDetection }, hik_id: "fielddetection-1", description: "fielddetection Event trigger Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: VideoMismatch }, hik_id: "videomismatch", description: "exception Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: BadVideo }, hik_id: "badvideo", description: "exception Information" }] }
DEBUG hyper::proto::h1::io: parsed 3 headers
DEBUG hyper::proto::h1::conn: incoming body is close-delimited
INFO Camera coms{camera=Driveway id=driveway}: hik_sink::hikapi::camera: Camera connection established
DEBUG hik_sink::mqtt::connection: Camera event id="front_yard" event=Alert(AlertItem { identifier: EventIdentifier { channel: Some("1"), event_type: VideoLoss }, active: false, regions: [], post_count: 0, description: "videoloss alarm", date: "2021-09-28T15:58:11-8:00" })
DEBUG hik_sink::mqtt::connection: Camera event id="driveway" event=Connected { info: DeviceInfo { device_name: "Driveway", device_id: "XXXXXX", model: "DS-2CD2335FWD-I", serial_number: "DS-2CD2335FWD-XXXX", mac_address: "18:68:cb:XXXX", firmware_version: "V5.5.61", firmware_release_date: "build 180718", device_type: "IPCamera" }, triggers: [TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: Motion }, hik_id: "VMD-1", description: "VMD Event trigger Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: Tamper }, hik_id: "tamper-1", description: "shelteralarm Event trigger Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: DiskFull }, hik_id: "diskfull", description: "exception Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: DiskError }, hik_id: "diskerror", description: "exception Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: NicBroken }, hik_id: "nicbroken", description: "exception Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: IpConflict }, hik_id: "ipconflict", description: "exception Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: IllegalAccess }, hik_id: "illaccess", description: "exception Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: LineDetection }, hik_id: "linedetection-1", description: "Linedetection Event trigger Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: FieldDetection }, hik_id: "fielddetection-1", description: "fielddetection Event trigger Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: VideoMismatch }, hik_id: "videomismatch", description: "exception Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: BadVideo }, hik_id: "badvideo", description: "exception Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: FaceDetection }, hik_id: "facedetection-1", description: "facedetection Event trigger Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: UnattendedBaggage }, hik_id: "unattendedBaggage-1", description: "UnattendedBaggage Event trigger Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: AttendedBaggage }, hik_id: "attendedBaggage-1", description: "AttendedBaggage Event trigger Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: StorageDetection }, hik_id: "storageDetection-1", description: "storageDetection Event trigger Information" }, TriggerItem { identifier: EventIdentifier { channel: Some("1"), event_type: SceneChangeDetection }, hik_id: "scenechangedetection-1", description: "scenechangedetection Event trigger Information" }] }
DEBUG hyper::proto::h1::io: parsed 5 headers
DEBUG hyper::proto::h1::conn: incoming body is content-length (21199 bytes)
DEBUG hyper::proto::h1::conn: incoming body completed
DEBUG Camera coms{camera=North Yard id=north_yard}: hyper::client::connect::http: connecting to 10.1.10.22:80
DEBUG Camera coms{camera=North Yard id=north_yard}: hyper::client::connect::http: connected to 10.1.10.22:80
DEBUG hyper::proto::h1::io: flushed 85 bytes
DEBUG hyper::proto::h1::io: parsed 7 headers
DEBUG hyper::proto::h1::conn: incoming body is content-length (283 bytes)
DEBUG hyper::proto::h1::conn: incoming body completed
DEBUG Camera coms{camera=North Yard id=north_yard}: hyper::client::pool: pooling idle connection for ("http", 10.1.10.22)
DEBUG Camera coms{camera=North Yard id=north_yard}: hyper::client::pool: reuse idle connection for ("http", 10.1.10.22)
DEBUG hyper::proto::h1::io: flushed 373 bytes
DEBUG hyper::proto::h1::io: parsed 2 headers
DEBUG hyper::proto::h1::conn: incoming body is close-delimited
DEBUG hik_sink::mqtt::connection: Camera event id="front_yard" event=Alert(AlertItem { identifier: EventIdentifier { channel: Some("1"), event_type: VideoLoss }, active: false, regions: [], post_count: 0, description: "videoloss alarm", date: "2021-09-28T15:58:17-8:00" })
DEBUG hik_sink::mqtt::connection: Camera event id="north_yard" event=Alert(AlertItem { identifier: EventIdentifier { channel: Some("1"), event_type: VideoLoss }, active: false, regions: [], post_count: 0, description: "videoloss alarm", date: "2021-09-28T15:58:16--8:00" })
DEBUG hik_sink::mqtt::connection: Camera event id="front_yard" event=Alert(AlertItem { identifier: EventIdentifier { channel: Some("1"), event_type: VideoLoss }, active: false, regions: [], post_count: 0, description: "videoloss alarm", date: "2021-09-28T15:58:17-8:00" })
DEBUG hik_sink::mqtt::connection: Camera event id="north_yard" event=Alert(AlertItem { identifier: EventIdentifier { channel: Some("1"), event_type: VideoLoss }, active: false, regions: [], post_count: 0, description: "videoloss alarm", date: "2021-09-28T15:58:17--8:00" })
DEBUG hik_sink::mqtt::connection: Camera event id="front_yard" event=Alert(AlertItem { identifier: EventIdentifier { channel: Some("1"), event_type: VideoLoss }, active: false, regions: [], post_count: 0, description: "videoloss alarm", date: "2021-09-28T15:58:17-8:00" })
DEBUG hik_sink::mqtt::connection: Camera event id="north_yard" event=Alert(AlertItem { identifier: EventIdentifier { channel: Some("1"), event_type: VideoLoss }, active: false, regions: [], post_count: 0, description: "videoloss alarm", date: "2021-09-28T15:58:17--8:00" })
DEBUG hik_sink::mqtt::connection: Camera event id="front_yard" event=Alert(AlertItem { identifier: EventIdentifier { channel: Some("1"), event_type: VideoLoss }, active: false, regions: [], post_count: 0, description: "videoloss alarm", date: "2021-09-28T15:58:17-8:00" })
DEBUG hik_sink::mqtt::connection: Camera event id="north_yard" event=Alert(AlertItem { identifier: EventIdentifier { channel: Some("1"), event_type: VideoLoss }, active: false, regions: [], post_count: 0, description: "videoloss alarm", date: "2021-09-28T15:58:17--8:00" })
DEBUG hik_sink::mqtt::connection: Camera event id="front_yard" event=Alert(AlertItem { identifier: EventIdentifier { channel: Some("1"), event_type: VideoLoss }, active: false, regions: [], post_count: 0, description: "videoloss alarm", date: "2021-09-28T15:58:18-8:00" })
DEBUG hik_sink::mqtt::connection: Camera event id="north_yard" event=Alert(AlertItem { identifier: EventIdentifier { channel: Some("1"), event_type: VideoLoss }, active: false, regions: [], post_count: 0, description: "videoloss alarm", date: "2021-09-28T15:58:18--8:00" })