Indeed, there is no ringing event on the indoor station therefore you need to connect to outdoor…
I have included an extra button, when you enable “caller_info: true” , then you make an automation that triggers that button every x seconds, so you can see the “idle” or “ringing” as an attribute of that button
But its not an ideal solution, but it should work…
Is possible to have a API “ping” to check the online status of the devices? I have a KV6113 that sometimes its freeze (I can ping it, but to the indoor station/app/API he does not respond). If this feature is possible, I can make a script to restart the POE port on the switch. Now I have factory reset it to see if it stop freezing.
Yes, I know the ping integration. But the device freeze (WEB/API) but still ping, if it does not ping, I can resolve with POE Auto Recovery in switch. I am using the last firmware. I don´t see anything in the add-on log. I made a script to get the http://10.10.10.23/ISAPI/System/deviceInfo and if it´s fail I have another script to power cycle the port on switch. If it´s possible to implement this on the addon will be nice!
It’s possible, but the addon is based on events, not on polling , I want to stay away from polling as much as possible…
But if your device freezes , probably it’s not possible to initiate a restart from the sdk anyway… you can try next time? There is a reboot button, does it work when it’s freezed?
Your approach for the addon is best way, maybe is better I implement this check from another script. When the device freezes it´s only respond for network ping, I can´t reboot from the SDK… What I do now is power off the POE and power ON again.
I have just tried upgrading to version 43, however it was failing with the error below.
You may need to update your documentation to make it clearer that this value Output_Relay needs to be set going forward. Once I set this to 2 it worked.
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 229, in get_num_outputs_indoor
raise RuntimeError("Unable to get the number of doors, please configure the relays manually with this option in the config: output_relays")
RuntimeError: Unable to get the number of doors, please configure the relays manually with this option in the config: output_relays
Edit.
After a couple of minutes it then failed with
2023-10-01 03:28:11.688 | DEBUG | __main__:signal_handler:90 - Received SIGINT, terminating task
2023-10-01 03:28:11.688 | INFO | __main__:main:85 - Shutting down
2023-10-01 03:28:11.688 | DEBUG | sdk.utils:shutdownSDK:105 - Shutting down SDK
On pergolafabio/hikvision-doorbell:latest without Output_Relay got the first error.
2023-10-01 06:06:54.276 | DEBUG | mqtt:__init__:144 - Configuring 1 door switches
2023-10-01 06:06:54.278 | DEBUG | mqtt:__init__:107 - Setting up entities for base_station
2023-10-01 06:06:54.278 | DEBUG | sdk.utils:call_ISAPI:125 - Request body:
[2023-10-01 06:06:54.275][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/System/IO/outputs], input size[0], max segment length[262144]
[2023-10-01 06:06:54.280][INF] Private connect 192.168.0.129:8000 sock=145 this=0x76ff1224 cmd=0x117000 port=41026
[2023-10-01 06:06:54.285][DBG] SimpleSTDCommandToDvr with out cmd[GET /ISAPI/System/deviceInfo], input size[0], max segment length[262144]
2023-10-01 06:06:54.285 | 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>xxx</deviceID>
<model>DS-KH8350-TE1</model>
<serialNumber>DS-KH8350-TE1xxxx</serialNumber>
<macAddress>xxxx</macAddress>
<firmwareVersion>V2.0.21</firmwareVersion>
<firmwareReleasedDate>build 190314</firmwareReleasedDate>
<encoderVersion>V1.0</encoderVersion>
<encoderReleasedDate>build 000000</encoderReleasedDate>
<deviceType>EmbeddedNetVIS</deviceType>
<telecontrolID>255</telecontrolID>
</DeviceInfo>
2023-10-01 06:06:54.286 | DEBUG | doorbell:user_config:200 - No manual config found to define output relays for indoor
2023-10-01 06:06:54.286 | DEBUG | sdk.utils:call_ISAPI:125 - Request body:
2023-10-01 06:06:54.291 | DEBUG | sdk.utils:call_ISAPI:162 - Response status:
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 230, in get_num_outputs_indoor
raise RuntimeError("Unable to get the number of doors, please configure the relays manually with this option in the config: output_relays")
RuntimeError: Unable to get the number of doors, please configure the relays manually with this option in the config: output_relays
2023-10-02 21:36:12.868 | DEBUG | config:load_mqtt_config:130 - Loading MQTT configuration from supervisor
2023-10-02 21:36:12.868 | DEBUG | config:mqtt_config_from_supervisor:36 - Requesting MQTT service configuration to supervisor
2023-10-02 21:36:12.883 | INFO | sdk.utils:loadSDK:44 - Using OS: Linux with architecture: x86_64
loop[2] find 2 mac and 0 ip
2023-10-02 21:36:13.061 | INFO | doorbell:authenticate:76 - Connected to doorbell: DS-KD8003-IME1(B)
2023-10-02 21:36:13.080 | INFO | doorbell:authenticate:76 - Connected to doorbell: DS-KH6320-WTE
2023-10-02 21:36:13.081 | INFO | event:init:87 - Setting up event handler: Console stdout
2023-10-02 21:36:13.081 | INFO | mqtt:init:95 - Setting up event handler: MQTT
Traceback (most recent call last):
File “/app/main.py”, line 96, in
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 225, in get_num_outputs_indoor
return endpoint()
File “/app/doorbell.py”, line 215, 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’
Yeah, but now you try to start the addon when it was already freezed? Do you also see an event when the addon was already started and it is freeing when addon is still running? Make sure to disable the watchdog on the addon, so it doesn’t restart
Yeah, but now you try to start the addon when it was already freezed?
It´s starts but no comunicate with KV6113, so I use the code below (it´s just a test code) to check the API and if not answer I restart the POE port on switch. I think it´s a problem with the KV6113…
import requests
from requests.auth import HTTPDigestAuth
import time
s = requests.Session()
r = requests.Response
erro = False
try:
r = s.get('http://10.10.10.23/ISAPI/System/deviceInfo', auth = HTTPDigestAuth('admin', 'xxxxxxx'), timeout=5)
r.raise_for_status()
except requests.exceptions.HTTPError as errh:
print ("Http Error:",errh)
erro = True
except requests.exceptions.ConnectionError as errc:
print ("Error Connecting:",errc)
erro = True
except requests.exceptions.Timeout as errt:
print ("Timeout Error:",errt)
erro = True
except requests.exceptions.RequestException as err:
print ("OOps: Something Else",err)
erro = True
print(erro)
if erro == True:
r = s.post('http://10.10.10.3/logon.cgi', data={'username': 'admin', 'password': 'xxxxxxx', 'logon': 'Login'}, timeout=5)
r = s.post('http://10.10.10.3/poe_port_config.cgi', data={'aaplay': 'Apply', 'name_pstate': '1', 'sel_16': '1'}, timeout=5)
time.sleep(1)
r = s.post('http://10.10.10.3/poe_port_config.cgi', data={'aaplay': 'Apply', 'name_pstate': '2', 'sel_16': '1'}, timeout=5)
Do you also see an event when the addon was already started and it is freeing when addon is still running? Make sure to disable the watchdog on the addon, so it doesn’t restart