Giter Site home page Giter Site logo

hahn-th / homematicip-rest-api Goto Github PK

View Code? Open in Web Editor NEW
209.0 31.0 63.0 6.33 MB

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

Home Page: https://hahn-th.github.io/homematicip-rest-api/

License: GNU General Public License v3.0

Python 99.67% HTML 0.33%
python-wrapper homematicip python3 cloud

homematicip-rest-api's Introduction

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.

Any help from the community through e.g. pull requests would be highly appreciated.

PyPI download month PyPI version fury.io Discord CircleCI PyPI - Python Version

Get Help / Discord

If you want to get in contact with me or need help with the library, you can get in touch with me via discord. There is a discord server and my discord tag is agonist#6159

πŸ“– New Documentation

There is a new documentation site unter https://hahn-th.github.io/homematicip-rest-api which is still under construction.

Support me

❀️ If you want to say thank you or want to support me, you can do that via PayPal. https://paypal.me/thomas08154711

Thanks

Kudos and a big thank you to @coreGreenberet, who created this library.

Installation

Just run pip install -U homematicip to get the package

"Nightly" Builds

Each push on the master branch will trigger a build. That way you can test the latest version of the library with your systems. Just run pip install -U homematicip --pre to get the package.

New devices and config dump

If you missing a device which is not implemented yet, open an issue and append a dump of your configuration to it using https://gist.github.com. To create a dump use the CLI: python hmip_cli.py --dump-configuration --anonymize. See Usage for more instructions.

Usage

Generate Token

First run python 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.

Use the CLI

You can send commands to homematicIP using the hmip_cli.py script. To get an overview, use -h or --help param. To address devices, use the argument -d in combination with the 24-digit ID (301400000000000000000000) from --list-devices.

A few examples:

  • python hmip_cli.py --help to get help
  • python hmip_cli.py --list-devices to get a list of your devices.
  • python hmip_cli.py -d <id-from-device-list> --toggle-garage-door to toogle the garage door with HmIP-WGC.
  • python hmip_cli.py --list-events to listen to events and changes in your homematicIP system
  • python hmip_cli.py -d <id> --set-lock-state LOCKED --pin 1234 to lock a door with HmIP-DLD
  • python hmip_cli.py --dump-configuration --anonymize to dump the current config and anonymize it.

Examples

  • hmip_cli.py for listing devices, groups, securityJournal; setting labels, turning switches on/off
  • Sample Projects are under ./homematicip-samples

Implemented Stuff

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

