Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
0.1.77 (#456)
Browse files Browse the repository at this point in the history
* Bump version

* Add new HMIP Evo (HmIP-eTRV-E) (#434)

* Add device support for HmIP-WHS2 (#436)

* Update changelog

* Add device support for HmIP-SFD (#441)

Fixes #438

* Add HmIP-WRCR #390

* Add device support for "new" version of HmIP-SMI55 (#447)

Fixes #445

(cherry picked from commit 50582dc)

* Update changelog

* Bump version

* Reduce log level for events

* Add HB-RC-12-EP-C #450

* Update README.rst (#451)

* Add HmIP-SMO-2

* HmIP-SPI

* Add HmIPW-SMI55 #452

* Add HmIPW-WRC6 #452

* Final changelog

Co-authored-by: emufan <[email protected]>
Co-authored-by: wutr <[email protected]>
Co-authored-by: Timo <[email protected]>
Co-authored-by: SukramJ <[email protected]>
  • Loading branch information
5 people authored Jan 9, 2022
1 parent a6256ed commit 899a28c
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pyhomematic

Python 3 Interface to interact with Homematic devices.

Important: This project will be deprecated in favor of https://github.com/danielperna84/hahomematic at some point in the future. A custom component to work with hahomematic can be found here: https://github.com/danielperna84/custom_homematic. It is however not usable yet. Feel free to contribute!
Important: This project will be deprecated in favor of https://github.com/danielperna84/hahomematic at some point in the future. A custom component to work with hahomematic can be found here: https://github.com/danielperna84/custom_homematic. Feel free to contribute!

This library provides easy (bi-directional) control of Homematic devices hooked up to a regular CCU or Homegear. The focus is to be able to receive events. If you are only interested in actively controlling devices, you can use the Python-built-in xmlrpc.client.ServerProxy (Python 3). See pyhomematic._server.ServerThread.connect on how to connect to a CCU / Homegear as a client.

Expand Down
9 changes: 9 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Version 0.1.77 (2022-01-10)
- Add HmIP-WRCR @danielperna84
- Add HmIP-SMI55-2 @hzpz
- Add HB-RC-12-EP-C @danielperna84
- Add HmIP-SMO-2 (Issue #453) @danielperna84
- Add Sensors for HmIP-SPI @danielperna84
- Add HmIPW-SMI55 & HmIPW-WRC6 (Issue #452) @danielperna84
- Reduce loglevel for events

Version 0.1.76 (2021-10-20)
- Add HmIP-WHS2 @wutr
- Add HmIP-eTRV-E @emufan
Expand Down
2 changes: 1 addition & 1 deletion pyhomematic/devicetypes/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def event(self, interface_id, key, value):
"""
Handle the event received by server.
"""
LOG.info(
LOG.debug(
"HMGeneric.event: address=%s, interface_id=%s, key=%s, value=%s"
% (self._ADDRESS, interface_id, key, value))

Expand Down
13 changes: 12 additions & 1 deletion pyhomematic/devicetypes/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,18 @@ def ELEMENT(self):
return [1, 2, 3, 4, 5, 6, 7, 8]
if "HmIP-MOD-RC8" in self.TYPE:
return [1, 2, 3, 4, 5, 6, 7, 8]
if "HmIP-WRCD" in self.TYPE:
if "HmIP-WRCD" in self.TYPE or "HmIP-WRCR" in self.TYPE:
return [1, 2, 3]
return [1]

class RemoteWired(HMEvent, HelperEventRemote, HelperActionPress):
"""Wired Remote handle buttons."""

@property
def ELEMENT(self):
if "WRC6" in self.TYPE:
return [1, 2, 3, 4, 5, 6]


class RemoteBatteryIP(Remote, HelperLowBatIP, HelperOperatingVoltageIP):
"""Battery operated HomeMaticIP remote device."""
Expand Down Expand Up @@ -96,6 +104,7 @@ def ELEMENT(self):
"HM-RC-4-2": RemoteBattery,
"HM-RC-4-3": RemoteBattery,
"HM-RC-4-3-D": RemoteBattery,
"HB-RC-12-EP-C": RemoteBattery,
"HM-RC-8": Remote,
"HM-RC-12": Remote,
"HM-RC-12-B": Remote,
Expand Down Expand Up @@ -143,7 +152,9 @@ def ELEMENT(self):
"HmIP-WRCC2": RemoteBatteryIP,
"HmIP-BRC2": Remote,
"HmIP-WRC6": RemoteBatteryIP,
"HmIPW-WRC6": RemoteWired,
"HmIP-WRCD": RemoteBatteryIP,
"HmIP-WRCR": RemoteBatteryIP,
"HmIP-KRCA": RemoteBatteryIP,
"HmIP-KRC4": RemoteBatteryIP,
"HM-SwI-3-FM": RemotePress,
Expand Down
69 changes: 64 additions & 5 deletions pyhomematic/devicetypes/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,21 @@ def __init__(self, device_description, proxy, resolveparamsets=False):
"ACTUAL_TEMPERATURE": [4]
})

class ParticulateMatterSensorIP(SensorHmIPNoBattery):
"""Particulate matter sensor"""

def __init__(self, device_description, proxy, resolveparamsets=False):
super().__init__(device_description, proxy, resolveparamsets)
self.SENSORNODE.update({"ACTUAL_TEMPERATURE": [1],
"HUMIDITY": [1],
"MASS_CONCENTRATION_PM_1": [1],
"MASS_CONCENTRATION_PM_2_5": [1],
"MASS_CONCENTRATION_PM_10": [1],
"MASS_CONCENTRATION_PM_1_24H_AVERAGE": [1],
"MASS_CONCENTRATION_PM_2_5_24H_AVERAGE": [1],
"MASS_CONCENTRATION_PM_10_24H_AVERAGE": [1]
})

class WaterSensor(SensorHm, HelperSensorState):
"""Watter detect sensor."""

Expand Down Expand Up @@ -490,8 +505,8 @@ def get_brightness(self, channel=None):

@property
def ELEMENT(self):
return [0, 1]
return [0, 1]


class MotionIPV2(SensorHmIP):
"""Motion detection indoor 55 (rf ip)
Expand Down Expand Up @@ -521,6 +536,34 @@ def ELEMENT(self):
return [0, 1, 2, 3]


class MotionIPV2W(SensorHmIPW):
"""Motion detection indoor 55 (rf ip)
This is a binary sensor."""

def __init__(self, device_description, proxy, resolveparamsets=False):
super().__init__(device_description, proxy, resolveparamsets)

# init metadata
self.BINARYNODE.update({"MOTION_DETECTION_ACTIVE": [3], "MOTION": [3]})
self.SENSORNODE.update({"ILLUMINATION": [3]})
self.ATTRIBUTENODE.update({"ERROR_CODE": [0]})

def is_motion(self, channel=None):
""" Return True if motion is detected """
return bool(self.getBinaryData("MOTION", channel))

def is_motion_detection_active(self, channel=None):
return bool(self.getBinaryData("MOTION_DETECTION_ACTIVE", channel))

def get_brightness(self, channel=None):
""" Return brightness from 0 (dark) to 163830 (bright) """
return float(self.getSensorData("ILLUMINATION", channel))

@property
def ELEMENT(self):
return [0, 1, 2, 3]


class PresenceIP(SensorHmIP, HelperSabotageIP):
"""Presence detection with HmIP-SPI.
This is a binary sensor."""
Expand All @@ -529,8 +572,10 @@ def __init__(self, device_description, proxy, resolveparamsets=False):
super().__init__(device_description, proxy, resolveparamsets)

# init metadata
self.BINARYNODE.update({"PRESENCE_DETECTION_STATE": [1]})
self.SENSORNODE.update({"ILLUMINATION": [1]})
self.BINARYNODE.update({"PRESENCE_DETECTION_STATE": self.ELEMENT,
"PRESENCE_DETECTION_ACTIVE": self.ELEMENT})
self.SENSORNODE.update({"ILLUMINATION": self.ELEMENT,
"CURRENT_ILLUMINATION": self.ELEMENT})
self.ATTRIBUTENODE.update({"ERROR_CODE": [0]})

def is_motion(self, channel=None):
Expand All @@ -543,7 +588,7 @@ def get_brightness(self, channel=None):

@property
def ELEMENT(self):
return [0, 1]
return [1]


class PresenceIPW(SensorHmIPW):
Expand Down Expand Up @@ -627,6 +672,16 @@ class IPRemoteMotionV2(Remote, MotionIPV2):
def __init__(self, device_description, proxy, resolveparamsets=False):
super().__init__(device_description, proxy, resolveparamsets)


class IPRemoteMotionV2W(Remote, MotionIPV2W):
"""Wired motion detection with buttons (hm ip).
This is a binary sensor."""

# pylint: disable=useless-super-delegation
def __init__(self, device_description, proxy, resolveparamsets=False):
super().__init__(device_description, proxy, resolveparamsets)


class LuxSensor(SensorHm):
"""Sensor for messure LUX."""

Expand Down Expand Up @@ -1215,8 +1270,11 @@ def __init__(self, device_description, proxy, resolveparamsets=False):
"HM-Sec-MD": MotionV2,
"HmIP-SMI": MotionIPContactSabotage,
"HmIP-SMI55": IPRemoteMotionV2,
"HmIP-SMI55-2": IPRemoteMotionV2,
"HmIPW-SMI55": IPRemoteMotionV2W,
"HmIP-SMO": MotionIP,
"HmIP-SMO-A": MotionIP,
"HmIP-SMO-2": MotionIP,
"HmIP-SPI": PresenceIP,
"HmIPW-SPI": PresenceIPW,
"HM-Sen-LI-O": LuxSensor,
Expand Down Expand Up @@ -1285,4 +1343,5 @@ def __init__(self, device_description, proxy, resolveparamsets=False):
"HmIP-STE2-PCB": TempModuleSTE2,
"HmIP-SCTH230": CO2SensorIP,
"HmIP-DLD": IPLockDLD,
"HmIP-SFD": ParticulateMatterSensorIP,
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def readme():

PACKAGE_NAME = 'pyhomematic'
HERE = os.path.abspath(os.path.dirname(__file__))
VERSION = '0.1.76'
VERSION = '0.1.77'

PACKAGES = find_packages(exclude=['dist', 'build', 'tests'])

Expand Down

0 comments on commit 899a28c

Please sign in to comment.