Skip to content
2 changes: 1 addition & 1 deletion homeassistant/components/homematicip_cloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .device import HomematicipGenericDevice # noqa: F401
from .hap import HomematicipAuth, HomematicipHAP # noqa: F401

REQUIREMENTS = ['homematicip==0.10.4']
REQUIREMENTS = ['homematicip==0.10.5']

_LOGGER = logging.getLogger(__name__)

Expand Down
44 changes: 39 additions & 5 deletions homeassistant/components/homematicip_cloud/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
import logging

from homeassistant.components.homematicip_cloud import (
HMIPC_HAPID, HomematicipGenericDevice)
from homeassistant.components.homematicip_cloud import DOMAIN as HMIPC_DOMAIN
DOMAIN as HMIPC_DOMAIN, HMIPC_HAPID, HomematicipGenericDevice)
from homeassistant.const import (
DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_ILLUMINANCE, DEVICE_CLASS_TEMPERATURE,
TEMP_CELSIUS)
DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS)

_LOGGER = logging.getLogger(__name__)

Expand All @@ -36,7 +35,9 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
AsyncHeatingThermostat, AsyncTemperatureHumiditySensorWithoutDisplay,
AsyncTemperatureHumiditySensorDisplay, AsyncMotionDetectorIndoor,
AsyncTemperatureHumiditySensorOutdoor,
AsyncMotionDetectorPushButton)
AsyncMotionDetectorPushButton, AsyncLightSensor,
AsyncPlugableSwitchMeasuring, AsyncBrandSwitchMeasuring,
AsyncFullFlushSwitchMeasuring)

home = hass.data[HMIPC_DOMAIN][config_entry.data[HMIPC_HAPID]].home
devices = [HomematicipAccesspointStatus(home)]
Expand All @@ -51,6 +52,12 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
if isinstance(device, (AsyncMotionDetectorIndoor,
AsyncMotionDetectorPushButton)):
devices.append(HomematicipIlluminanceSensor(home, device))
if isinstance(device, AsyncLightSensor):
devices.append(HomematicipLightSensor(home, device))
if isinstance(device, (AsyncPlugableSwitchMeasuring,
AsyncBrandSwitchMeasuring,
AsyncFullFlushSwitchMeasuring)):
devices.append(HomematicipPowerSensor(home, device))

if devices:
async_add_entities(devices)
Expand Down Expand Up @@ -184,3 +191,30 @@ def state(self):
def unit_of_measurement(self):
"""Return the unit this state is expressed in."""
return 'lx'


class HomematicipLightSensor(HomematicipIlluminanceSensor):
"""Represenation of a HomematicIP Illuminance device."""

@property
def state(self):
"""Return the state."""
return self._device.averageIllumination


class HomematicipPowerSensor(HomematicipGenericDevice):
"""Represenation of a HomematicIP power measuring device."""

def __init__(self, home, device):
"""Initialize the device."""
super().__init__(home, device, 'Power')

@property
def state(self):
"""Represenation of the HomematicIP power comsumption value."""
return self._device.currentPowerConsumption

@property
def unit_of_measurement(self):
"""Return the unit this state is expressed in."""
return 'W'
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ homeassistant-pyozw==0.1.2
homekit==0.12.2

# homeassistant.components.homematicip_cloud
homematicip==0.10.4
homematicip==0.10.5

# homeassistant.components.google
# homeassistant.components.remember_the_milk
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ home-assistant-frontend==20190203.0
homekit==0.12.2

# homeassistant.components.homematicip_cloud
homematicip==0.10.4
homematicip==0.10.5

# homeassistant.components.influxdb
# homeassistant.components.sensor.influxdb
Expand Down