Homematic IP Devices:

  • ALPHA-IP-RBG (Alpha IP Wall Thermostat Display)
  • ALPHA-IP-RBGa (ALpha IP Wall Thermostat Display analog)
  • ELV-SH-AI8 (Alarmline Interface 8x Inputs) *powered by HmIP
  • ELV-SH-BS2 (Switch Actuator for brand switches 2x channels) *powered by HmIP
  • ELV-SH-GVI (Garden valve interface) *powered by HmIP
  • ELV-SH-IRS8 (Infared Remote control - 8x channels) *powered by HmIP
  • ELV-SH-SW1-BAT (2x Actuator Switch for 30V/1A with 2xAA Batteries) *powered by HmIP
  • ELV-SH-WUA (Dimming Actuator, 0-10/1-10-V-Control inputs, 8A 230V) *powered by HmIP
  • ELV-SH-WSC (2x Servo Controls, 5v - 12V) *powered by HmIP
  • HMIP-ASIR (Alarm Siren - indoor)
  • HMIP-ASIR-B1 (Alarm Siren - indoor) Silvercrest Edition
  • HMIP-ASIR-2 (Alarm Siren - indoor) New Version
  • HMIP-ASIR-O (Alarm Siren - outdoor)
  • HMIP-BBL (Blind Actuator for brand switches)
  • HMIP-BBL-2 (Blind Actuator for brand switches) New Version
  • HMIP-BDT (Dimming Actuator for brand switches)
  • HMIP-BRC2 (Remote Control for brand switches – 2x channels)
  • HMIP-BROLL (Shutter Actuator - brand-mount)
  • HMIP-BROLL-2 (Shutter Actuator - brand-mount) New Version
  • HMIP-BSL (Switch Actuator for brand switches – with signal lamp)
  • HMIP-BSM (Brand Switch and Meter Actuator)
  • HMIP-BSM-I (Brand Switch and Meter Actuator, International)
  • HMIP-BWTH (Wall Thermostat Display with switching output – for brand switches, 230V)
  • HMIP-BWTH24 (Wall Thermostat Display with switching output – for brand switches, 24V)
  • HMIP-DBB (Doorbell Push-Button)
  • HMIP-DLD (Door Lock Drive)
  • HMIP-DLS (Door Lock Sensor)
  • HmIP-DRG-DALI (Dali Gateway - readonly at the moment)
  • HMIP-DRBLI4 (Blind Actuator for DIN rail mount – 4 channels)
  • HMIP-DRSI1 (Switch Actuator for DIN rail mount – 1x channel)
  • HMIP-DRDI3 (Dimming Actuator Inbound 230V – 3x channels, 200W per channel) electrical DIN rail
  • HMIP-DRSI4 (Switch Actuator for DIN rail mount – 4x channels)
  • HMIP-DSD-PCB (Door Signal Dector PCB)
  • HMIP-eTRV (Heating-Thermostat with Display)
  • HMIP-eTRV-2 (Heating-Thermostat with Display) New Version
  • HMIP-eTRV-2 I9F (Heating-Thermostat with Display) New Version
  • HMIP-eTRV-2-UK (UK Version not tested, but it should work)
  • HMIP-eTRV-B (Heating-Thermostat basic with Display)
  • HMIP-eTRV-B-2 (Heating-Thermostat basic with Display) New Version
  • HMIP-eTRV-B-2 R4M (Heating-Thermostat basic with Display) New Version
  • HMIP-eTRV-B-UK (UK Version not tested, but it should work)
  • HMIP-eTRV-B1 (Heating-Thermostat basic with Display) Silvercrest Edition
  • HMIP-eTRV-C (Heating-Thermostat compact without display)
  • HMIP-eTRV-C-2 (Heating-Thermostat compact without display) New Version
  • HmIP-eTRV-CL (Heating-thermostat compact with dispay)
  • HMIP-eTRV-E (Heating-Thermostat Design Evo New Generation, white)
  • HMIP-eTRV-E-A (Heating-Thermostat Design Evo New Generation, anthracite)
  • HMIP-eTRV-E-S (Heating-Thermostat Design Evo New Generation, silver)
  • HMIP-FAL230-C6 (Floor Heating Actuator – 6x channels, 230V)
  • HMIP-FAL230-C10 (Floor Heating Actuator – 10x channels, 230V)
  • HMIP-FAL24-C6 (Floor Heating Actuator – 6x channels, 24V)
  • HMIP-FAL24-C10 (Floor Heating Actuator – 10x channels, 24V)
  • HMIP-FALMOT-C12 (Floor Heating Actuator – 12x channels, motorised)
  • HMIP-FBL (Blind Actuator - flush-mount)
  • HMIP-FCI1 (Contact Interface flush-mount – 1x channel)
  • HMIP-FCI6 (Contact Interface flush-mount – 6x channels)
  • HMIP-FDT (Dimming Actuator - flush-mount)
  • HMIP-FROLL (Shutter Actuator - flush-mount)
  • HMIP-FSI16 (Switch Actuator with Push-button Input 230V, 16A)
  • HMIP-FSM (Switch Actuator and Meter 5A – flush-mount)
  • HMIP-FSM16 (Switch Actuator and Meter 16A – flush-mount)
  • HMIP-FWI (Wiegand Interface)
  • HMIP-HAP (Cloud Access Point)
  • HMIP-HAP-B1 (Cloud Access Point) Silvercrest Edition
  • HMIP-HDM1 (Hunter Douglas & erfal window blinds
  • HMIP-HDRC (Hunter Douglas & erfal window blinds remote control)
  • HMIP-K-DRBLI4 (Blinds Actuator – 4x channels, 230V, 2,2A / 500W per channel) electrical DIN rail
  • HMIP-K-DRSI1 (Actuator Inbound 230V – 1x channel) electrical DIN rail
  • HMIP-K-DRDI3 (Dimming Actuator Inbound 230V – 3x channels, 200W per channel) electrical DIN rail
  • HMIP-K-DRSI4 (Switch Actuator – 4x channels, 16A per channel) electrical DIN rail
  • HMIP-KRCA (Key Ring Remote Control & Alarm)
  • HMIP-KRC4 (Key Ring Remote Control - 4x buttons)
  • HMIP-MIO16-PCB (Multi Analog/Digitial Interface - Switch Circuit Board)
  • HMIP-MIOB (Multi IO Box for floor heating & cooling)
  • HMIP-MOD-HO (Garage Door Module for HΓΆrmann)
  • HMIP-MOD-OC8 (Open Collector Module Receiver - 8x)
  • HMIP-MOD-RC8 (Open Collector Module Sender - 8x)
  • HMIP-MOD-TM (Garage Door Module for Novoferm and Tormatic door operators)
  • HMIP-MP3P (Combination Signalling Device MP3)
  • HMIP-P-DRG-DALI (DALI Lights Gateway)
  • HMIP-PCBS (Switch Circuit Board - 1x channel)
  • HMIP-PCBS2 (Switch Circuit Board - 2x channels)
  • HMIP-PCBS-BAT (Switch Circuit Board with Battery - 1x channel)
  • HMIP-PDT (Plugable Dimmer)
  • HMIP-PDT-UK (UK Version not tested, but it should work)
  • HMIP-PMFS (Plugable Power Supply Monitoring)
  • HMIP-PS (Plugable Switch)
  • HMIP-PS-2 (Plugable Switch) New Version
  • HMIP-PSM (Plugable Switch Measuring, Type F - Standard for Homematic)
  • HMIP-PSM-2 (Plugable Switch Measuring, Type F - Standard for Homematic) New Version
  • HMIP-PSM-CH (Plugable Switch Measuring, Type J)
  • HMIP-PSM-IT (Type L not tested, but it should work)
  • HMIP-PSM-PE (Type E not tested, but it should work)
  • HMIP-PSM-UK (Type G not tested, but it should work)
  • HMIP-RC8 (Remote Control - 8x buttons)
  • HMIP-RCB1 (Remote Control - 1x button)
  • HMIP-RGBW (RGB Led Controller - Readonly at the moment)
  • HMIP-SAM (Acceleration Sensor)
  • HMIP-SCI (Contact Interface Sensor)
  • HMIP-SCTH230 (CO2, Temperature and Humidity Sensor 230V)
  • HMIP-SFD (Fine Dust Sensor)
  • HMIP-SLO (Light Sensor - outdoor)
  • HMIP-SMI (Motion Detector with Brightness Sensor - indoor)
  • HMIP-SMI55 (Motion Detector with Brightness Sensor and Remote Control - 2x buttons)
  • HMIP-SMI55-2 (Motion Detector with Brightness Sensor and Remote Control - 2x buttons) New Version
  • HMIP-SMO (Motion Detector with Brightness Sensor - outdoor)
  • HMIP-SMO-2 (Motion Detector with Brightness Sensor - outdoor) New Version
  • HMIP-SMO-A (Motion Detector with Brightness Sensor - outdoor, anthracite)
  • HMIP-SMO-A-2 (Motion Detector with Brightness Sensor - outdoor, anthracite) New Version
  • HMIP-SPDR (Passage Sensor with Direction Recognition)
  • HMIP-SPI (Presence Sensor - indoor)
  • HMIP-SRH (Window Rotary Handle Sensor)
  • HMIP-SRD (Rain Sensor)
  • HMIP-STE2-PCB (Temperature Difference Sensors - 2x sensors)
  • HMIP-STH (Temperature and Humidity Sensor without display - indoor)
  • HMIP-STHD (Temperature and Humidity Sensor with display - indoor)
  • HMIP-STHO (Temperature and Humidity Sensor - outdoor)
  • HMIP-STHO-A (Temperature and Humidity Sensor – outdoor, anthracite)
  • HMIP-STV (Inclination and vibration Sensor)
  • HMIP-SWD (Water Sensor)
  • HMIP-SWDM (Door / Window Contact - magnetic)
  • HMIP-SWDM-2 (Door / Window Contact - magnetic) New Version
  • HMIP-SWDM-B2 (Door / Window Contact - magnetic) Silvercrest Edition
  • HMIP-SWDO (Shutter Contact Optical)
  • HMIP-SWDO-2 (Shutter Contact Optical) New Version
  • HMIP-SWDO-I (Shutter Contact Optical Invisible)
  • HMIP-SWDO-PL (Shutter Contact Optical Plus)
  • HMIP-SWDO-PL-2 (Shutter Contact Optical Plus) New Version
  • HMIP-SWO-B (Weather Sensor - Basic)
  • HMIP-SWO-PL (Weather Sensor – Plus)
  • HMIP-SWO-PR (Weather Sensor – Pro)
  • HMIP-SWSD (Smoke Detector)
  • HMIP-USBSM (USB Switching Measurement Actuator)
  • HMIP-WGC (Garage Door Button)
  • HMIP-WHS2 (Switch Actuator for heating systems – 2x channels)
  • HMIP-WKP (Keypad)
  • HMIP-WLAN-HAP (WLAN Access Point)
  • HMIP-WRC2 (Wall-mount Remote Control - 2x buttons)
  • HMIP-WRC6 (Wall-mount Remote Control - 6x buttons)
  • HMIP-WRCC2 (Wall-mount Remote Control – flat)
  • HMIP-WRCD (Wall-mount Remote Control - E-Paper-Status display)
  • HMIP-WRCR (Wall-mount Remote Control - Rotary)
  • HMIP-WT (Wall Mounted Thermostat without adjusting wheel) #probably only prototype for WTH-B and was not released
  • HMIP-WTH (Wall Mounted Thermostat Pro with Display)
  • HMIP-WTH-1 (Wall Mounted Thermostat Pro with Display Newest Version - successor of WTH-2 - really)
  • HMIP-WTH-2 (Wall Mounted Thermostat Pro with Display)
  • HMIP-WTH-B (Wall Mounted Thermostat basic without adjusting wheel)
  • HMIP-WTH-B-2 (Wall Mounted Thermostat basic without adjusting wheel) New Version
  • HMIP-WUA (Dimming Actuator, 0-10/1-10-V-Control inputs, 8A 230V)

Homematic IP Wired Devices (no radio signal):

  • HMIPW-DRAP (Homematic IP Wired Access Point)
  • HMIPW-BRC2 (Homematic IP Wired Remote Control for brand switches – 2x channels)
  • HMIPW-DRBL4 (Homematic IP Wired Blinds Actuator – 4x channels)
  • HMIPW-DRD3 (Homematic IP Wired Dimming Actuator – 3x channels)
  • HMIPW-DRS4 (Homematic IP Wired Switch Actuator – 4x channels)
  • HMIPW-DRI16 (Homematic IP Wired Inbound module – 16x channels)
  • HMIPW-DRI32 (Homematic IP Wired Inbound module – 32x channels)
  • HMIPW-DRS8 (Homematic IP Wired Switch Actuator – 8x channels)
  • HMIPW-FAL24-C6 (Homematic IP Wired Floor Heating Actuator – 6x channels, 24V)
  • HMIPW-FAL24-C10 (Homematic IP Wired Floor Heating Actuator – 10x channels, 24V)
  • HMIPW-FAL230-C6 (Homematic IP Wired Floor Heating Actuator – 6x channels, 230V)
  • HMIPW-FAL230-C10 (Homematic IP Wired Floor Heating Actuator – 10x channels, 230V)
  • HMIPW-FALMOT-C12 (Homematic IP Wired Floor Heating Actuator – 12x channels, motorised)
  • HMIPW-FIO6 (Homematic IP Wired IO Module flush-mount – 6x channels)
  • HMIPW-SCTHD (Homematic IP Wired CO2, Temperature and Humidity Sensor with Display)
  • HMIPW-SMI55 (Homematic IP Wired Motion Detector with Brightness Sensor and Remote Control - 2x buttons)
  • HMIPW-SPI (Homematic IP Wired Presence Sensor - indoor)
  • HMIPW-STH (Homematic IP Wired Temperature and Humidity Sensor without display - indoor)
  • HMIPW-STHD (Homematic IP Wired Temperature and Humidity Sensor with display - indoor)
  • HMIPW-WGD (Homematic IP Wired Wall-mount Glas Display - black edition)
  • HMIPW-WGD-PL (Homematic IP Wired Wall-mount Glas Display Play - black edition)
  • HMIPW-WRC2 (Homematic IP Wired Wall-mount Remote Control - 2x channels)
  • HMIPW-WRC6 (Homematic IP Wired Wall-mount Remote Control - 6x channels)
  • HMIPW-WTH (Homematic IP Wired Wall Mounted Thermostat Pro with Display)

Events

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

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


    # Initialise the API.
    config = homematicip.find_and_load_config_file()
    home = Home()
    home.set_auth_token(config.auth_token)
    home.init(config.access_point)

    # Add function to handle events and start the connection.
    home.onEvent += print_events
    home.enable_events()

    try:
        while True:
            time.sleep(1)
    except KeyboardInterrupt:
        print("Interrupt.")

Pathes for config.ini

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 accessible 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/

homematicip-rest-api's People

Contributors

codenightwriter avatar coregreenberet avatar davidhoffmann avatar dependabot[bot] avatar dickesw avatar gar00u avatar gtawelt avatar hahn-th avatar jensenb avatar k0n24d avatar markhaakman avatar markusduffek avatar matrixcrawler avatar mayrd avatar medlocus avatar palatincoder avatar requires avatar sander76 avatar schiegg avatar scop avatar seuffert avatar sschiffer avatar steckenpferd avatar sukramj avatar tabsl avatar tacker66 avatar trolipotlo avatar uberbruns avatar worm-ee avatar wweich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homematicip-rest-api's Issues

Missing error message

Hi,

I forgot that I configured a pin in our AP and I got no error message. I got only the loop with the message "press the blue button". It would be very helpful if the error messages are on the screen.

Regards,
David

Connection error with newest Version

When using the newest API Version, I get an error on establishing the connection with error 403.

My host system is MacOS Version 10.13.

I recently installed python 3, Version 3.6.3

The required packages are installed in following Versions:
Name: requests, Version: 2.18.4
Name: websocket-client, Version: 0.44.0
Name: future, Version: 0.16.0

My config-file is the same I successfully used with the Python2 Version from 2 days ago. My Pi still runs the old Version (without Python3 changes and connection class) and works like a charm.

With activated debug I see the following Console output:
2017-11-09 09:52:53,473 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): hmip1-1.homematic.com
2017-11-09 09:52:53,606 - urllib3.connectionpool - DEBUG - https://hmip1-1.homematic.com:6969 "POST /hmip/home/getCurrentState HTTP/1.1" 403 43
2017-11-09 09:52:53,610 - homematicip.connection - DEBUG - _restcall result: Errorcode=403 content({'errorCode': 'INVALID_AUTHORIZATION'})
2017-11-09 09:52:53,610 - homematicip.home - ERROR - Could not get the current configuration. Error: INVALID_AUTHORIZATION

