kvj / hass_nuki_ng

Better support for Nuki devices in the Home Assistant
MIT License
169 stars 32 forks source link

[Opener] Improvements for continuous mode #120

Closed alucar-d closed 7 months ago

alucar-d commented 1 year ago
kvj commented 1 year ago

Hey @alucar-d looks like a nice improvement, but I can't find any API documentation for activate_continuous_mode / deactivate_continuous_mode actions. Could you please add a reference to it?

alucar-d commented 1 year ago

Hi @kvj, the documentation for these actions at Nuki API level is in the "lock actions" section. The last two rows on the "opener" column. These actions are actually mapped in the code for both "bridge_lock_actions" and "web_lock_actions". I just made use of it :) Thanks for your time!

sebastianandress commented 1 year ago

For those who don't want to wait for this merge, you can also get the current mode of your Nuki Opener using the rest platform:

sensor:
  - platform: rest
    unique_id: sensor.nuki_mode
    resource: http://[BRIDGE_IP_ADDRESS]:8080/list
    params:
      token: !secret nuki_token
    scan_interval: 20
    name: Nuki Mode
    value_template: "{{ value_json[0].lastKnownState.mode }}"

If the sensor returns a value of 2, continuous mode is inactive, if it is 3 continuous mode is active. However I'm looking forward to see this built in once this branch is merged!

GNeras commented 1 year ago

I think this is a good idea. The only issue I have with this is that when continuous mode is enabled, if I try to lock the Opener, it does nothing because the lock action doesn't change the continuous mode. Maybe locking should also disable continuous mode.

alucar-d commented 1 year ago

I think this is a good idea. The only issue I have with this is that when continuous mode is enabled, if I try to lock the Opener, it does nothing because the lock action doesn't change the continuous mode. Maybe locking should also disable continuous mode.

It's a good point! I think that the behavior should be as you said, so I'll try to adjust it. Thanks for your comment

alucar-d commented 1 year ago

Updated the behavior. Now when locking an opener it checks if continuos mode is enabled and made an extra call to disable continuos mode before call the lock itself.

GNeras commented 1 year ago

I tested it and I think it's perfect now :+1:

alucar-d commented 7 months ago

resolve #161

tristanXme commented 7 months ago

Tested it and its also working for me. Please merge it.