Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing devices 131 and 133 #140

Merged
merged 23 commits into from
Dec 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2b08e2e
API:
coreGreenberet Dec 11, 2018
e45a051
added FULL_FLUSH_DIMMER Device
coreGreenberet Dec 11, 2018
c70a8db
Merge remote-tracking branch 'remotes/origin/master' into implementin…
coreGreenberet Dec 14, 2018
b2aabd6
added LiveUpdateState to Device class
coreGreenberet Dec 14, 2018
283e5be
added PushButton6
coreGreenberet Dec 14, 2018
e538ade
added HMIP-RC8 (Remote Control - 8 buttons)
coreGreenberet Dec 14, 2018
566146d
added chanelIndex parameter the Switch turn_on/off and set_switch_sta…
coreGreenberet Dec 14, 2018
7909b87
implemented SECURITY_BACKUP_ALARM_SWITCHING Group
coreGreenberet Dec 14, 2018
e4da6c9
added base functionalChanel
coreGreenberet Dec 14, 2018
9fc2b78
Merge remote-tracking branch 'remotes/origin/HEAD' into implementing_…
coreGreenberet Dec 14, 2018
868198d
added functionalChanelType mapping
coreGreenberet Dec 14, 2018
9650374
added the first functional Base Channels
coreGreenberet Dec 16, 2018
1ef25df
calling Device.load_functionalChannels on Home._ws_on_message
coreGreenberet Dec 16, 2018
fd9d636
added FunctionalChannels:
coreGreenberet Dec 16, 2018
0229577
fixed copy&paste error
coreGreenberet Dec 16, 2018
031cfa2
added FunctionalChannels Dimmer,WeatherSensor & WeatherSensorPro
coreGreenberet Dec 16, 2018
328a013
fixed WeatherSensor test
coreGreenberet Dec 16, 2018
b0a0f52
added SingleKeyChannel
coreGreenberet Dec 16, 2018
f6d8ab9
fixied copy & paste issue. I should hav elearned from the last time
coreGreenberet Dec 16, 2018
0246afc
added HmIP-MOD-OC8 ( Open Collector Module )
coreGreenberet Dec 16, 2018
8676e5c
fixed naming of PRESENCE_DETECTOR_INDOOR
coreGreenberet Dec 16, 2018
349afaa
added missing properties to FullFlushShutter
coreGreenberet Dec 16, 2018
5464dd7
added an unknown functional channel
coreGreenberet Dec 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
267 changes: 137 additions & 130 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,130 +1,137 @@
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 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%:raw-latex:`\homematicip`-rest-api
- %PROGRAMDATA%:raw-latex:`\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
========

- hmip_cli.py for list devices,groups,securityJournal; set label, turn
switches on/off
- Sample Projects are under
https://github.com/coreGreenberet/homematicip-samples

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-eTRV (Heating-thermostat)
- [X] HMIP-WTH, HMIP-WTH-2 (Wall Mounted Thermostat Pro)
- [X] HMIP-BWTH (Brand Wall Mounted Thermostat Pro)
- [X] HMIP-SWDO (Shutter Contact)
- [X] HMIP-SWDO-I (Shutter Contact Invisible)
- [X] HMIP-SWSD (Smoke Detector)
- [X] HMIP-FAL230-C6 (Floor Terminal Block)
- [X] HMIP-PS (Plugable Switch)
- [X] HMIP-PSM (Plugable Switch Measuring)
- [X] HMIP-STHD (Temperature and Humidity Sensor with display - indoor)
- [X] HMIP-STH (Temperature and Humidity Sensor without display - indoor)
- [X] HMIP-WRC2 (Wall-mount Remote Control - 2-button)
- [X] HMIP-ASIR (Alarm Siren)
- [X] HMIP-KRCA (Key Ring Remote Control & alarm)
- [X] HMIP-SMI (Motion Detector with Brightness Sensor - indoor)
- [X] HMIP-FROLL (Shutter Actuator - flush-mount)
- [X] HMIP-BROLL (Shutter Actuator - brand-mount)
- [X] HMIP-SPI (Precence Sensor - indoor)
- [X] HMIP-PDT (Pluggable Dimmer)
- [X] HMIP-BSM (Brand Switch and Meter)
- [X] HMIP-PCBS-BAT (Printed Curcuit Board Switch Battery)
- [X] HMIP-STHO (Temperature and Humidity Sensor outdoor)
- [X] HMIP-SWO-PR (Weather Sensor – pro)
- [X] HMIP-SWO-B (Weather Sensor)
- [X] HMIP-SRH (Rotary Handle Sensor)
- [X] HMIP-SWD (Water Sensor)
- [X] HMIP-SMI55 (Motion Detector with Brightness Sensor and Remote Control - 2-button)

Events
------

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

.. code:: python

##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()

.. |CircleCI| image:: https://circleci.com/gh/coreGreenberet/homematicip-rest-api.svg?style=shield
:target: https://circleci.com/gh/coreGreenberet/homematicip-rest-api
.. |PyPi| image:: https://badge.fury.io/py/homematicip.svg
:target: https://badge.fury.io/py//homematicip
.. |codecov| image:: https://codecov.io/gh/coreGreenberet/homematicip-rest-api/branch/master/graph/badge.svg
:target: https://codecov.io/gh/coreGreenberet/homematicip-rest-api
.. |Average time to resolve an issue| image:: http://isitmaintained.com/badge/resolution/coreGreenberet/homematicip-rest-api.svg
:target: http://isitmaintained.com/project/coreGreenberet/homematicip-rest-api
.. |commits-since-latest-release| image:: https://img.shields.io/github/commits-since/coreGreenberet/homematicip-rest-api/latest.svg
.. |donate-paypal| image:: https://img.shields.io/badge/Donate-PayPal-green.svg
:target: https://paypal.me/coreGreenberet
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 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%:raw-latex:`\homematicip`-rest-api
- %PROGRAMDATA%:raw-latex:`\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
========

