Skip to main content

An API for the homematicip cloud

Project description

homematicip-rest-api

A Python 3 wrapper for the homematicIP REST API (Access Point Based) Since there is no official documentation about this API everything was done via reverse engineering. Use at your own risk.

CircleCI PyPi codecov Average time to resolve an issue commits-since-latest-release donate-paypal

Installation

Just run pip3 install -U homematicip to get the package

Usage

first run hmip_generate_auth_token.py (from the command line) to get an auth token for your access point. it will generate a “config.ini” in your current directory. The scripts will look for a config.ini in 3 different locations depending on your OS. Copy the file to one of these locations so that it will be accessable for the scripts.

  • General

    • current working directory

  • Windows

    • %APPDATA%\homematicip-rest-api

    • %PROGRAMDATA%\homematicip-rest-api

  • Linux

    • ~/.homematicip-rest-api/

    • /etc/homematicip-rest-api/

  • MAC OS

    • ~/Library/Preferences/homematicip-rest-api/

    • /Library/Application Support/homematicip-rest-api/

Examples

Implemented Stuff

  • [X] generate authentication token

  • [X] Read current state of the Environment

  • [X] Weather

  • [X] Location

  • [X] Basic Informations( apversion, pinAssigned, timeZone, … )

  • [X] Devices (partly)

  • [X] Client

  • [X] Groups

Devices:

  • [X] HMIP-ASIR, HMIP-ASIR-B1 (Alarm Siren)

  • [X] HMIP-BROLL (Shutter Actuator - brand-mount)

  • [X] HMIP-BSM (Brand Switch and Meter)

  • [X] HMIP-BWTH (Brand Wall Mounted Thermostat Pro)

  • [X] HMIP-eTRV, HMIP-eTRV2, HMIP-eTRV-B1 (Heating-thermostat)

  • [X] HMIP-FAL230-C6 (Floor Terminal Block)

  • [X] HMIP-FCI1 (Contact Interface flush-mount – 1 channel)

  • [X] HMIP-FDT (Dimming Actuator flush-mount)

  • [X] HMIP-FROLL (Shutter Actuator - flush-mount)

  • [X] HMIP-KRCA (Key Ring Remote Control & alarm)

  • [X] HMIP-MOD-OC8 ( Open Collector Module )

  • [X] HMIP-RC8 (Remote Control - 8 buttons)

  • [X] HMIP-PCBS-BAT (Printed Curcuit Board Switch Battery)

  • [X] HMIP-PDT (Pluggable Dimmer)

  • [X] HMIP-PS (Plugable Switch)

  • [X] HMIP-PSM (Plugable Switch Measuring)

  • [X] HMIP-SMI (Motion Detector with Brightness Sensor - indoor)

  • [X] HMIP-SMI55 (Motion Detector with Brightness Sensor and Remote Control - 2-button)

  • [X] HMIP-SMO, HMIP-SMO-A (Motion Detector with Brightness Sensor - outdoor)

  • [X] HMIP-SPI (Precence Sensor - indoor)

  • [X] HMIP-SRH (Rotary Handle Sensor)

  • [X] HMIP-STH (Temperature and Humidity Sensor without display - indoor)

  • [X] HMIP-STHD (Temperature and Humidity Sensor with display - indoor)

  • [X] HMIP-STHO (Temperature and Humidity Sensor outdoor)

  • [X] HMIP-SWD (Water Sensor)

  • [X] HMIP-SWDO (Shutter Contact)

  • [X] HMIP-SWDO-I (Shutter Contact Invisible)

  • [X] HMIP-SWDM (Door / Window Contact - magnetic )

  • [X] HMIP-SWDM-B2 (Door / Window Contact - magnetic )

  • [X] HMIP-SWO-B (Weather Sensor)

  • [X] HMIP-SWO-PL (Weather Sensor – plus)

  • [X] HMIP-SWO-PR (Weather Sensor – pro)

  • [X] HMIP-SWSD (Smoke Detector)

  • [X] HMIP-WRC2 (Wall-mount Remote Control - 2-button)

  • [X] HMIP-WRC6 (Wall-mount Remote Control - 6-button)

  • [X] HMIP-WTH, HMIP-WTH-2 (Wall Mounted Thermostat Pro)

Events

It’s also possible to use push notifications based on a websocket connection

##initialize the api
#...
#get the home object
home = homematicip.Home()
#add a function to handle new events
home.onEvent += printEvents
#enable the event connection -> this will also start the websocket connection to the homeMaticIP Cloud
home.enable_events()


#example function to display incoming events
def printEvents(eventList):
    for event in eventList:
        print "EventType: {} Data: {}".format(event["eventType"], event["data"])

#if needed you can close the websocket connection with
home.disable_events()

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

homematicip-0.10.4.tar.gz (73.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

homematicip-0.10.4-py3-none-any.whl (57.0 kB view details)

Uploaded Python 3

File details

Details for the file homematicip-0.10.4.tar.gz.

File metadata

  • Download URL: homematicip-0.10.4.tar.gz
  • Upload date:
  • Size: 73.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.1

File hashes

Hashes for homematicip-0.10.4.tar.gz
Algorithm Hash digest
SHA256 12abb105888addcfe9333c54a0a06b1af87be4a778b2f42ea5db6cacca777717
MD5 684786ef125518f670a68409ee8bcda2
BLAKE2b-256 8db1ddcdd34fcda48f194c4a07201652737a2e26ec641958ed384882116d41e8

See more details on using hashes here.

File details

Details for the file homematicip-0.10.4-py3-none-any.whl.

File metadata

  • Download URL: homematicip-0.10.4-py3-none-any.whl
  • Upload date:
  • Size: 57.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.1

File hashes

Hashes for homematicip-0.10.4-py3-none-any.whl
Algorithm Hash digest
SHA256 197cf5f828ab0f49abf4a98869db18c3f9d091ea6ce03d4cb30f9c99d67fc0a4
MD5 60bbc4ca18d604d7c6fc5cd672885c22
BLAKE2b-256 438c8d5a7cccc198a78b167be7c6436425ae0687cb7e0d729a3e37e82be6dabe

See more details on using hashes here.

Supported by

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