Do you have an idea what is going wrong?

can't generat auth token

Hi!
Can someone help me in this point ?

I installed clean hassabian with home assistant 0.69.1 and upgraded and updated today homematicip as well but all same.

pi@hassbian:~/.local/bin $ python3 hmip_generate_auth_token.py

Please enter the accesspoint id (SGTIN): 3014-f711-a000-03d5-699f-xxxx
Traceback (most recent call last):
  File "hmip_generate_auth_token.py", line 70, in <module>
    main()
  File "hmip_generate_auth_token.py", line 20, in main
    home=Home()
  File "/home/pi/.local/lib/python3.5/site-packages/homematicip/home.py", line 127, in __init__
    connection = Connection()
  File "/home/pi/.local/lib/python3.5/site-packages/homematicip/base/base_connection.py", line 44, in __init__
    "language": locale.getdefaultlocale()[0],
  File "/usr/lib/python3.5/locale.py", line 558, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/lib/python3.5/locale.py", line 486, in _parse_localename
    raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8

actually whatever I put in SGTIN id - (in xxxx-xxxx-xxxx-xxxx-xxxx-xxxx format) the answer is alway the same.

Events broken

Hi, somehow device updates have been broken between the last release and the current dev.
Mainly in home.py the following fix has broken my updates in home-assistant:

    def _get_devices(self, json_state):