- hmip_cli.py for list devices,groups,securityJournal; set label, turn
switches on/off
- Sample Projects are under
https://github.com/coreGreenberet/homematicip-samples

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 (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 (Heating-thermostat)
- [X] HMIP-FAL230-C6 (Floor Terminal Block)
- [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-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-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

.. code:: python

##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()

.. |CircleCI| image:: https://circleci.com/gh/coreGreenberet/homematicip-rest-api.svg?style=shield
:target: https://circleci.com/gh/coreGreenberet/homematicip-rest-api
.. |PyPi| image:: https://badge.fury.io/py/homematicip.svg
:target: https://badge.fury.io/py//homematicip
.. |codecov| image:: https://codecov.io/gh/coreGreenberet/homematicip-rest-api/branch/master/graph/badge.svg
:target: https://codecov.io/gh/coreGreenberet/homematicip-rest-api
.. |Average time to resolve an issue| image:: http://isitmaintained.com/badge/resolution/coreGreenberet/homematicip-rest-api.svg
:target: http://isitmaintained.com/project/coreGreenberet/homematicip-rest-api
.. |commits-since-latest-release| image:: https://img.shields.io/github/commits-since/coreGreenberet/homematicip-rest-api/latest.svg
.. |donate-paypal| image:: https://img.shields.io/badge/Donate-PayPal-green.svg
:target: https://paypal.me/coreGreenberet
9 changes: 5 additions & 4 deletions hmip_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ def main():
home.updateState))
sortedDevices = sorted(home.devices, key=attrgetter('deviceType', 'label'))
for d in sortedDevices:
print("{:45s} - Firmware: {:6} - Available Firmware: {:6} UpdateState: {}".format(d.label, d.firmwareVersion,
print("{:45s} - Firmware: {:6} - Available Firmware: {:6} UpdateState: {} LiveUpdateState: {}".format(d.label, d.firmwareVersion,
d.availableFirmwareVersion if d.availableFirmwareVersion is not None else "None",
d.updateState))
d.updateState, d.liveUpdateState))

if args.list_rssi:
command_entered = True
Expand All @@ -242,12 +242,13 @@ def main():

