Skip to content

Commit

Permalink
added HmIP-STE2-PCB
Browse files Browse the repository at this point in the history
closes #386
  • Loading branch information
coreGreenberet committed Apr 5, 2021
1 parent 262e96e commit 935665b
Show file tree
Hide file tree
Showing 10 changed files with 156 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### ADDED
- API
- Devices
- [HmIP-STE2-PCB] (Temperature Difference Sensors - 2x sensors)

## [0.13.1] 2021-01-23

### ADDED
Expand Down Expand Up @@ -420,4 +425,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[HMIP-SRD]: https://github.com/coreGreenberet/homematicip-rest-api/issues/375
[HMIP-WRCC2]: https://github.com/coreGreenberet/homematicip-rest-api/issues/373
[HMIP-DRSI1]: https://github.com/coreGreenberet/homematicip-rest-api/issues/373
[HmIP-STE2-PCB]: https://github.com/coreGreenberet/homematicip-rest-api/issues/386
[activate_absence_permanent]: https://github.com/coreGreenberet/homematicip-rest-api/issues/357
2 changes: 1 addition & 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>--dump-configuration</CommandLineArguments>
<CommandLineArguments>--dump-configuration --config-file homematicip_demo/json_data/home.json</CommandLineArguments>
<InterpreterId>MSBuild|venv|$(MSBuildProjectFullPath)</InterpreterId>
<SuppressConfigureTestFrameworkPrompt>true</SuppressConfigureTestFrameworkPrompt>
<TestFramework>pytest</TestFramework>
Expand Down
1 change: 1 addition & 0 deletions homematicip/aio/class_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
DeviceType.TEMPERATURE_HUMIDITY_SENSOR: AsyncTemperatureHumiditySensorWithoutDisplay,
DeviceType.TEMPERATURE_HUMIDITY_SENSOR_DISPLAY: AsyncTemperatureHumiditySensorDisplay,
DeviceType.TEMPERATURE_HUMIDITY_SENSOR_OUTDOOR: AsyncTemperatureHumiditySensorOutdoor,
DeviceType.TEMPERATURE_SENSOR_2_EXTERNAL_DELTA: AsyncTemperaturDifferenceSensor2,
DeviceType.TILT_VIBRATION_SENSOR: AsyncTiltVibrationSensor,
DeviceType.TORMATIC_MODULE: AsyncGarageDoorModuleTormatic,
DeviceType.WALL_MOUNTED_THERMOSTAT_BASIC_HUMIDITY: AsyncWallMountedThermostatBasicHumidity,
Expand Down
3 changes: 3 additions & 0 deletions homematicip/aio/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,3 +578,6 @@ async def stop(self):

class AsyncRainSensor(RainSensor, AsyncDevice):
""" HMIP-SRD (Rain Sensor) """

class AsyncTemperaturDifferenceSensor2(TemperaturDifferenceSensor2, AsyncDevice):
""" HmIP-STE2-PCB (Temperature Difference Sensors - 2x sensors) """
2 changes: 2 additions & 0 deletions homematicip/base/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ class DeviceType(AutoNameEnum):
TEMPERATURE_HUMIDITY_SENSOR = auto()
TEMPERATURE_HUMIDITY_SENSOR_DISPLAY = auto()
TEMPERATURE_HUMIDITY_SENSOR_OUTDOOR = auto()
TEMPERATURE_SENSOR_2_EXTERNAL_DELTA = auto()
TILT_VIBRATION_SENSOR = auto()
TORMATIC_MODULE = auto()
WALL_MOUNTED_THERMOSTAT_BASIC_HUMIDITY = auto()
Expand Down Expand Up @@ -436,6 +437,7 @@ class FunctionalChannelType(AutoNameEnum):
SMOKE_DETECTOR_CHANNEL = auto()
SWITCH_CHANNEL = auto()
SWITCH_MEASURING_CHANNEL = auto()
TEMPERATURE_SENSOR_2_EXTERNAL_DELTA_CHANNEL = auto()
TILT_VIBRATION_SENSOR_CHANNEL = auto()
WALL_MOUNTED_THERMOSTAT_PRO_CHANNEL = auto()
WALL_MOUNTED_THERMOSTAT_WITHOUT_DISPLAY_CHANNEL = auto()
Expand Down
17 changes: 17 additions & 0 deletions homematicip/base/functionalChannels.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,3 +996,20 @@ def from_json(self, js, groups: Iterable[Group]):
super().from_json(js, groups)
self.set_attr_from_dict("rainSensorSensitivity", js)
self.set_attr_from_dict("raining", js)

