pergolafabio / Hikvision-Addons

Home Assistant: Hikvision Doorbell
187 stars 41 forks source link

Feature: Badge/code control #130

Open pergolafabio opened 1 year ago

pergolafabio commented 1 year ago

Is there an existing feature request for this?

Add-on

Doorbell

Your feature request

Found usefull commands todo badge/code control:

curl -i --digest -u admin:xxx http://192.168.0.70/ISAPI/AccessControl/UserInfo/capabilities?format=json
curl -i --digest -u admin:xxx http://192.168.0.70/ISAPI/AccessControl/UserInfo/Count?format=json

curl -i --digest -u admin:xxx -X POST -H "Content-Type: application/json" -d '{"UserInfoSearchCond":{"searchID":"1","searchResultPosition": 0,"maxResults": 10,"EmployeeNoList":[{"employeeNo":"6"}]}}' http://192.168.0.70/ISAPI/AccessControl/UserInfo/Search?format=json
curl -i --digest -u admin:xxx -X POST -H "Content-Type: application/json" -d '{"UserInfoSearchCond":{"searchID":"1","searchResultPosition": 0,"maxResults": 10}}' http://192.168.0.70/ISAPI/AccessControl/UserInfo/Search?format=json

curl -i --digest -u admin:xxx http://192.168.0.70/ISAPI/AccessControl/CardInfo/capabilities?format=json
curl -i --digest -u admin:xxx http://192.168.0.70/ISAPI/AccessControl/CardInfo/Count?format=json
curl -i --digest -u admin:xxx http://192.168.0.70/ISAPI/AccessControl/CardInfo/Count?format=json&employeeNo=6

curl -i --digest -u admin:xxx -X POST -H "Content-Type: application/json" -d '{"CardInfoSearchCond": {"searchID": "1","maxResults": 10,"searchResultPosition": 0,"EmployeeNoList": [{ "employeeNo": "6" }]}}' http://192.168.0.70/ISAPI/AccessControl/CardInfo/Search?format=json
curl -i --digest -u admin:xxx -X POST -H "Content-Type: application/json" -d '{"CardInfoSearchCond": {"searchID": "1","maxResults": 10,"searchResultPosition": 0}}' http://192.168.0.70/ISAPI/AccessControl/CardInfo/Search?format=json

curl -i --digest -u admin:xxx http://192.168.0.70/ISAPI/VideoIntercom/PrivilegePasswordStatus
curl -i --digest -u admin:xxx http://192.168.0.70/ISAPI/VideoIntercom/PrivilegePasswordCfg/capabilities?format=json

PUT  /ISAPI/VideoIntercom/PrivilegePasswordCfg?format=json&security=<security>&iv=<iv>
POST /ISAPI/VideoIntercom/DeletePrivilegePasswordList?format=json

curl -i --digest -u admin:xxx http://192.168.0.70/ISAPI/SecurityCP/AlarmControlByPhone
curl -i --digest -u admin:xxx http://192.168.0.70/ISAPI/SecurityCP/AlarmControlByPhone/capabilities?format=json
curl -i --digest -u admin:xxx -X PUT -d '<AlarmControlByPhoneCfg><commandType>closeAlarm</commandType></AlarmControlByPhoneCfg>' http://192.168.0.70/ISAPI/SecurityCP/AlarmControlByPhone
xtc0r commented 1 year ago

What cards / protocol does the card reader of the HikVision door bells support? Could we use our smartphones (NFC) to unlock the door?

pergolafabio commented 1 year ago

hmm, dont think so by default , cause everytime you use the NFC of your android, its generates a random number, or you need to get some development kit from hikvision itself so it can get recognized...

what you can do , is to place an NFC sticker at the back of your phone, so that will be your "badge"

xtc0r commented 1 year ago

After reading some posts at stackoverflow it is indeed not possible to use the phone. I didn't expect this. So then we use a NFC tag. Still nice.

pergolafabio commented 1 year ago

Yeah I asked hikvsion to maybe get some dev kit, should be possible

pergolafabio commented 1 year ago

Hmm this one looks interesting, by using the wallet on our phones.. cause the debit cards send an unique uuid everytime... (not tested yet)

https://passninja.com/

pergolafabio commented 1 year ago

Or this test card:

https://help.passkit.com/en/articles/4430727-enabling-and-using-nfc-passes

pergolafabio commented 1 year ago

Seems there are also card emulator apps, that send unique data... But I prefer the wallet / card method, cause I can open door with my smartwatch also :-)

Gonna try this later

xtc0r commented 1 year ago

We would need special terminals and could not reuse the HikVision intercom readers.

Why can't I read a pass with my NFC reader or NFC app? 
Both Apple VAS (Value Added Services) and Google SmartTap use proprietary protocols to communicate data between the phone and the terminal.  A regular NFC tag reader or NFC tag reading application cannot read an NFC pass
pergolafabio commented 1 year ago

well, i just tested thet NFC Card by adding to wallet, it sends a fixed uuid, and i can open the door now with my android

warrior12051985 commented 1 year ago

Hi, with this function will you make the number of the last NFC read available?

pergolafabio commented 1 year ago

To see who opened the door ? That's already visible as an attributes of the door switch, it's called the control_source

pcaro commented 8 months ago

well, i just tested thet NFC Card by adding to wallet, it sends a fixed uuid, and i can open the door now with my android

Hi, Which android phone model? Brand? App?

I can not do it with a Pixel 8 and Google Wallet.

pergolafabio commented 8 months ago

yeah, it doesnt work anymore, seems it was not fixed after all :-( In theory it should be possible to create a static card in google wallet, but havent find a way :-(

felipecrs commented 5 months ago

@pergolafabio is this issue about exposing sensors for when someone approaches an NFC card to the doorbell to trigger some automation on Home Assistant? Because this is exactly what I am looking for. :D

pergolafabio commented 5 months ago

No, this was more an idea to make persons/badges on the outdoor station, so no ivms is needed....

To see who badged or entered the key, that's already availble in the addon, on the door relay switch, you see an attribute called "source_control"

felipecrs commented 5 months ago

Very cool. Thank you!

fatmacheto commented 2 months ago

On some new devices like the 502 or the 1109 reader it is possible to use Bluetooth and NFC as a mobile credential but they need to be added to the their cloud platform in Hik-Connect teams mode and from there a mobile credential can be generated to the Hik-Connect mobile app.