tomasbedrich / home-assistant-hikconnect

A Home Assistant integration to communicate with Hikvision smart doorbells via Hik-Connect cloud.
40 stars 9 forks source link

sensor becomes unavailable #40

Open stevetheman1031 opened 10 months ago

stevetheman1031 commented 10 months ago

Hey, I'm running into an issue where the ringing sensor becomes unavailable after a while and the only way I can get it to come back is to reload the integration. DS-KB6003-WIP V1.4.62 build 180515. I'll turn on logging and will respond with the logs once I get it to go it again.

tomasbedrich commented 8 months ago

The errors from call status sensor are suppressed, because of reasons on Hik-Connect cloud side. It generated a lot of noise into logs. You can temporarily turn on the logging by changing the value on line home-assistant-hikconnect/custom_components/hikconnect/sensor.py:18. If the sensor becomes unavailable for longer timespans, it would be good to turn the logging on and report here what's happening.

dafi87 commented 7 months ago

My call status sensor changes from idle to unavailable and back to idle every 5 to 10 minutes and so produces a lot of logbook entries. Is that expected behaviour? Can we do something about it? I don't want to deactivate the sensor.

Unbenannt

tomasbedrich commented 7 months ago

As mentioned, this happens when the integration is unable to reach Hikconnect server. As you can imagine, there can be many reasons: bad internet connection, outage on Hikconnect side, etc.

danneliezer commented 6 months ago

My call status sensor changes from idle to unavailable and back to idle every 5 to 10 minutes and so produces a lot of logbook entries. Is that expected behaviour? Can we do something about it? I don't want to deactivate the sensor.

Unbenannt

I started using this integration recently and I'm already experiencing the same thing here with a Hikvision DS-KB8112-IM video intercom. I can't imagine what it could be, because while the HA integration is unavailable, I continue to access and receive calls on the Hik-Connect app, which indicates that the device's connection with the Hikivision servers is ok. Internet ok obviously.

I'm using the call status: "ringing" to trigger an automation that notifies my Amazon Echo devices spread across the three floors of the building that someone is ringing the doorbell. Hope for a solution

hikivision

danneliezer commented 3 months ago

My call status sensor changes from idle to unavailable and back to idle every 5 to 10 minutes and so produces a lot of logbook entries. Is that expected behaviour? Can we do something about it? I don't want to deactivate the sensor. Unbenannt

I started using this integration recently and I'm already experiencing the same thing here with a Hikvision DS-KB8112-IM video intercom. I can't imagine what it could be, because while the HA integration is unavailable, I continue to access and receive calls on the Hik-Connect app, which indicates that the device's connection with the Hikivision servers is ok. Internet ok obviously.

I'm using the call status: "ringing" to trigger an automation that notifies my Amazon Echo devices spread across the three floors of the building that someone is ringing the doorbell. Hope for a solution

hikivision

Dear all, to deal with the intermittency of the integration I did a simple automation by calling the service 'Home Assistant Core Integration: Reload configuration entry' to restart the integration. Since the integration reloads very quickly (~10s) and the procedure runs 10 seconds after the "call status" becomes unavailable, this is how I have been dealing with the problem while this intermittent situation persists.

To do this, you need to access the core.config_entries file located in the \config.storage folder of the Home Assistant installation and obtain the integration entry_id. I used the "Samba share" add-on to do this from Windows, remember to enable hidden folder viewing: entry_id

In addition, I found it useful to set up a notification on my cell phone every time this procedure needs to be performed.

You can easily set up this automation from the graphical interface in the Home Assistant automation section, but if you're already reading this and prefer to do it yourself, follow my code in automations.yaml

- id: '1704237441848'
  alias: Reload Hik-Connect when sensor is unavailable
  description: Gate 003 call_status is unavailable. Need to reload the integration.
  trigger:
  - platform: state
    entity_id:
    - sensor.ccc_tauape_portao_003_call_status
    for:
      hours: 0
      minutes: 0
      seconds: 10
    to: unavailable
  condition: []
  action:
  - service: notify.mobile_app_poco_x3_nfc
    data:
      message: 'The call.status sensor of the video intercom of gate 003 became unavailable and the integration was restarted!'
  - service: homeassistant.reload_config_entry
    data:
      entry_id: 14987a2d27737d57f0149e5b1aec1c3c
  mode: single

Hope this helps.