laszlojakab / hikvision-intercom-python-demo

Hikvsion intercom Python demo
MIT License
19 stars 6 forks source link

Added Linux/Windows transparent logging (addressing Issue #5) #6

Open oleg-shilo opened 1 year ago

pergolafabio commented 1 year ago

hey @oleg-shilo

i created a while ago an Addon for Home Assistant, the addon was based on 3.10.8 python, seems now updated to 3.10.9 and receive also segmen fault even when i remove the device_info from the login, i get that error any idea why ?

oleg-shilo commented 1 year ago

I do not have the answer for you :(

But interestingly enough suddenly my home server started failing and after the investigation, I found that the very workaround started causing the problem. So I started using the same initialization call (with device info).

I cannot explain it. The solution with the workaround was working for 4 months and for no reason, it stopped. Since my Linux box is locked and does not update itself I can only blame the device firmware upgrade. I cannot prove it because I don't have a record of the original firmware version. But it could be the only logical explanation.

Not sure this helps...

pergolafabio commented 1 year ago

maybe your python updated too?

Well , i reverted my Home Asistant addon back to 3.10.8 , all working again :-)

oleg-shilo commented 1 year ago

That's the thing. I have Linux box auto-updates disabled. Unless Python does it on its own...

pergolafabio commented 1 year ago

hmm, normally not, you can always check the version? i know the lib is quite picky about versions... Are you also using Home Assistant?

What doorbell do you have btw?

oleg-shilo commented 1 year ago

I have DS-KV8102-IM intercom, which I integrated with Fibaro HC3.

I use z-wave nob as a wall button to open the gates from the building entrance. Hikvision phone app is so slow and requires so many clicks so if I use it to open the gates when I exit the house I can even forget the reason why I am getting out :)

Just pressing a single button on the wall is way more natural.

pergolafabio commented 1 year ago

Yes, that's indeed possible :-)

pergolafabio commented 1 year ago

Is your device the same as this one? (DS-KV8120-IP)

I have heard other uses complaining using the script, that it doesn't give any event on a door press/call.

Do you see it in the script?

oleg-shilo commented 1 year ago

My device (https://www.hikvision.com/my/products/Video-Intercom-Products/IP-Series/Pro-Series/DS-KV8102-IM/) is not identical to that one but somewhat similar.

As for the script, I only use it to send the command to "open door". Nothing else, only that single command.

I have a tiny little box running Linux, which hosts WebAPI automation web server (.net core) And Fibaro communicates with it via REST interface. This web server is nothing else but an extension of the Fibaro HC3 for the scenarios, which FIbaro does not directly support. Deriving Hikvision intercome one of these scenarios.

pergolafabio commented 1 year ago

Ah, ok , need to find someone else then with that device...

If you use script only for door unlock, I think you can better just use the ISAPi command, it's 1 line

pergolafabio commented 1 year ago

You can just use this for opening door, no SDK needed...

curl -i --digest -u admin:xxx -X PUT -d '<RemoteControlDoor><cmd>open</cmd></RemoteControlDoor>' http://192.168.0.x/ISAPI/AccessControl/RemoteControl/door/1

oleg-shilo commented 1 year ago

That's excellent. Did not know that. Thank you, mate.