sortedDevices = sorted(home.devices, key=attrgetter('deviceType', 'label'))
for d in sortedDevices:
print("{:45s} - RSSI: {:4} {} - Peer RSSI: {:4} - {} {}".format(d.label,
print("{:45s} - RSSI: {:4} {} - Peer RSSI: {:4} - {} {} permanentlyReachable: {}".format(d.label,
d.rssiDeviceValue if d.rssiDeviceValue is not None else "None",
getRssiBarString(d.rssiDeviceValue),
d.rssiPeerValue if d.rssiPeerValue is not None else "None",
getRssiBarString(d.rssiPeerValue),
"Unreachable" if d.unreach else ""))
"Unreachable" if d.unreach else "",
d.permanentlyReachable) )
if args.list_rules:
command_entered = True
sortedRules = sorted(home.rules, key=attrgetter('ruleType', 'label'))
Expand Down
5 changes: 4 additions & 1 deletion homematicip.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<InterpreterArguments>
</InterpreterArguments>
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
<CommandLineArguments>--list-events</CommandLineArguments>
<CommandLineArguments>--list-devices</CommandLineArguments>
<InterpreterId>Global|PythonCore|3.6</InterpreterId>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand Down Expand Up @@ -59,6 +59,9 @@
<Compile Include="homematicip\device.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="homematicip\functionalChannels.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="homematicip\functionalHomes.py">
<SubType>Code</SubType>
</Compile>
Expand Down
9 changes: 7 additions & 2 deletions homematicip/aio/class_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
DeviceType.PLUGABLE_SWITCH: AsyncPlugableSwitch,
DeviceType.FULL_FLUSH_SHUTTER: AsyncFullFlushShutter,
DeviceType.BRAND_SHUTTER: AsyncFullFlushShutter,
DeviceType.PRECENCE_DETECTOR_INDOOR: AsyncPresenceDetectorIndoor,
DeviceType.PRESENCE_DETECTOR_INDOOR: AsyncPresenceDetectorIndoor,
DeviceType.PLUGGABLE_DIMMER: AsyncPluggableDimmer,
DeviceType.FULL_FLUSH_SWITCH_MEASURING: AsyncFullFlushSwitchMeasuring,
DeviceType.WEATHER_SENSOR: AsyncWeatherSensor,
Expand All @@ -34,7 +34,11 @@
DeviceType.ROTARY_HANDLE_SENSOR: AsyncRotaryHandleSensor,
DeviceType.MOTION_DETECTOR_PUSH_BUTTON: AsyncMotionDetectorPushButton,
DeviceType.WATER_SENSOR: AsyncWaterSensor,
DeviceType.SHUTTER_CONTACT_MAGNETIC: AsyncShutterContact
DeviceType.SHUTTER_CONTACT_MAGNETIC: AsyncShutterContact,
DeviceType.FULL_FLUSH_DIMMER : AsyncFullFlushDimmer,
DeviceType.PUSH_BUTTON_6 : AsyncPushButton6,
DeviceType.REMOTE_CONTROL_8 : AsyncRemoteControl8,
DeviceType.OPEN_COLLECTOR_8_MODULE : AsyncOpenCollector8Module
}

TYPE_GROUP_MAP = {
Expand All @@ -44,6 +48,7 @@
GroupType.EXTENDED_LINKED_SWITCHING: AsyncExtendedLinkedSwitchingGroup,
GroupType.LINKED_SWITCHING: AsyncLinkedSwitchingGroup,
GroupType.ALARM_SWITCHING: AsyncAlarmSwitchingGroup,
GroupType.SECURITY_BACKUP_ALARM_SWITCHING: AsyncAlarmSwitchingGroup,
GroupType.HEATING_HUMIDITY_LIMITER: AsyncHeatingHumidyLimiterGroup,
GroupType.HEATING_TEMPERATURE_LIMITER: AsyncHeatingTemperatureLimiterGroup,
GroupType.HEATING_CHANGEOVER: AsyncHeatingChangeoverGroup,
Expand Down
Loading