Verisure lock status

Hi all,

How do you solve the automations as the verisure needs the lock code (6-digits) to lock/unlock the door? As I understand I need to save the lock code somwhere…

I used the following format to lock my unlocked doors as I leave the house (automations.yaml):

- id: 'a71'
 alias: 71 - Leaving Home Evening
  trigger: 
    platform: state
    entity_id:
      - group.all_devices
    from: 'home'
    to: 'not_home'
  condition:
    condition: and
    conditions:
      - condition: sun
        after: sunset
      - condition: sun
        before: sunrise
  action:
    - service: scene.turn_on
      entity_id: scene.night
    - service: lock.lock
      data:
        code: !secret house_door_lock_code
        entity_id: group.all_locks

And the in the file secrets.yaml I put my code especially for the user “house”:

house_door_lock_code: 123456

Works like a charm.

Edit: Sorry about the editing of the post, haven’t figured out the formatting yet

Not sure if this is the right place or if I should start a new thread, so tell me to move on if that’s better :-o

I am trying to figure out if there is any way to distinguish between if the lock has been open through a code from the outside, or via the lever on the inside. The reason is that I want to use it as an input to my Bayesian sensor to determine if someone is home or not. I have seen the “changed by” info displayed on my look, so by using open with code or no code I can identify when someone is comming or going.

Any help greatly appreciated.

//Runar

As I can see, No. In the verisure app you see (in swedish) “Låst med stjärnknapp” or “Låst med vred”.
These two attribitus would be nice to use. Problem is, these are not picked up by HA.
This might have something to do with updating the component och some update to the API.
If this attribute is in HA, you’ll have a solution.

/Patrik

screen_lock
If I unlock and leave my door open - this is what I get from HA. As you can see - the state change is picked up. If I enter dev-state, the atribute changed by is visible all of a sudden. Maybe we have something to play with! :smiley: What do you think? :smiley:
{
“changed_by”: “Städfirman”,
“code_format”: “#############”,
“friendly_name”: "Entré "
}

Funny though… i can’t see the “changed by” in my HA.
If it’s there you can use it.

Me neither - unless I leave the door open for a while. I get it when I partially close the door. (I run auto-lock and do not want to mess with that) For the short instanses when just opening and closing, I can not see anything. I tried an animation yesterday, but it did not work, so I might have to go with the solution by @teachingbirds here: https://community.home-assistant.io/t/changed-by-on-verisure-lock-with-auto-lock/59272

1 Like

Hi. I recon this is an old thread, but I’m considering buying a Yale Doorman V2 Verisure lock module and a mBox mini. My intend is to be able to trigger stuff in HA based on locking and unlocking status from the door. And remotely lock/unlock.

Is it possible to integrate Doorman V2 into HA, lock/unlock and se status?

Thanks.

Kind regards,
Esben

Also interested in the lock status reliability. Want to get an instant (within 10 sec) state change when unlocking the door to automatically disarm alarm functionality using node red and Home Assistant. Is this possible? Ping @persandstrom

Many thanks!

No, the verisure status has to be polled and the default polling interval is 60 seconds. This interval seems to be acceptable by verisure. I know that a few has found workarounds, configure verisure to send an email on state change and capture that. Don’t know the probability that that is received within 10seconds though.

Thanks for the answer!
Does anyone know how the workaround is configured?

Somewhat related to the topic.
I have been searching but not found it, so I ask here.

Have anyone been able to read the event history from the lock (Yale Doorman)? In the Verisure app I see who unlocked the door and when they did it. Can I get that info to Home Assistant?

Coming from domoticz to hass.
In domoticz i modified your script and added session. That way I allways had a logged in session to verisure and pulled data of the alarm every 1 second. If the session died it logged in again. That way vsure won’t be sad and see so many logins.

Do you think you can do the the same for the homeassistant plugin? Would be great for turning off/on lights based on alarm state.

def current_date_time(self):
now = datetime.datetime.now()
return now.strftime("%Y-%m-%d %H:%M:%S")

def create_session_and_login(self):
    self.log("create_session_and_login()")
    try:
        session = verisure.Session("XXX", "XXXX")
        session.login()
        return session
    except:
        catch_sleep_retry(True)

def catch_sleep_retry(shouldSleep = False):
global isSleeping
traceback.print_exc()

if shouldSleep == True and isSleeping == False:
    isSleeping = True
    time.sleep(60)

if isSleeping == True:
    isSleeping = False
    setInterval(1)

def set_alarm_state(self, state):
try:
self.log(“set_alarm_state(State: %s)” % state)
pincode = “XXXXXXX”
url = "%s/json.htm?type=command&param=setsecstatus&secstatus=%s&sec$
json.load(self.execute(url))
self.previous_states[“alarm”] = state
# self.thread_timer_alive = False
except:
catch_sleep_retry()`

Hi Jacha,

Sessions are already managed by the plug-in. Right now it polls every minute, and that seems to be acceptable by verisure. If you want to let it poll faster you will have to change the interval in the component. I don’t recommend this though, since verisure has warned people that do request too often.

/Per

Ok where/what file to edit?

https://github.com/home-assistant/home-assistant/blob/2e079029999ac8fb1b25376aafdf4838e4929c71/homeassistant/components/verisure/init.py

You must set MIN_SCAN_INTERVAL, SCAN_INTERVAL can be set in config

Can you point me to where the file in HA is located? Did not find it in the addons folder on my HA.

It is: homeassistant/components/verisure/__init__.py

Hm can’t find that folder.
system@homebot:/usr/share/hassio/homeassistant$ ls -a
. 10979017446996692576.jpg customize.yaml pyozw.sqlite zwcfg_0xfa50b246.xml
… 1178517272862803949.jpg deps scenes.yaml zwscene.xml
.HA_VERSION OZW_Log.txt groups.yaml scripts.yaml
.cloud automations.yaml home-assistant.log secrets.yaml
.homekit.state configuration.yaml home-assistant_v2.db tts
.storage configuration.yaml.save options.xml zwcfg_0xd7dcbd19.xml
system@homebot:/usr/share/hassio/homeassistant$

Hej
Jag har inte verisure larm men Yaledoorman lås med moduler till verisure hubben, måste den vara kvar för att få låsen till HA ?

MrDTS