Skip to content

A python wrapper for the homematicIP REST API (Access Point Based)

License

Notifications You must be signed in to change notification settings

anli-xsigns/homematicip-rest-api

 
 

Repository files navigation

homematicip-rest-api

A python 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.

#Installation Just run pip install homematicip to get the package

Usage

first download and run generate_auth_token.py to get an auth token for your access point. copy the generated auth token from the window config.py and add also the Access Point ID

Examples

  • homematicip_cli.py list devices,groups,securityJournal; set label, turn switches on/off

Implemented Stuff

  • generate authentication token
  • Read current state of the Environment
  • Weather
  • Location
  • Basic Informations( apversion, pinAssigned, timeZone, ... )
  • Devices (partly)
  • Client
  • Groups

Devices:

  • HMIP-eTRV (Heating-thermostat)
  • HMIP-WTH, HMIP-WTH-2 (Wall Mounted Thermostat Pro)
  • HMIP-SWDO (Shutter Contact)
  • HMIP-SWSD (Smoke Detector)
  • HMIP-FAL230-C6 (Floor Terminal Block)
  • HMIP-PS (Plugable Switch)
  • HMIP-PSM (Plugable Switch Measuring)
  • HMIP-STHD (Temperature and Humidity Sensor with display - indoor)
  • HMIP-WRC2 (Wall-mount Remote Control - 2-button)
  • HMIP-ASIR (Alarm Siren)
  • HMIP-KRCA (Key Ring Remote Control – alarm)
  • HMIP-SMI (Motion Detector with Brightness Sensor - indoor)

Groups

  • Meta (Rooms)
  • Heating
  • Security
  • Switching
  • Switch Groups
  • INBOX
  • HEATING_TEMPERATURE_LIMITER
  • HEATING_HUMIDITY_LIMITER
  • SECURITY_ZONE
  • ALARM_SWITCHING
  • HEATING_CHANGEOVER
  • LINKED_SWITCHING
  • HEATING_COOLING_DEMAND
  • HEATING_DEHUMIDIFIER
  • HEATING_EXTERNAL_CLOCK
  • HEATING_COOLING_DEMAND_BOILER
  • HEATING_COOLING_DEMAND_PUMP

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 u"EventType: {} Data: {}".format(event["eventType"], event["data"])

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


Implemented Functions:

General

  • getCurrentState (this reads the base configuration for the whole AP)
  • setZonesActivation (activates the alarm zones (internal and/or external))
  • everything needed for a successfull registration/authentication
  • setLocation
  • setPin
  • deleteGroup
  • getOAuthOTK (Get Token for Alexa)
  • setTimeZone
  • setPowerMeterUnitPrice

Heating

  • setBoost
  • setSetPointTemperature
  • getProfile
  • updateProfile
  • activateAbsenceWithDuration
  • activateAbsenceWithPeriod
  • activateVacation
  • deactivateVacation
  • deactivateAbsence

Security

  • getSecurityJournal
  • setIntrusionAlertThroughSmokeDetectors

Device

  • setClimateControlDisplay
  • setDeviceLabel
  • setSwitchState (turn on/off)

Alarm

  • testSignalOptical
  • setSignalOptical

About

A python wrapper for the homematicIP REST API (Access Point Based)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%