class TemperaturDifferenceSensor2Channel(FunctionalChannel):
""" this is the representative of the TEMPERATURE_SENSOR_2_EXTERNAL_DELTA_CHANNEL channel """

def __init__(self, connection):
super().__init__(connection)
#:float:
self.temperatureExternalDelta = 0.0
#:float:
self.temperatureExternalOne = 0.0
#:float:
self.temperatureExternalTwo = 0.0
def from_json(self, js, groups: Iterable[Group]):
super().from_json(js, groups)
self.set_attr_from_dict("temperatureExternalDelta", js)
self.set_attr_from_dict("temperatureExternalOne", js)
self.set_attr_from_dict("temperatureExternalTwo", js)
2 changes: 2 additions & 0 deletions homematicip/class_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
DeviceType.TEMPERATURE_HUMIDITY_SENSOR: TemperatureHumiditySensorWithoutDisplay,
DeviceType.TEMPERATURE_HUMIDITY_SENSOR_DISPLAY: TemperatureHumiditySensorDisplay,
DeviceType.TEMPERATURE_HUMIDITY_SENSOR_OUTDOOR: TemperatureHumiditySensorOutdoor,
DeviceType.TEMPERATURE_SENSOR_2_EXTERNAL_DELTA: TemperaturDifferenceSensor2,
DeviceType.TILT_VIBRATION_SENSOR: TiltVibrationSensor,
DeviceType.TORMATIC_MODULE: GarageDoorModuleTormatic,
DeviceType.WALL_MOUNTED_THERMOSTAT_PRO: WallMountedThermostatPro,
Expand Down Expand Up @@ -189,6 +190,7 @@
FunctionalChannelType.SMOKE_DETECTOR_CHANNEL: SmokeDetectorChannel,
FunctionalChannelType.SWITCH_CHANNEL: SwitchChannel,
FunctionalChannelType.SWITCH_MEASURING_CHANNEL: SwitchMeasuringChannel,
FunctionalChannelType.TEMPERATURE_SENSOR_2_EXTERNAL_DELTA_CHANNEL: TemperaturDifferenceSensor2Channel,
FunctionalChannelType.TILT_VIBRATION_SENSOR_CHANNEL: TiltVibrationSensorChannel,
FunctionalChannelType.WALL_MOUNTED_THERMOSTAT_PRO_CHANNEL: WallMountedThermostatProChannel,
FunctionalChannelType.WALL_MOUNTED_THERMOSTAT_WITHOUT_DISPLAY_CHANNEL: WallMountedThermostatWithoutDisplayChannel,
Expand Down
25 changes: 23 additions & 2 deletions homematicip/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -2052,9 +2052,9 @@ class RainSensor(Device):

def __init__(self, connection):
super().__init__(connection)
#:float:
self.raining = False
#:bool:
self.raining = False
#:float:
self.rainSensorSensitivity = 0.0

def from_json(self, js):
Expand All @@ -2063,3 +2063,24 @@ def from_json(self, js):
if c:
self.set_attr_from_dict("rainSensorSensitivity", c)
self.set_attr_from_dict("raining", c)


class TemperaturDifferenceSensor2(Device):
""" HmIP-STE2-PCB (Temperature Difference Sensors - 2x sensors) """

def __init__(self, connection):
super().__init__(connection)
#:float:
self.temperatureExternalDelta = 0.0
#:float:
self.temperatureExternalOne = 0.0
#:float:
self.temperatureExternalTwo = 0.0