+        self.devices = [].    <<<<<
        for id_, raw in json_state["devices"].items():

I use self._device.on_update(self._device_changed) but I don't have a dedicated home.get_current_state() in the called _device_changed function.

Bug or feature?

invalid authorization

My first throw at this api is trying to get the homematicip-cli.py running.
I generate id and token. Put it in the config.py like so:

ACCESS_POINT = 'f02ae3a8-e9ab'  #with the dashes)
AUTH_TOKEN = '6BB8F04728D79' #long one without dashes

When I run the cli:
homematicip-cli.py --list-devices it returns with an error:

2017-06-27 13:48:51,973 - homematicip.home - ERROR - Could not get the current configuration. Error: INVALID_AUTHORIZATION

It seems to be happening with the method on line 121 home.get_current_state():
Can anyone confirm whether this occurring to him too ? Or am I doing something wrong.
BTW. My homematicip app reports 'homematicip-python' has been added as a device. So something has gone correct too !

What is RSSI ?

I saw this passing by in a pull request. I also see it as part of the json payload.
What does it mean ?

Testcases

Read your request and I thought to make an issue out of it. Good place to discuss this I guess.

dump_devicevalues.py

Hi,

in line 20 I got an error because in my version I must change from "d.open" to "d.windowState".

Best regards,
David

