Skip to main content

Get alarm status and informations from the IMA Protect API.

Project description

pyimaprotect - Python IMA Protect Alarm UNOFFICIAL

https://img.shields.io/pypi/v/pyimaprotect.svg https://img.shields.io/pypi/pyversions/pyimaprotect.svg https://img.shields.io/travis/pcourbin/pyimaprotect.svg Documentation Status Updates https://codecov.io/gh/pcourbin/pyimaprotect/branch/main/graph/badge.svg pre-commit Black Project Maintenance BuyMeCoffee
Get and set alarm status from your IMA Protect Alarm.
You can get and set the status, get the list of contacts and download your images.

This work is originally developed for use with Home Assistant and the custom component imaprotect.

Features

Since the last update of IMAProtect “API” (05/2021), this plugin allows you to:

  • get the status of your alarm:

from pyimaprotect import IMAProtect, STATUS_NUM_TO_TEXT
ima = IMAProtect('myusername','mysuperpassword')

print("# Get Status")
imastatus = ima.status
print("Current Alarm Status: %d (%s)" % (imastatus,STATUS_NUM_TO_TEXT[imastatus]))
  • set the status of your alarm:

from pyimaprotect import IMAProtect
ima = IMAProtect('myusername','mysuperpassword')

print("# Set Status")
ima.status = 0 # 0 to OFF, 1 to PARTIAL and 2 to On
  • get the list and information of your registered contacts:

from pyimaprotect import IMAProtect
ima = IMAProtect('myusername','mysuperpassword')

print("# Get Contact List")
contact_list = ima.get_contact_list()
for contact in contact_list:
    print(contact)
  • download the images/photos taken with your connected elements:

from pyimaprotect import IMAProtect
ima = IMAProtect('myusername','mysuperpassword')

print("# Download Images")
ima.download_images() # Download images to 'Images/' folder. One subfolder per camera.
ima.download_images("MyImages/") # Download images to a defined directory 'MyImages/' folder.

Parameters

Methods

  • login(): open a session with the IMA Protect Alarm website

  • logout(): close the session with the IMA Protect Alarm website

  • status: property to get or set the status of your IMA Protect Alarm. See the next table to understand the values.

  • get_contact_list(): get a JSON with the list and information about your registered contacts.

  • download_images(): download the images/photos taken with your connected elements.

List of Alarm status values

Alarm Value

State

-1

UNKNOWN

0

OFF

1

PARTIAL

2

ON

Credits

This work was based on the work of lplancke and chris94440 for Jeedom.
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

3.1.6 (2024-03-31)

  • Update RE_ALARM_TOKEN since IMA Protect login page changed again…, thanks to @Chrilk

3.1.5 (2023-02-18)

  • Update login procedure according to new IMAProtect “API”, thanks to @Thesola10

3.1.2 (2021-11-05)

  • Update login procedure according to new IMAProtect “API”

  • Update download images procedure according to new IMAProtect “API”

3.1.0 (2021-05-22)

  • Add cookie expire usage to reduce the number of login

  • Add a logout function

3.0.0 (2021-05-22)

  • Add option to change the alarm (set/get)

  • Add function to get the list of contacts

  • Add function to download the images

get_status has been removed, status is now a property to get/set the alarm.

2.0.0 (2021-05-09)

  • Update using new IMAProtect “API”

  • No more other info (name, contract, etc.), only alarm status but faster result.

1.0.0 (2021-04-11)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyimaprotect-3.1.6.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

pyimaprotect-3.1.6-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file pyimaprotect-3.1.6.tar.gz.

File metadata

  • Download URL: pyimaprotect-3.1.6.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for pyimaprotect-3.1.6.tar.gz
Algorithm Hash digest
SHA256 f0c2f1395e551a45aa7e8f74d112358ad7312256778afbaa500d0c20f42afdd3
MD5 291100386c46775bc18785ba28e59d51
BLAKE2b-256 b60af7bca53f93d50e8931762e3fd0aae632d118327d3255308fe76731671e44

See more details on using hashes here.

File details

Details for the file pyimaprotect-3.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for pyimaprotect-3.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a6dfc879814df4cd5760154bbfd36b01c4afab25c00864eb03843b870560737f
MD5 2a476b1de4118fe4d619e8abb6281362
BLAKE2b-256 e4c6afcb2ad3f1ff6aa2db959683e228481482ea7586af9cbc2fcd4986b14b35

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page