Save PIN and reduce delay for Yale Doorman (Verisure)

Dear friends!

I am SO impressed with Home Assistant! Just installed it yesterday on my Asustor AS-302T, and now my home is automated to a degree that I never thought imaginable. I can now wake up by the light turning on and the music starting to play! And that’s just the beginning.

I have no experience with coding or Linux, so I need a bit of help with the Doorman for questions that I did not find answers to online. I have two things I need to fix: 1) I need to save the PIN so that I don’t have to write it every time I want to unlock the door from HA. 2) I need to reduce the time of detection of the door state shifting from ‘Locked’ to ‘Unlocked’.

Elaboration:

  1. Currently, when I want to unlock the door from HA, I have to open this screen and input the PIN

Screenshot-2018-10-20%20Home%20Assistant

Where can I input the code, so that this is not necessary?

  1. I use the following code to turn on the light in the hallway, when I unlock the door:
    - id: lys_naar_doer_laaser_op_med_kode
      alias: "Lys når dør låser op med kode"
      initial_state: True
      trigger:
         - platform: state
           entity_id: lock.hoveddr
           from: 'locked'
           to: 'unlocked'
      action:
         - service: light.turn_on
           entity_id: light.entre

Now, when I unlock from the app the light turns on immediately (actually a second before the door unlocks), but when I unlock the door from the door panel, there is a delay of up to approximately one minute before the light turns on, which is too much for the function to be meaningful.

How do I reduce this delay?

And then a less important bonus-question: Is there a way to make a condition that would make the light turn on only when the unlocking is done from the outside code panel (or from HA), but not when it is done from the inside?

Thank you so much for this great system!
Hans Frederik

1 Like

Hello again

I grew a bit impatient and tried to manipulate the file /homeassistant/components/lock/verisure.py in the vi editor myself.
I tried the following:

  1. I changed if time() - self._change_timestamp < 10: to if time() - self._change_timestamp < 1: and then to if time() - self._change_timestamp < 100: which seemingly had no effect at all.
  2. I changed return '^\\d{%s}$' % self._digits to return '^\\d{%s}$' % 000000 (where 000000 represents my pin), which also did nothing

On the bonus question, I noticed that when I unlock the door from HA, it says: “changed by (NAME OF USER)”, which it does not when it is unlocked from the inside. From this a condition can be made, that would be something like, “if username not empty”. I could use some help with that, since I never made a condition before.

I don’t know the verisure integration. These are my general comments.

  1. I don’t believe it’s possible to save the code.
  2. It’s not clear to me what devices are “app” and “panel”. Are any of those home assistant? This looks like a polling integration. You can try changing the scan interval in the config to see if that changes the response times.

Sorry for being so vague in my formulation! With “app” i meant the HA with “door panel” I meant the actual physical keyboard on the Yale Doorman .

I changed if time() - self._change_timestamp < 10: to if time() - self._change_timestamp < 1: and then to if time() - self._change_timestamp < 100: which seemingly had no effect at all. Is this the “scan interval” or where do I find this?

Thanks

Here seem to be one example of autiomation with code set

Wow, thanks, that’s exactly what I need. I will try it out as soon as I get home Saturday.

Now I just need to figure out how to change the “scan interval”.

Me and others have changed the timer for automations like this but Verisure gets unhappy when you do to many api calls in a period of time. For an automation like this you would like to scan every 5s but Verisure might block you.

There are a couple of workarounds discussed on python-Verisure Github.
I would say using Verisure app and tasked to catch the push and trigger a script in HA is the best option atm.

Thank you for the suggestion. Before discovering HA I had my home automation running on an Android phone primarily using Tasker and read the Verisure push message for this automation (it never got close to working as great as HA does! which is why I kept looking for a better option). I will set that specific task again and try to implement it with HA. I think I can figure this out. I will let you know how it goes.

I now implemented this with Tasker and the Notification Listener plug-in, which works very well, as long as you turn of battery saving for the Verisure app. Thanks!

Hi Hans,

I would also like to get an instant notification in HA when my lock is being unlock, so I can integrate it with my alarm. I would try your suggestion with tasker. I have a android tablet running as an information panel for HA. So I guess that I can implement it on that.
The way that I have configured it now, it that I will catch the unlock email in HA. Then I know it is unlocked. And I can also see who have unlocked the door. But some time it dosen’t arrive right away. So I could like to try your approached.
image

Can you tell me how you have configured it on your android device?

Thanks

/Claus

Hej Claus

Jeg holder mig til engelsk for det brede publikums skyld, men hyggeligt at møde en dansker her.

The setup is quite simple, do the following on your android device:

  1. Install Tasker
  2. Install Notification Listener
  3. Install Verisure app and in the settings of that app enable push-messages and in the profile settings set up what profiles will trigger a push-message.
  4. In Tasker, create a new profile and go to event->plugins->notification listener->notification listener
  5. Push Configuration button
  6. Push the app search button (the one with 3x3 squares) and find and pick Verisure
  7. Go back twice and pick “new task”
  8. Create a HTTP Post task
  9. post command for unlocking your lock (something like http://[my_hass_server]:8123/api/services/alarm/deactivate?api_password=[my_http_password] (I have no alarm, so I don’t know the service call, you will know where to find this, I suppose).
  10. Under “Data / File” add any necessary JSON command e.g. {“entity_id”:“my_alarm_1”,“some_state”:“some_state_attribute”}
  11. Under “Content Type” add “application/json”, leve everything else and go back
  12. Add a “cancel notification” task after the post task in order for the notification to be cleared, so a new notification (the door being unlocked) will again trigger the task.

This presupposes that you have set your http password and that your server is not SSL, otherwise more steps might be necessary.

Let me know if it works.

1 Like

Hi Hans,

Thanks for the guide. Where do you find the “cancel notification” task?

You can always use the filter to search for tasks. In this case, you find it under “plugin” -> “notification listener” -> “cancel notification”

Thanks

Working now. Should just tweek it a little :slight_smile:

Good to hear!

Hi,

Does this still work with you? Mine have stopped working. nd I cant figure out why it stopped working. It just says this in the log:

Login attempt or request with invalid authentication from IP ADRESS

Any clues?

Running 84.2. And another strange thing is that if I login with the legacy password, then i’m not able to see any devices.

Thanks

/Claus

It worked after I updated the VBox firmware to 27400, did you update?

It is the task In tasker that doesn’t work anymore.

The one that connect to HA

I have no idea what would cause that, since I am no expert. Did you change the http password of your HA configuration?