Unable to getAuthToken

Hi,

I've tried to get a AuthToken for my homematicip but it keeps looping the https://lookup.homematic.com:48335/getHost call.

Using the clientCharacteristics json and doing a curl post on the terminal results in Response code 400 INVALID_REQUEST:
curl -X POST -d "json={'clientCharacteristics': {'applicationVersion': '1.0', 'language': 'de_DE', 'osType': 'Darwin', 'deviceType': 'Computer', 'applicationIdentifier': 'homematicip-python', 'osVersion': '15.6.0', 'apiVersion': '10', 'deviceManufacturer': 'none'}, 'id': '<my-id>'}" https://lookup.homematic.com:48335/getHost

Do you have any idea how I can debug this?

Cheers,
Jan

async in the import path

Hi @sander76 ,

The word async in the import path e.g. from homematicip.async.auth import AsyncAuth seems to work fine if import is global at the begin of a file. But its not working if the import is in a function!

Add dimmer support

When I list my devices, I get the message:

homematicip.home - WARNING - There is no class for PLUGGABLE_DIMMER yet

Could you add support for a dimmer so that the lights can be dimmed?

asyncio implementation..

I am wondering whether you have considered implementing an asyncio version, especially implementing the aiohttp request and websocket component ?

I did a fork and started doing it myself, just to realise this means practically rewriting the whole package.
But I'd still like to put effort in achieving this. Do you have any ideas or plans for a more integrated approach?
Again, I'd love to help.

