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

Commit 899a28c

Browse files
danielperna84emufanwutrhzpzSukramJ
authored
0.1.77 (#456)
* 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]>
1 parent a6256ed commit 899a28c

File tree

6 files changed

+88
-9
lines changed

6 files changed

+88
-9
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pyhomematic
55

66
Python 3 Interface to interact with Homematic devices.
77

8-
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!
8+
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!
99

1010
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.
1111

changelog.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
Version 0.1.77 (2022-01-10)
2+
- Add HmIP-WRCR @danielperna84
3+
- Add HmIP-SMI55-2 @hzpz
4+
- Add HB-RC-12-EP-C @danielperna84
5+
- Add HmIP-SMO-2 (Issue #453) @danielperna84
6+
- Add Sensors for HmIP-SPI @danielperna84
7+
- Add HmIPW-SMI55 & HmIPW-WRC6 (Issue #452) @danielperna84
8+
- Reduce loglevel for events
9+
110
Version 0.1.76 (2021-10-20)
211
- Add HmIP-WHS2 @wutr
312
- Add HmIP-eTRV-E @emufan

pyhomematic/devicetypes/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def event(self, interface_id, key, value):
5555
"""
5656
Handle the event received by server.
5757
"""
58-
LOG.info(
58+
LOG.debug(
5959
"HMGeneric.event: address=%s, interface_id=%s, key=%s, value=%s"
6060
% (self._ADDRESS, interface_id, key, value))
6161

pyhomematic/devicetypes/misc.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,18 @@ def ELEMENT(self):
5858
return [1, 2, 3, 4, 5, 6, 7, 8]
5959
if "HmIP-MOD-RC8" in self.TYPE:
6060
return [1, 2, 3, 4, 5, 6, 7, 8]
61-
if "HmIP-WRCD" in self.TYPE:
61+
if "HmIP-WRCD" in self.TYPE or "HmIP-WRCR" in self.TYPE:
6262
return [1, 2, 3]
6363
return [1]
6464

65+
class RemoteWired(HMEvent, HelperEventRemote, HelperActionPress):
66+
"""Wired Remote handle buttons."""
67+
68+
@property
69+
def ELEMENT(self):
70+
if "WRC6" in self.TYPE:
71+
return [1, 2, 3, 4, 5, 6]
72+
6573

6674
class RemoteBatteryIP(Remote, HelperLowBatIP, HelperOperatingVoltageIP):
6775
"""Battery operated HomeMaticIP remote device."""
@@ -96,6 +104,7 @@ def ELEMENT(self):
96104
"HM-RC-4-2": RemoteBattery,
97105
"HM-RC-4-3": RemoteBattery,
98106
"HM-RC-4-3-D": RemoteBattery,
107+
"HB-RC-12-EP-C": RemoteBattery,
99108
"HM-RC-8": Remote,
100109
"HM-RC-12": Remote,
101110
"HM-RC-12-B": Remote,
@@ -143,7 +152,9 @@ def ELEMENT(self):
143152
"HmIP-WRCC2": RemoteBatteryIP,
144153
"HmIP-BRC2": Remote,
145154
"HmIP-WRC6": RemoteBatteryIP,
155+
"HmIPW-WRC6": RemoteWired,
146156
"HmIP-WRCD": RemoteBatteryIP,
157+
"HmIP-WRCR": RemoteBatteryIP,
147158
"HmIP-KRCA": RemoteBatteryIP,
148159
"HmIP-KRC4": RemoteBatteryIP,
149160
"HM-SwI-3-FM": RemotePress,

pyhomematic/devicetypes/sensors.py

Lines changed: 64 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,21 @@ def __init__(self, device_description, proxy, resolveparamsets=False):
209209
"ACTUAL_TEMPERATURE": [4]
210210
})
211211

212+
class ParticulateMatterSensorIP(SensorHmIPNoBattery):
213+
"""Particulate matter sensor"""
214+
215+
def __init__(self, device_description, proxy, resolveparamsets=False):
216+
super().__init__(device_description, proxy, resolveparamsets)
217+
self.SENSORNODE.update({"ACTUAL_TEMPERATURE": [1],
218+
"HUMIDITY": [1],
219+
"MASS_CONCENTRATION_PM_1": [1],
220+
"MASS_CONCENTRATION_PM_2_5": [1],
221+
"MASS_CONCENTRATION_PM_10": [1],
222+
"MASS_CONCENTRATION_PM_1_24H_AVERAGE": [1],
223+
"MASS_CONCENTRATION_PM_2_5_24H_AVERAGE": [1],
224+
"MASS_CONCENTRATION_PM_10_24H_AVERAGE": [1]
225+
})
226+
212227
class WaterSensor(SensorHm, HelperSensorState):
213228
"""Watter detect sensor."""
214229

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

491506
@property
492507
def ELEMENT(self):
493-
return [0, 1]
494-
508+
return [0, 1]
509+
495510

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

523538

539+
class MotionIPV2W(SensorHmIPW):
540+
"""Motion detection indoor 55 (rf ip)
541+
This is a binary sensor."""
542+
543+
def __init__(self, device_description, proxy, resolveparamsets=False):
544+
super().__init__(device_description, proxy, resolveparamsets)
545+
546+
# init metadata
547+
self.BINARYNODE.update({"MOTION_DETECTION_ACTIVE": [3], "MOTION": [3]})
548+
self.SENSORNODE.update({"ILLUMINATION": [3]})
549+
self.ATTRIBUTENODE.update({"ERROR_CODE": [0]})
550+
551+
def is_motion(self, channel=None):
552+
""" Return True if motion is detected """
553+
return bool(self.getBinaryData("MOTION", channel))
554+
555+
def is_motion_detection_active(self, channel=None):
556+
return bool(self.getBinaryData("MOTION_DETECTION_ACTIVE", channel))
557+
558+
def get_brightness(self, channel=None):
559+
""" Return brightness from 0 (dark) to 163830 (bright) """
560+
return float(self.getSensorData("ILLUMINATION", channel))
561+
562+
@property
563+
def ELEMENT(self):
564+
return [0, 1, 2, 3]
565+
566+
524567
class PresenceIP(SensorHmIP, HelperSabotageIP):
525568
"""Presence detection with HmIP-SPI.
526569
This is a binary sensor."""
@@ -529,8 +572,10 @@ def __init__(self, device_description, proxy, resolveparamsets=False):
529572
super().__init__(device_description, proxy, resolveparamsets)
530573

531574
# init metadata
532-
self.BINARYNODE.update({"PRESENCE_DETECTION_STATE": [1]})
533-
self.SENSORNODE.update({"ILLUMINATION": [1]})
575+
self.BINARYNODE.update({"PRESENCE_DETECTION_STATE": self.ELEMENT,
576+
"PRESENCE_DETECTION_ACTIVE": self.ELEMENT})
577+
self.SENSORNODE.update({"ILLUMINATION": self.ELEMENT,
578+
"CURRENT_ILLUMINATION": self.ELEMENT})
534579
self.ATTRIBUTENODE.update({"ERROR_CODE": [0]})
535580

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

544589
@property
545590
def ELEMENT(self):
546-
return [0, 1]
591+
return [1]
547592

548593

549594
class PresenceIPW(SensorHmIPW):
@@ -627,6 +672,16 @@ class IPRemoteMotionV2(Remote, MotionIPV2):
627672
def __init__(self, device_description, proxy, resolveparamsets=False):
628673
super().__init__(device_description, proxy, resolveparamsets)
629674

675+
676+
class IPRemoteMotionV2W(Remote, MotionIPV2W):
677+
"""Wired motion detection with buttons (hm ip).
678+
This is a binary sensor."""
679+
680+
# pylint: disable=useless-super-delegation
681+
def __init__(self, device_description, proxy, resolveparamsets=False):
682+
super().__init__(device_description, proxy, resolveparamsets)
683+
684+
630685
class LuxSensor(SensorHm):
631686
"""Sensor for messure LUX."""
632687

@@ -1215,8 +1270,11 @@ def __init__(self, device_description, proxy, resolveparamsets=False):
12151270
"HM-Sec-MD": MotionV2,
12161271
"HmIP-SMI": MotionIPContactSabotage,
12171272
"HmIP-SMI55": IPRemoteMotionV2,
1273+
"HmIP-SMI55-2": IPRemoteMotionV2,
1274+
"HmIPW-SMI55": IPRemoteMotionV2W,
12181275
"HmIP-SMO": MotionIP,
12191276
"HmIP-SMO-A": MotionIP,
1277+
"HmIP-SMO-2": MotionIP,
12201278
"HmIP-SPI": PresenceIP,
12211279
"HmIPW-SPI": PresenceIPW,
12221280
"HM-Sen-LI-O": LuxSensor,
@@ -1285,4 +1343,5 @@ def __init__(self, device_description, proxy, resolveparamsets=False):
12851343
"HmIP-STE2-PCB": TempModuleSTE2,
12861344
"HmIP-SCTH230": CO2SensorIP,
12871345
"HmIP-DLD": IPLockDLD,
1346+
"HmIP-SFD": ParticulateMatterSensorIP,
12881347
}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def readme():
77

88
PACKAGE_NAME = 'pyhomematic'
99
HERE = os.path.abspath(os.path.dirname(__file__))
10-
VERSION = '0.1.76'
10+
VERSION = '0.1.77'
1111

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

0 commit comments

Comments
 (0)