From 91c91cbfb6b283f2a5815d33f3e7396535ad0f31 Mon Sep 17 00:00:00 2001 From: Daniel Perna Date: Fri, 17 Apr 2020 00:06:48 +0200 Subject: [PATCH] 0.1.66 (#298) * Bump version * add HmIP-PMFS Power Outage Detector (#291) while on power key=POWER_MAINS_FAILURE stays False, on power outage it changes to True. * Add support for HmIP-DRSI4 * Add support for HmIP-WRCD (#293) * FIx Attributeerrors (#294) * Fix turning off homematic ip thermostats (#295) The control mode has to be set to manual after setting the temperature to the off value. * Update changelog Co-authored-by: Klaus Co-authored-by: macrojames <482151+macrojames@users.noreply.github.com> Co-authored-by: pg5 --- changelog.txt | 7 +++++++ pyhomematic/devicetypes/actors.py | 12 ++++++++++- pyhomematic/devicetypes/misc.py | 3 +++ pyhomematic/devicetypes/sensors.py | 28 ++++++++++++++++++++++++++ pyhomematic/devicetypes/thermostats.py | 8 ++++++-- setup.py | 2 +- 6 files changed, 56 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 92a53c59e..b31332c41 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ +Version 0.1.66 (2020-04-17) +- Add support for HmIP-DRSI4 @danielperna84 +- Add support for HmIP-PMFS @k-laus +- Add support for HmIP-WRCD @macrojames +- Fix attribute errors @macrojames +- Fix HmIP Thermostats @pg5 + Version 0.1.65 (2020-02-20) - Add support for HmIP-DRBLI4 @danielperna84 - Add support for HmIP-WTH-B @srehlig diff --git a/pyhomematic/devicetypes/actors.py b/pyhomematic/devicetypes/actors.py index cde47c890..1e3978226 100644 --- a/pyhomematic/devicetypes/actors.py +++ b/pyhomematic/devicetypes/actors.py @@ -76,10 +76,16 @@ def ELEMENT(self): return [3] -class IPKeyBlind(KeyBlind): +class IPKeyBlind(IPBlind, HelperActionPress): """ Blind switch that raises and lowers homematic ip roller shutters or window blinds. """ + def __init__(self, device_description, proxy, resolveparamsets=False): + super().__init__(device_description, proxy, resolveparamsets) + + # init metadata + self.EVENTNODE.update({"PRESS_SHORT": [1, 2], + "PRESS_LONG": [1, 2]}) @property def ELEMENT(self): @@ -389,6 +395,8 @@ def ELEMENT(self): return [2] elif "HmIP-MOD-OC8" in self.TYPE: return [10, 14, 18, 22, 26, 30, 34, 38] + elif "HmIP-DRSI4" in self.TYPE: + return [6, 10, 14, 18] else: return [3] @@ -873,7 +881,9 @@ def set_color_temp(self, color_temp: float, channel=None): "HmIP-PS-UK": IPSwitch, "HmIP-PCBS": IPSwitch, "HmIP-PCBS-BAT": IPSwitch, + "HmIP-PMFS": IPSwitch, "HmIP-MOD-OC8": IPSwitch, + "HmIP-DRSI4": IPSwitch, "HmIP-BSL": IPKeySwitchLevel, "HMIP-PSM": IPSwitchPowermeter, "HmIP-PSM": IPSwitchPowermeter, diff --git a/pyhomematic/devicetypes/misc.py b/pyhomematic/devicetypes/misc.py index e3bed17ea..7659d61ca 100644 --- a/pyhomematic/devicetypes/misc.py +++ b/pyhomematic/devicetypes/misc.py @@ -56,6 +56,8 @@ def ELEMENT(self): return [1, 2, 3, 4] if "HmIP-RC8" in self.TYPE: return [1, 2, 3, 4, 5, 6, 7, 8] + if "HmIP-WRCD" in self.TYPE: + return [1, 2, 3] return [1] @@ -138,6 +140,7 @@ def ELEMENT(self): "HmIP-WRC2": RemoteBatteryIP, "HmIP-BRC2": Remote, "HmIP-WRC6": RemoteBatteryIP, + "HmIP-WRCD": RemoteBatteryIP, "HmIP-KRCA": Remote, "HmIP-KRC4": Remote, "HM-SwI-3-FM": RemotePress, diff --git a/pyhomematic/devicetypes/sensors.py b/pyhomematic/devicetypes/sensors.py index 12c454e65..c219f15c0 100644 --- a/pyhomematic/devicetypes/sensors.py +++ b/pyhomematic/devicetypes/sensors.py @@ -63,6 +63,17 @@ class SensorHmIPNoVoltage(HMSensor, HelperRssiDevice, HelperLowBatIP): - low battery status (HelperLowBatIP) - but no voltage of batteries""" +class SensorHmIPNoBattery(HMSensor, HelperRssiDevice): + """Some Homematic IP sensors have + - strength of the signal received by the CCU (HelperRssiDevice). + Be aware that HMIP devices have a reversed understanding of PEER + and DEVICE compared to standard HM devices. + - strength of the signal received by the device (HelperRssiPeer). + Be aware that standard HMIP devices have a reversed understanding of PEER + and DEVICE compared to standard HM devices. + - low battery status (HelperLowBatIP) + - but no voltage of batteries""" + class ShutterContact(SensorHm, HelperBinaryState, HelperSabotage): """Door / Window contact that emits its open/closed state. @@ -552,6 +563,23 @@ def get_humidity(self, channel=None): return int(self.getSensorData("HUMIDITY", channel)) +class IPAreaThermostatNoBattery(SensorHmIPNoBattery): + """Wall mount thermostat without battery.""" + + def __init__(self, device_description, proxy, resolveparamsets=False): + super().__init__(device_description, proxy, resolveparamsets) + + # init metadata + self.SENSORNODE.update({"ACTUAL_TEMPERATURE": [1], + "HUMIDITY": [1]}) + + def get_temperature(self, channel=None): + return float(self.getSensorData("ACTUAL_TEMPERATURE", channel)) + + def get_humidity(self, channel=None): + return int(self.getSensorData("HUMIDITY", channel)) + + class TemperatureSensor(SensorHm): """Temperature Sensor.""" diff --git a/pyhomematic/devicetypes/thermostats.py b/pyhomematic/devicetypes/thermostats.py index d3a980517..9d6719774 100644 --- a/pyhomematic/devicetypes/thermostats.py +++ b/pyhomematic/devicetypes/thermostats.py @@ -1,6 +1,6 @@ import logging from pyhomematic.devicetypes.generic import HMDevice -from pyhomematic.devicetypes.sensors import AreaThermostat, IPAreaThermostat +from pyhomematic.devicetypes.sensors import AreaThermostat, IPAreaThermostat, IPAreaThermostatNoBattery from pyhomematic.devicetypes.helper import HelperValveState, HelperBatteryState, HelperLowBat, HelperLowBatIP, HelperRssiPeer, HelperRssiDevice LOG = logging.getLogger(__name__) @@ -282,6 +282,7 @@ def MODE(self, setmode): def turnoff(self): """ Turn off Thermostat. """ self.writeNodeData("SET_POINT_TEMPERATURE", self.OFF_VALUE) + self.actionNodeData('CONTROL_MODE', self.MANU_MODE) class IPThermostatWall(HMThermostat, IPAreaThermostat, HelperRssiDevice, HelperLowBatIP): """ @@ -317,8 +318,9 @@ def set_temperature(self, target_temperature): def turnoff(self): """ Turn off Thermostat. """ self.writeNodeData("SET_POINT_TEMPERATURE", self.OFF_VALUE) + self.actionNodeData('CONTROL_MODE', self.MANU_MODE) -class IPThermostatWall230V(HMThermostat, IPAreaThermostat, HelperRssiDevice): +class IPThermostatWall230V(HMThermostat, IPAreaThermostatNoBattery, HelperRssiDevice): """ HmIP-BWTH, HmIP-BWTH24 ClimateControl-Wall Thermostat that measures temperature and allows to set a target temperature or use some automatic mode. @@ -371,6 +373,7 @@ def MODE(self, setmode): def turnoff(self): """ Turn off Thermostat. """ self.writeNodeData("SET_POINT_TEMPERATURE", self.OFF_VALUE) + self.actionNodeData('CONTROL_MODE', self.MANU_MODE) class IPThermostatWall2(HMThermostat, IPAreaThermostat, HelperRssiDevice, HelperLowBatIP): """ @@ -427,6 +430,7 @@ def MODE(self, setmode): def turnoff(self): """ Turn off Thermostat. """ self.writeNodeData("SET_POINT_TEMPERATURE", self.OFF_VALUE) + self.actionNodeData('CONTROL_MODE', self.MANU_MODE) DEVICETYPES = { diff --git a/setup.py b/setup.py index 0519a7b5d..86b12de62 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ def readme(): PACKAGE_NAME = 'pyhomematic' HERE = os.path.abspath(os.path.dirname(__file__)) -VERSION = '0.1.65' +VERSION = '0.1.66' PACKAGES = find_packages(exclude=['tests', 'tests.*', 'dist', 'build'])