Sander.

error when running generate_auth_token.py

Hi i cant run the python script get the following error, could somebody help:

before i did: $ sudo pip install homematicip

python ./generate_auth_token.py

Traceback (most recent call last):
File "./generate_auth_token.py", line 2, in
import homematicip.auth
File "/home/pi/homematicip-rest-api/homematicip/auth.py", line 14
def init(self,home:Home):
^
SyntaxError: invalid syntax

thanks in advanced

Add class for ROOM_CONTROL_DEVICE

I've added this room control device.

Afterwards I get the error

There is no class for ROOM_CONTROL_DEVICE yet

Can you implement this device?

Thank you in advance!

Auth.isRequestAcknowledged receives "INVALID_REQUEST"

Hi,

generate_auth_token.py did not work for me. It just repeated: "Please press the blue button on the access point" even though I pressed the button. So I added some print statements to isRequestAcknowledged.

This is what is send

{'deviceId': '###MY_UUID###'}

and this is what I receive:

{
  "errorCode" : "INVALID_REQUEST"
}

Is there anything I can do from here?

BrandSwitchMeasuring

Hi,

can you please have a look on the BrandSwitchMeasuring, seems it is implemented but I get:
There is no class for BRAND_SWITCH_MEASURING yet

Thanks Mattias

Vote: Drop Python 2.7 support?

Hello,

I'm thinking of dropping the support for python 2.7 and just use 3.X in the future. I've started the project with 2.7, because of some online surveys most people are still using 2.7. 3.X on the other hand has some nice features on which the project could really benefit from and implementing everything twice (e.g. for asyncio in 3.X) or check the compatibility on both python versions is really frustrating.

What do you guys think?

Websocket: json.loads - the JSON object must be str, not 'bytes'

json.loads doesn't support bytes before python 3.6.

