pergolafabio / Hikvision-Addons

Home Assistant: Hikvision Doorbell
184 stars 40 forks source link

New beta crashing after start up #144

Closed VCTGomes closed 1 year ago

VCTGomes commented 1 year ago

What happened?

I just installed the new 3.0.0-beta.40 and it's crashing everytime when I start.

Add-on

Hikvision Doorbell

What version of the add-on are you running?

3.0.0-beta.40

Installation type

Home Assistant add-on

Relevant log output

<serverIP opt="ipv4"/>
<serverPort min="0" max="65535"/>
<negativeFloor min="0" max="10"/>
<elevatorControlType opt="DS-K2201,DS-K2210"/>
<userName min="1" max="63"/>
<password min="1" max="63"/>
<isSupportRS485 opt="DS-K2201,DS-K2210"/>
<isSupportNetWork opt="DS-K2210"/>
<isSupportNegativeFloor opt="DS-K2210"/>
</ElevatorControl>
<supportVisRegisterInfo opt="true"/>
<VideoCall>
<enabled opt="true"/>
<supportCmd opt="Request,Cancel,Answer,Decline,Timeout,Bye,DeviceIsBusy,ClientIsBusy"/>
</VideoCall>
<supportVideoFormat opt="P,N"/>
<CallRoomConfig>
<keyNo min="1" max="1"/>
<roomNo min="1" max="9999"/>
<callManageCenter opt="true,false"/>
</CallRoomConfig>
</VideoIntercom>
<UploadAlarmCfg>
<UploadDoorNotCloseAlarm opt="true,false"/>
</UploadAlarmCfg>
<NoNeedReboot>
<videoResolutionChange opt="true"/>
<videoFrameRateChange opt="true"/>
</NoNeedReboot>
</IpViewDevAbility>

2023-09-12 13:34:42.597 | DEBUG    | sdk.utils:call_ISAPI:125 - Request body: 
[2023-09-12 13:34:42.600][INF] Private connect 192.168.2.99:8000 sock=136 this=0x9f034074 cmd=0x117000 port=37712
2023-09-12 13:34:42.622 | DEBUG    | sdk.utils:call_ISAPI:162 - Response status: <ResponseStatus version="1.0" xmlns="http://www.std-cgi.com/ver10/XMLSchema">
<requestURL>/ISAPI/System/IO/outputs</requestURL>
<statusCode>4</statusCode>
<statusString>Invalid Operation</statusString>
<subStatusCode>notSupport</subStatusCode>
</ResponseStatus>

2023-09-12 13:34:42.622 | DEBUG    | sdk.utils:call_ISAPI:125 - Request body: 
[2023-09-12 13:34:42.622][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/System/IO/outputs], input size[0], max segment length[262144]
[2023-09-12 13:34:42.626][INF] Private connect 192.168.2.99:8000 sock=136 this=0x9f034074 cmd=0x117000 port=37720
2023-09-12 13:34:42.660 | DEBUG    | sdk.utils:call_ISAPI:165 - Response output: <RemoteControlDoor  version="2.0" xmlns="http://www.isapi.org/ver20/XMLSchema">
<doorNo min="1" max="1"/>
<cmd opt="open,alwaysOpen,resume"/>
</RemoteControlDoor >

2023-09-12 13:34:42.661 | DEBUG    | mqtt:__init__:144 - Configuring 1 door switches
2023-09-12 13:34:42.663 | DEBUG    | mqtt:__init__:107 - Setting up entities for HikvisionPanel
2023-09-12 13:34:42.664 | DEBUG    | sdk.utils:call_ISAPI:125 - Request body: 
[2023-09-12 13:34:42.660][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/AccessControl/RemoteControl/door/capabilities], input size[0], max segment length[262144]
2023-09-12 13:34:42.671 | DEBUG    | sdk.utils:call_ISAPI:165 - Response output: <DeviceInfo version="2.0" xmlns="http://www.isapi.org/ver20/XMLSchema">
<deviceName>Embedded Net VIS</deviceName>
<deviceID>XXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX</deviceID>
<model>DS-KH6320-WTE1</model>
<serialNumber>DS-KH6320-WTE10XXXXXX</serialNumber>
<macAddress>bc:9b:5e:XX:XX:XX</macAddress>
<firmwareVersion>V2.2.20</firmwareVersion>
<firmwareReleasedDate>build 230601</firmwareReleasedDate>
<encoderVersion>V1.0</encoderVersion>
<encoderReleasedDate>build 000000</encoderReleasedDate>
<deviceType>DVR</deviceType>
<RS485Num>1</RS485Num>
<telecontrolID>255</telecontrolID>
<alarmOutNum>2</alarmOutNum>
<alarmInNum>8</alarmInNum>
<customizedInfo></customizedInfo>
<OEMCode>1</OEMCode>
</DeviceInfo>

2023-09-12 13:34:42.671 | DEBUG    | doorbell:user_config:199 - No manual config found to define output relays for indoor
2023-09-12 13:34:42.672 | DEBUG    | sdk.utils:call_ISAPI:125 - Request body: 
[2023-09-12 13:34:42.667][INF] Private connect 192.168.2.43:8000 sock=139 this=0x9f034074 cmd=0x117000 port=54078
[2023-09-12 13:34:42.671][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/System/deviceInfo], input size[0], max segment length[262144]
[2023-09-12 13:34:42.676][INF] Private connect 192.168.2.43:8000 sock=139 this=0x9f034074 cmd=0x117000 port=54092
2023-09-12 13:34:42.680 | DEBUG    | sdk.utils:call_ISAPI:165 - Response output: <RemoteControlDoor version="2.0" xmlns="http://www.isapi.org/ver20/XMLSchema">
<doorNo min="0" max="99"></doorNo>
<cmd opt="open"></cmd>
<channelNo min="1" max="50"></channelNo>
<controlType opt="monitor,calling"></controlType>
</RemoteControlDoor>

Traceback (most recent call last):
  File "/app/main.py", line 96, in <module>
    asyncio.run(main())
  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/app/main.py", line 57, in main
    mqtt = MQTTHandler(config.mqtt, doorbell_registry)
  File "/app/mqtt.py", line 143, in __init__
    num_doors = doorbell.get_num_outputs_indoor()
  File "/app/doorbell.py", line 223, in get_num_outputs_indoor
    return endpoint()
  File "/app/doorbell.py", line 216, in isapi_door_capabilities
    return int(door_number_element.text)
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
[2023-09-12 13:34:42.680][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/AccessControl/RemoteControl/door/capabilities], input size[0], max segment length[262144]

Relevant configuration

- name: HikvisionDoorbell
  ip: XXXX
  username: admin
  password: XXXXX
- name: HikvisionPanel
  ip: XXXXX
  username: admin
  password: XXXXXX
  scenes: true

host: xxxxxx
port: 1883
ssl: false
username: xxxx
password: xxxxx

Anything else?

No response

pergolafabio commented 1 year ago

can you try beta 43 ?