tomasbedrich / home-assistant-hikconnect

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

Locking / Unlocking not implemented #13

Closed cieszek5 closed 3 years ago

cieszek5 commented 3 years ago

When I tired to unlock my doorphone HA give me this error.

Logger: custom_components.hikconnect.lock Source: custom_components/hikconnect/lock.py:51 Integration: Hik-Connect (documentation, issues) First occurred: 21:17:28 (3 occurrences) Last logged: 21:17:40

Locking not implemented

Logger: custom_components.hikconnect.lock Source: custom_components/hikconnect/lock.py:54 Integration: Hik-Connect (documentation, issues) First occurred: 21:17:25 (3 occurrences) Last logged: 21:17:39

Unlocking not implemented

tomasbedrich commented 3 years ago

Hi, you need to create script using lock.open. Please see the example here: https://community.home-assistant.io/t/hik-connect/342202?u=tomasbedrich

cieszek5 commented 3 years ago

I have tired but yours script with changed device id causes errors in my HA, so i created script in graphical interface that looks like tihis:

open_main_entry: sequence:

But this have no effect at all

tomasbedrich commented 3 years ago

You are right, I forgot to update the example after ad958003c3c49cc94254f28a75af8414a78625c3. Sorry.

Please omit device_id and use only entity_id. The updated example is here:

alias: Open main entry
mode: single
sequence:
- service: lock.open
  target:
    entity_id: lock.xxxxxxxxxxxxxx
cieszek5 commented 3 years ago

I changed but after i restart HA i get this error

Logger: homeassistant.config Source: config.py:464 First occurred: 15:47:12 (3 occurrences) Last logged: 15:47:12

Invalid config for [script]: expected a dictionary. Got OrderedDict([('default_config', {}), ('group', {}), ('automation', {}), ('script', OrderedDict([('alias', 'Open main entry'), ('mode', 'single'), ('sequence', [OrderedDict([('service', 'lock.open'), ('target', OrderedDict([('entity_id', 'lock.doorphone_lock')]))])])])), ('scene', {}), ('sensor', [OrderedDict([('platform', 'authenticated')])]), ('logger', OrderedDict([('logs', OrderedDict([('hikconnect', 'debug'), ('custom_components.hikconnect', 'debug')]))]))]). (See /config/configuration.yaml, line 8).

At line 8 of my config is include automations.yaml and this file is empty.

tomasbedrich commented 3 years ago

I think there is simply some syntax error in your configuration.yaml or scripts.yaml.

I have a change prepared to switch from lock.open to more friendly lock.unlock, which no longer requires custom scripts.

You can either try to debug the configuration (you can paste it here, but please use Markdown code block), or you can wait until I publish next version with simpler interface.

cieszek5 commented 3 years ago

When i could expect the update ?

tomasbedrich commented 2 years ago

It is out in version 1.1.0. Please try and let me know. If it works, you can delete the scripts entirely.

pepsonEL commented 2 years ago

I tested and for me works perfect. Now i wait for call ring status :) and it will the best :)

cieszek5 commented 2 years ago

Its working fine for me too, thanks for solving this ! I can finally agree to close the issue.