2018-05-07 17:25:51,098 - websocket - ERROR - error from callback <bound method Home._ws_on_message of <homematicip.home.Home object at 0xb72a39ec>>: the JSON object must be str, not 'bytes'
File "/usr/local/lib/python3.5/dist-packages/websocket/_app.py", line 315, in _callback
callback(self, *args)
File "/usr/local/lib/python3.5/dist-packages/homematicip/home.py", line 466, in _ws_on_message
js = json.loads(message)
File "/usr/lib/python3.5/json/init.py", line 312, in loads
s.class.name))

Home-Assistant support

Hi,

I started to add support for HomematicIP to HomeAssistant based on your library.
home-assistant/core#12761
I plan to add support for a few more devices which I own in the next days.
Are you going to release a new version of all the changes and new devices you have added soon?

Ciao Mattias

getting fiddler to work... almost there..

I am making progress on my fiddler setup, but now I get stuck when trying to create a websocket connection..

I get a 504 error when trying to connect to https://hmip1-1.homematic.com:8888. The fiddler log reports

14:04:59:1864 Fiddler.Network.ProtocolViolation - [#13] Incorrectly formed Request-Line. abs_path was empty (e.g. missing /). RFC2616 Section 5.1.2

meaning there is no url provided. Does anyone have an idea how to bypass this ?

Unicode error with python3

Hi,

if I use python3 I got this error:

python3 dump_devicevalues.py 
Traceback (most recent call last):
  File "dump_devicevalues.py", line 59, in <module>
    write_wallmountedthermostatpro(d)
  File "dump_devicevalues.py", line 48, in write_wallmountedthermostatpro
    "{};{};{}%;{}Β°C\n".format(device.id, unicode(device.lastStatusUpdate), d.humidity, d.actualTemperature))
NameError: name 'unicode' is not defined

https://stackoverflow.com/questions/6812031/how-to-make-unicode-string-with-python3

Best regards,
David

Exception because of the logging handler

python homematicip_cli.py 
Traceback (most recent call last):
  File "homematicip_cli.py", line 18, in <module>
    logger = create_logger();
  File "homematicip_cli.py", line 13, in create_logger
    handler = logging.handlers.TimedRotatingFileHandler(config.LOGGING_FILENAME, when='midnight', backupCount=5) if config.LOGGING_FILENAME else logging.StreamHandler()
AttributeError: 'module' object has no attribute 'handlers'

getting fiddler to work

Trying to get fiddler to work, so I can help with this repo, but can't get fiddler to work. It gets stuck at trying to "login"... Any idea how to solve this ?

image

Connection error

I cannot connect anymore. Possibly the api has changed ?

Sander.

control the heating element temperature ?

Hi short questions is it possible to control the heating element temperature ?

My Homeatic IP Device
Homematic IP HeizkΓΆrperthermostat HMIP-eTRV/2 140280

tried
python3 homematicip_cli.py --device ID --set-display setpoint 20

but didnt worked, is it even possible ?

implement setZonesDeviceAssignment

Path: home/security/setZonesDeviceAssignment
Post:

{
	"zonesDeviceAssignment": {
		"INTERNAL": [ <DEVICEID>, <DEVICEID>, ... ],
		"EXTERNAL":  [ <DEVICEID>, <DEVICEID>, ... ]
	}
}

Result:
None on success

hmip_cli.py --anonymize

There should be an optional parameter for --dump-configuration to anonymize the data.
This will provide a secure way to publish the config for contributors for implementing new devices

json loading of websocket message throws an error.

In py3:

An incoming websocket message is being converted to json in __ws_on_message in home.py.
This throws an error as incoming is bytes. not str.

error from callback <bound method Home.__ws_on_message of id(6b3ac3aa-be94-42d4-8af8-aa800070e0cf) id(6b3ac3aa-be94-42d4-8af8-aa800070e0cf)>: the JSON object must be str, not 'bytes'
  File "C:\virtualenvs\homematicip\lib\site-packages\websocket\_app.py", line 269, in _callback
    callback(self, *args)
  File "C:\virtualenvs\homematicip\lib\site-packages\homematicip\home.py", line 348, in __ws_on_message
    js = json.loads(message)
  File "C:\Users\steun\AppData\Local\Programs\Python\Python35\lib\json\__init__.py", line 312, in loads
    s.__class__.__name__))