def from_json(self, js):
super().from_json(js)
c = get_functional_channel("TEMPERATURE_SENSOR_2_EXTERNAL_DELTA_CHANNEL", js)
if c:
self.set_attr_from_dict("temperatureExternalDelta", c)
self.set_attr_from_dict("temperatureExternalOne", c)
self.set_attr_from_dict("temperatureExternalTwo", c)
88 changes: 88 additions & 0 deletions homematicip_demo/json_data/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,94 @@
"type": "FULL_FLUSH_INPUT_SWITCH",
"updateState": "UP_TO_DATE"
},
"3014F711000HmIP-STE2-PCB": {
"availableFirmwareVersion": "0.0.0",
"connectionType": "HMIP_RF",
"firmwareVersion": "1.0.18",
"firmwareVersionInteger": 65554,
"functionalChannels": {
"0": {
"busConfigMismatch": null,
"coProFaulty": false,
"coProRestartNeeded": false,
"coProUpdateFailure": false,
"configPending": false,
"deviceId": "3014F711000HmIP-STE2-PCB",
"deviceOverheated": false,
"deviceOverloaded": false,
"devicePowerFailureDetected": false,
"deviceUndervoltage": false,
"dutyCycle": false,
"functionalChannelType": "DEVICE_BASE",
"groupIndex": 0,
"groups": [],
"index": 0,
"label": "",
"lowBat": false,
"mountingOrientation": null,
"multicastRoutingEnabled": false,
"particulateMatterSensorCommunicationError": null,
"particulateMatterSensorError": null,
"powerShortCircuit": null,
"routerModuleEnabled": false,
"routerModuleSupported": false,
"rssiDeviceValue": -61,
"rssiPeerValue": null,
"shortCircuitDataLine": null,
"supportedOptionalFeatures": {
"IFeatureBusConfigMismatch": false,
"IFeatureDeviceCoProError": false,
"IFeatureDeviceCoProRestart": false,
"IFeatureDeviceCoProUpdate": false,
"IFeatureDeviceIdentify": false,
"IFeatureDeviceOverheated": false,
"IFeatureDeviceOverloaded": false,
"IFeatureDeviceParticulateMatterSensorCommunicationError": false,
"IFeatureDeviceParticulateMatterSensorError": false,
"IFeatureDevicePowerFailure": false,
"IFeatureDeviceTemperatureHumiditySensorCommunicationError": false,
"IFeatureDeviceTemperatureHumiditySensorError": false,
"IFeatureDeviceTemperatureOutOfRange": false,
"IFeatureDeviceUndervoltage": false,
"IFeatureMulticastRouter": false,
"IFeaturePowerShortCircuit": false,
"IFeatureRssiValue": true,
"IFeatureShortCircuitDataLine": false,
"IOptionalFeatureDutyCycle": true,
"IOptionalFeatureLowBat": true,
"IOptionalFeatureMountingOrientation": false
},
"temperatureHumiditySensorCommunicationError": null,
"temperatureHumiditySensorError": null,
"temperatureOutOfRange": false,
"unreach": false
},
"1": {
"deviceId": "3014F711000HmIP-STE2-PCB",
"functionalChannelType": "TEMPERATURE_SENSOR_2_EXTERNAL_DELTA_CHANNEL",
"groupIndex": 1,
"groups": [],
"index": 1,
"label": "",
"temperatureExternalDelta": -0.3,
"temperatureExternalOne": 37.8,
"temperatureExternalTwo": 38.1
}
},
"homeId": "00000000-0000-0000-0000-000000000001",
"id": "3014F711000HmIP-STE2-PCB",
"label": "Temperatursensor Speicher",
"lastStatusUpdate": 1613049207162,
"liveUpdateState": "LIVE_UPDATE_NOT_SUPPORTED",
"manufacturerCode": 1,
"modelId": 415,
"modelType": "HmIP-STE2-PCB",
"oem": "eQ-3",
"permanentlyReachable": false,
"serializedGlobalTradeItemNumber": "3014F711000HmIP-STE2-PCB",
"type": "TEMPERATURE_SENSOR_2_EXTERNAL_DELTA",
"updateState": "UP_TO_DATE"
},
"3014F7110000000HOERMANN": {
"availableFirmwareVersion": "0.0.0",
"connectionType": "HMIP_RF",
Expand Down
13 changes: 13 additions & 0 deletions tests/test_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -1367,3 +1367,16 @@ def test_din_rail_switch(fake_home: Home):
"profileMode(None) userDesiredProfileMode(AUTOMATIC) on(None) profileMode(None) "
"userDesiredProfileMode(AUTOMATIC)"
)

def test_temperatur_sensor_2_delta(fake_home: Home):
d = fake_home.search_device_by_id("3014F711000HmIP-STE2-PCB")
assert isinstance(d, TemperaturDifferenceSensor2)
assert d.temperatureExternalDelta == -0.3
assert d.temperatureExternalOne == 37.8
assert d.temperatureExternalTwo == 38.1

assert str(d) == (
"HmIP-STE2-PCB Temperatursensor Speicher lowBat(False) unreach(False) "
"rssiDeviceValue(-61) rssiPeerValue(None) configPending(False) dutyCycle(False) "
"temperatureExternalDelta(-0.3) temperatureExternalOne(37.8) temperatureExternalTwo(38.1)"
)

0 comments on commit 935665b

Please sign in to comment.