A python3 module for reading and changing status of verisure devices through verisure app API.
This software is not affiliated with Verisure Holding AB and the developers take no legal responsibility for the functionality or security of your Verisure Alarms and devices.
txt
2.6.1 Move to automation subdomain
2.6.0 Add Get Firmware Version
2.5.6 Fix docstring, cookie lasts 15 minutes
2.5.5 Solved bug during response error except using CLI
2.5.4 Add possibility to set giid to all queries, refactoring and resolve lint warnings
2.5.3 Refactor login
2.5.2 Fix XBN Database is not activated
2.5.1 Update CLI, split cookie login to separate function, rename mfa functions
2.5.0 Add MFA login
2.4.1 Add download_image
2.4.0 Add camera support
2.3.0 Add event-log command
2.2.0 Add set-autolock-enabled command
2.1.2 Installation instructions for m-api branch
2.1.1 Cleaned up readme
2.1.0 Add door-lock-configuration command
2.0.0 Move to GraphQL API, major changes
1.0.0 Move to app-API, major changes
sh
pip install vsure
or
sh
pip install git+https://github.com/persandstrom/[email protected]
```py
import verisure
USERNAME = "[email protected]" PASSWORD = "[email protected]"
session = verisure.Session(USERNAME, PASSWORD)
installations = session.login()
session.request_mfa() installations = session.validate_mfa(input("code:"))
giid
for your installationgiids = { inst['alias']: inst['giid'] for inst in installations['data']['account']['installations'] } print(giids)
session.set_giid(giids["MY STREET"]) ```
py
arm_state = session.request(session.arm_state())
output
json
{
"data": {
"installation": {
"armState": {
"type": null,
"statusType": "DISARMED",
"date": "2020-03-11T21:04:40.000Z",
"name": "Alex Poe",
"changedVia": "CODE",
"__typename": "ArmState"
},
"__typename": "Installation"
}
}
}
py
output = session.request(session.arm_state(), session.door_window())
output
json
[
{
"data": {
"installation": {
"armState": {
"type": null,
"statusType": "DISARMED",
"date": "2022-01-01T00:00:00.000Z",
"name": "Alex Poe",
"changedVia": "CODE",
"__typename": "ArmState"
},
"__typename": "Installation"
}
}
},
{
"data": {
"installation": {
"doorWindows": [
{
"device": {
"deviceLabel": "ABCD EFGH",
"__typename": "Device"
},
"type": null,
"area": "Front Door",
"state": "CLOSE",
"wired": false,
"reportTime": "2022-01-01T00:00:00.000Z",
"__typename": "DoorWindow"
},
{
"device": {
"deviceLabel": "IJKL MNOP",
"__typename": "Device"
},
"type": null,
"area": "Back Door",
"state": "CLOSE",
"wired": false,
"reportTime": "2022-01-01T00:00:00.000Z",
"__typename": "DoorWindow"
}
],
"__typename": "Installation"
}
}
}
]
```txt Usage: python -m verisure [OPTIONS] USERNAME PASSWORD
Read and change status of verisure devices through verisure app API
Options:
-i, --installation INTEGER Installation number
-c, --cookie TEXT File to store cookie in
--mfa Login using MFA
--arm-away CODE Set arm status away
--arm-home CODE Set arm state home
--arm-state Read arm state
--broadband Get broadband status
--camera-capture
sh
vsure [email protected] mypassword --arm-state
The output is the same as above Read alarm status (py)
json
{
"data": {
"installation": {
"armState": {
"type": null,
"statusType": "DISARMED",
"date": "2020-03-11T21:04:40.000Z",
"name": "Alex Poe",
"changedVia": "CODE",
"__typename": "ArmState"
},
"__typename": "Installation"
}
}
}
sh
vsure [email protected] mypassword --arm-state --door-window
Use typed return values for query functions
When I try to do an image capture from a camera, I first need to have a request id. When I try vsure [username] [password] --camera-get-request-id "[device_label]" ([device_label] I acquired through --cameras. It needs quotes I believe since there's a space in the label. Tried without quotes, and single quotes to no avail)
I get the following output;
{
"errors": [
{
"message": "Request Failed",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"ContentProviderCaptureImageRequest"
],
"data": {
"status": 400,
"logTraceId": "<retracted>",
"errorCode": "CCCP_DEVICE_NOT_CLAIMED",
"errorMessage": "Device not claimed"
}
}
],
"data": {
"ContentProviderCaptureImageRequest": null
}
}
what am I missing here or doing wrong?
The capture is always allowed on any arm state. The output of cameras is;
{
"data": {
"installation": {
"cameras": [
{
"visibleOnCard": true,
"initiallyConfigured": true,
"imageCaptureAllowed": "ALWAYS",
"imageCaptureAllowedByArmstate": null,
"device": {
"deviceLabel": "<retracted>",
"area": "<retracted>",
"__typename": "Device"
},
"latestCameraSeries": null
},
{
"visibleOnCard": true,
"initiallyConfigured": true,
"imageCaptureAllowed": "ALWAYS",
"imageCaptureAllowedByArmstate": null,
"device": {
"deviceLabel": "<retracted>,
"area": "<retracted>",
"__typename": "Device"
},
"latestCameraSeries": null
}
]
}
}
}
Would be nice like in the verisure app to see the state of the lock. If autolock is enabled or not.
Hello,
I just received a email from verisure (from Belgium) about 2 step verification:
It sounds you can disable it, but I think it should be handled.
``` Information to users with a third-party integration to Verisure Our system indicates that you are using a third-party integration to connect to Verisure functionality. If this is not the case, you can ignore this email. Otherwise, please continue reading.
Third-party integrations are not an officially sanctioned way to connect to Verisure. However, we hope that you are happy with the functionality provided through MyPages and Verisure app and will continue to use it. This email contains instructions for how to use third-party integrations together with 2-step verification.
Our goal is to keep our customers safe and secure. This includes maintaining a high security level for your Verisure account and reduce the risk of unauthorized access. In the next couple of weeks, we will therefor introduce 2-step verification for all logins to MyPages and the Verisure app.
Once 2-step verification is enabled for your account, you will need a one-time code in addition to your username and password.
Preparation for 2-step verification Please complete the following steps to prepare for 2-step verification. Go to Account in MyPages to check that your registered phone number is correct. Make sure that all users with access to your Verisure system have their own Verisure account. If there are users who share accounts, please ask the system owner or administrators to create individual accounts for them. This is done under Users in My Pages.
It is very important to have individual accounts with the correct phone number for each user. It ensures that the verification code is sent to the correct user and device at login.
If your alarm system is connected to the Verisure Monitoring Center, it also makes sure that the Verisure first responders can reach you in case of an emergency. This is especially important if you use mobile SOS services such as Verisure Guardian.
How does 2-step verification affect third-party integrations with Verisure? When 2-step verification is enabled, your connection through the third-party integration might stop working. Please note that if you disable 2-step verification, the risk of unauthorized access to your account is increased.
Follow these steps to restore the connection: Log in to MyPages with your username and password. Enter the verification code when you receive it. Go to Account and Subscription > Account > Login credentials > Disable 2-step verification Follow the instructions to disable 2-step verification. In order for us to get valuable input for potential future improvements for users that have a 3rd party integration to Verisure, we have created a short survey as part of the Disable 2-step verification steps. Best regards Verisure ```
Up until recentely when I called the get_overview() command I got a "userTracing" tab in the json reply but now its missing. Anybody knows if Verisure hidden it or if the information is avalible somewhere else?
Hi,
In the app I get notified when there's a power outage and it is also visible in the history tab in the app. Is it possible to have a binary sensor that flips to true if there's a power outage?