error from callback <bound method Home.__ws_on_message of id(6b3ac3aa-be94-42d4-8af8-aa800070e0cf) id(6b3ac3aa-be94-42d4-8af8-aa800070e0cf)>: the JSON object must be str, not 'bytes'
  File "C:\virtualenvs\homematicip\lib\site-packages\websocket\_app.py", line 269, in _callback
    callback(self, *args)
  File "C:\virtualenvs\homematicip\lib\site-packages\homematicip\home.py", line 348, in __ws_on_message
    js = json.loads(message)
  File "C:\Users\steun\AppData\Local\Programs\Python\Python35\lib\json\__init__.py", line 312, in loads
    s.__class__.__name__))

implement createExtendedLinkedSwitchingGroup & depending functions

Path: group/switching/linked/createExtendedLinkedSwitchingGroup
Post: { "label" : <LABEL> }
Result:

{
  "assignableSensorChannels" : [ ],
  "assignableActuatorChannels" : [ {
    "deviceId" : "<DEVICEID>",
    "channelIndex" : 1
  } ],
  "unassignableSensorChannels" : [ ],
  "unassignableActuatorChannels" : [ ],
  "sensorGroupLimit" : 0,
  "actuatorGroupLimit" : 10,
  "groupId" : "<THE NEW GROUP ID>"
}

Path: group/switching/linked/setGroupActuatorChannels
Post:

{ "groupId" : <groupId>
, "channels" : [ {
    "deviceId" : "<DEVICEID>",
    "channelIndex" : 1
  } ]
}

Result:

{
  "assignableSensorChannels" : [ ],
  "assignableActuatorChannels" : [ {
    "deviceId" : "<DEVICEID>",
    "channelIndex" : 1
  } ],
  "unassignableSensorChannels" : [ ],
  "unassignableActuatorChannels" : [ ],
  "sensorGroupLimit" : 0,
  "actuatorGroupLimit" : 10,
}

Path: group/switching/linked/setGroupSensorChannels
Post:

{ "groupId" : <groupId>
, "channels" : [ {
    "deviceId" : "<DEVICEID>",
    "channelIndex" : 1
  } ]
}

Result:

{
  "assignableSensorChannels" : [ ],
  "assignableActuatorChannels" : [ {
    "deviceId" : "<DEVICEID>",
    "channelIndex" : 1
  } ],
  "unassignableSensorChannels" : [ ],
  "unassignableActuatorChannels" : [ ],
  "sensorGroupLimit" : 0,
  "actuatorGroupLimit" : 10,
}

can not run: pip install homematicip

Hello,
running debian 9, python 3.5.3 , python-pip 9.0.1-2, but when running:
pip install homematicip
I do get get:
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in
from pip import main
ImportError: No module named 'pip'

Any hint is welcome.

regards
kuzco1

Move config file to json

To move the cli tool inside the python package you should be able to refer to a config file located somewhere else on your computer.
It would make sense to:

  • make config file a json file
  • refer to the config file as a required argument when starting the cli tool

'Home' object has no attribute 'init'

Hi,

it feels like this is the absolute noob question; and indeed it is my first contact to python. Please excuse me, in case it is very dumb :-).

I tried to get the scripts running on a PI3 running recent openhabian.

sudo python3 generate_auth_token.py Please enter the accesspoint id (SGTIN): 3014-F711-A000-03D7-xxxx-xxxx Please enter the PIN (leave Blank if there is none): Please enter the client/devicename (leave blank to use default): Traceback (most recent call last): File "generate_auth_token.py", line 20, in <module> home.init(access_point) AttributeError: 'Home' object has no attribute 'init'

Export and chmods where tipps i googled...

I feel like i have overseen something fundamental here - can you please give me a hint?

Best
Michael

Error with new API-Version 8

After generating a new auth token with VERSION 8 and calling list_devices.py I get the following error:
{
"errorCode" : "CLIENT_VERSION_NOT_SUPPORTED"
}

Has anyone run this script successfully with the new Version?

catching individual button presses

I have a HMIP-WRC2 device. I am trying to catch individual key presses of this device, but I am only getting a "DEVICE CHANGED" event which does not say which of two buttons are actually pressed.

Anyone any idea how to catch individual key presses of this device (did the same with the 8 button remote control without succes).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.