Skip to content

Read autolock status #134

Open
Open

Description

@jacobhallgren

Would be nice like in the verisure app to see the state of the lock. If autolock is enabled or not.

Activity

  1. persandstrom commented on May 21, 2022

    @persandstrom
    Owner

    Hi,

    You can see that using the overview command.

  2. jacobhallgren commented on May 21, 2022

    @jacobhallgren
    Author

    Hi,

    You can see that using the overview command.

    Which field?

    The "method" that says auto is just if it was locked by the autolock. Not if autolock is enabled.

  3. persandstrom commented on May 21, 2022

    @persandstrom
    Owner

    You are correct! I recently got a lock myself and i'm not very familiar with it yet.

    I added a new command to the the m-api branch, '--door-lock-configuration'. This branch only has support for the devices I own so far...

    Sadly I can't add new commands to the master branch due to that the app has changed to a new API

  4. jacobhallgren commented on May 21, 2022

    @jacobhallgren
    Author

    You are correct! I recently got a lock myself and i'm not very familiar with it yet.

    I added a new command to the the m-api branch, '--door-lock-configuration'. This branch only has support for the devices I own so far...

    Sadly I can't add new commands to the master branch due to that the app has changed to a new API

    Thank you will try that out. Another question do you know a good way to read events like firealarm and get that info in to home assistant? Is there someway to run this script from home assistant and get info like water leak, fire etc.?

  5. persandstrom commented on May 21, 2022

    @persandstrom
    Owner

    Possibly you could get the information from the event log, but I would not call that a good way, and it is not supported by home-assistant so you would need to use a shell command or similar.

    I added a command for setting auto-lock enabled/disabled and event-log to the m-api branch as well.

  6. krambriw commented on May 22, 2022

    @krambriw

    Possibly you could get the information from the event log, but I would not call that a good way, and it is not supported by home-assistant so you would need to use a shell command or similar.

    In my experience a good way to provide Verisure status information of all kind is to run a Python script with the python-verisure module and publish/subscribe to a MQTT broker. This would give you a generic solution that most "modern" sw including HA and Node-RED supports. I do that since years, including support for commands to SmartPlugs, rock solid. Only disadvantage is that we still have to poll for information, the push support used in apps seems to be "hidden away" somehow?

  7. jacobhallgren commented on May 22, 2022

    @jacobhallgren
    Author

    Possibly you could get the information from the event log, but I would not call that a good way, and it is not supported by home-assistant so you would need to use a shell command or similar.

    In my experience a good way to provide Verisure status information of all kind is to run a Python script with the python-verisure module and publish/subscribe to a MQTT broker. This would give you a generic solution that most "modern" sw including HA and Node-RED supports. I do that since years, including support for commands to SmartPlugs, rock solid. Only disadvantage is that we still have to poll for information, the push support used in apps seems to be "hidden away" somehow?

    This sound like a good solution. Can you explain a bit more in detail how I can achieve that. Share your setup or so? I'm also using node red. I short what I want to accomplish is turn on all lights when fire alarm is triggered. For getting instant alerts when something happens I create automations in verisure to turn on a smartplug, thats connects to a shelly 1. When Home assistant see the sensor on shelly 1 turn on I'm polling verisure for an update. If you this way opens a door it takes 1-2 seconds for HA to get the status.

    @persandstrom Would it somehow be possible to get push alerts to this python module?

  8. persandstrom commented on May 22, 2022

    @persandstrom
    Owner

    @jacobhallgren not at the moment. And I'm not sure how to do it. I'll add an investigation of that to my to-do list.

  9. jacobhallgren commented on May 22, 2022

    @jacobhallgren
    Author

    @jacobhallgren not at the moment. And I'm not sure how to do it. I'll add an investigation of that to my to-do list.

    @persandstrom Thanks, really appreciate it. Would open up so many possibilities with instant alerts on event.

  10. persandstrom commented on May 24, 2022

    @persandstrom
    Owner

    @jacobhallgren I cant find a solution on how to capture push notifications. You could enable email notifications and trigger on those.

  11. jacobhallgren commented on May 27, 2022

    @jacobhallgren
    Author

    @krambriw Can you share more in detail about your setup?

  12. krambriw commented on May 28, 2022

    @krambriw

    I can make a write up and provide examples of what I did
    I run a python script, Node-RED and Mosquitto MQTT broker, all on a Raspberry Pi. Currently just supporting arm statuses and smart plugs but I see no reason why it cannot be extended if needed

    You will have to install some additional stuff

    • install Mosquitto MQTT broker
    • install the python-verisure module
    • modify a file in python-verisure in the section for smart-plugs
    • create a copy of the script with your login credentials
    • using PIP to install some additional python libraries needed for the script
    • test the script via command prompt until it is running as expected
    • Install Node-RED and import a sample flow that will handle the start, monitoring and restarts if needed of your script

    If you feel fully comfortable with all this, it all sounds familiar, I can continue here or we can take it offfline

  13. jacobhallgren commented on May 31, 2022

    @jacobhallgren
    Author

    @krambriw Thank you for the details. Yes I feel comfortable with that. Please provide the script details. Do you also use this with Home Assistant?

  14. krambriw commented on Jun 1, 2022

    @krambriw

    I do not use HA anymore, I did earlier with some Z-Wave devices but all is now replaced with Node-RED. The script supports MQTT so you should be able to use it along with HA as well

    In the attached script you need to add your configuration details:
    Your verisure user name and password, your ip to your MQTT broker
    username = 'your_username'
    password = 'your_password'
    locale = 'sv_SE'
    mqtt_broker = '127.0.0.1'

    The script is checking the armstatus every 3x pollinterval (30 seconds). You can change this with the param
    pollinterval = 10

    I run the script with python3 like "python3 /home/pi/VerisureSystemInterface.py". You will have to install some python modules using pip3 to make it work. By trying to run it from the command prompt you will find out what modules you are missing, all required are listed in the start of the script:

    import time
    import verisure
    import paho.mqtt.client as mqtt
    import os
    import subprocess
    import signal
    from sys import exit
    from threading import Thread, Event, Condition
    from setproctitle import setproctitle

    First step is to make the script running in your system. Next I will explain and show you how to start, control and integrate it with Node-RED

    Best regards, Walter

    PS change the extension of the attached script from .txt to .py

    VerisureSystemInterface.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions