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:
Currently, when I want to unlock the door from HA, I have to open this screen and input the PIN
Where can I input the code, so that this is not necessary?
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
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:
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.
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.
I don’t believe it’s possible to save the code.
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?
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!
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.
Can you tell me how you have configured it on your android device?
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:
Install Tasker
Install Notification Listener
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.
In Tasker, create a new profile and go to event->plugins->notification listener->notification listener
Push Configuration button
Push the app search button (the one with 3x3 squares) and find and pick Verisure
Go back twice and pick “new task”
Create a HTTP Post task
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).
Under “Data / File” add any necessary JSON command e.g. {“entity_id”:“my_alarm_1”,“some_state”:“some_state_attribute”}
Under “Content Type” add “application/json”, leve everything else and go back
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.