Skip to content

Commit

Permalink
Add integration for Vallox Ventilation Units.
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-richter committed Jun 20, 2019
1 parent d7fcb52 commit 7ce5051
Show file tree
Hide file tree
Showing 9 changed files with 643 additions and 0 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Expand Up @@ -652,6 +652,7 @@ omit =
homeassistant/components/uptimerobot/binary_sensor.py
homeassistant/components/uscis/sensor.py
homeassistant/components/usps/*
homeassistant/components/vallox/*
homeassistant/components/vasttrafik/sensor.py
homeassistant/components/velbus/*
homeassistant/components/velux/*
Expand Down
31 changes: 31 additions & 0 deletions homeassistant/components/fan/services.yaml
Expand Up @@ -211,3 +211,34 @@ wemo_reset_filter_life:
entity_id:
description: Names of the WeMo humidifier entities (1 or more entity_ids are required).
example: 'fan.wemo_humidifier'

vallox_set_profile_fan_speed_home:
description: Set the fan speed of the Home profile.
fields:
entity_id:
description: Name of the vallox fan entity.
example: 'fan.vallox'
fan_speed:
description: Fan speed in %. Integer, between 0 and 100.
example: 50


vallox_set_profile_fan_speed_away:
description: Set the fan speed of the Away profile.
fields:
entity_id:
description: Name of the vallox fan entity.
example: 'fan.vallox'
fan_speed:
description: Fan speed in %. Integer, between 0 and 100.
example: 25

vallox_set_profile_fan_speed_boost:
description: Set the fan speed of the Boost profile.
fields:
entity_id:
description: Name of the vallox fan entity.
example: 'fan.vallox'
fan_speed:
description: Fan speed in %. Integer, between 0 and 100.
example: 65
80 changes: 80 additions & 0 deletions homeassistant/components/vallox/__init__.py
@@ -0,0 +1,80 @@
"""Support for Vallox ventilation units."""

import ipaddress
import logging

import voluptuous as vol

from homeassistant.const import CONF_HOST, CONF_NAME, CONF_SENSORS
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv

_LOGGER = logging.getLogger(__name__)

DOMAIN = 'vallox'
DEFAULT_NAME = 'Vallox'

MODE_METRIC_KEY = 'A_CYC_MODE'

DATA_VALLOX_SENSOR_LIST = 'vallox_sensor_list'

# List of implemented sensors.
SENSOR_FAN_SPEED = 'fan_speed'
SENSOR_TEMP_EXTRACT_AIR = 'temp_extract_air'
SENSOR_TEMP_EXHAUST_AIR = 'temp_exhaust_air'
SENSOR_TEMP_OUTDOOR_AIR = 'temp_outdoor_air'
SENSOR_TEMP_SUPPLY_AIR = 'temp_supply_air'
SENSOR_HUMIDITY = 'humidity'
SENSOR_REMAINING_TIME_FILTER = 'remaining_time_filter'

SENSORS = [
SENSOR_FAN_SPEED,
SENSOR_TEMP_EXTRACT_AIR,
SENSOR_TEMP_EXHAUST_AIR,
SENSOR_TEMP_OUTDOOR_AIR,
SENSOR_TEMP_SUPPLY_AIR,
SENSOR_HUMIDITY,
SENSOR_REMAINING_TIME_FILTER
]

CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(CONF_HOST): vol.All(ipaddress.ip_address, cv.string),
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_SENSORS): vol.All(cv.ensure_list, [vol.In(SENSORS)]),
}),
}, extra=vol.ALLOW_EXTRA)


async def async_setup(hass, config):
"""Set up the client and boot the platforms."""
from vallox_websocket_api import Vallox

if DOMAIN not in config:
return True

conf = config[DOMAIN]
host = conf.get(CONF_HOST)
name = conf.get(CONF_NAME)

vallox_client = Vallox(host)

hass.data[DOMAIN] = {
'client': vallox_client,
'name': name
}

sensor_list = conf.get(CONF_SENSORS)
hass.data[DATA_VALLOX_SENSOR_LIST] = sensor_list

# Case for having a "sensors:" entry in the configuration.
if sensor_list is not None:
# If the list is empty, add all sensors by default.
if not sensor_list:
sensor_list = SENSORS

await discovery.async_load_platform(hass, 'sensor', DOMAIN, {}, config)

await discovery.async_load_platform(hass, 'fan', DOMAIN, {}, config)

return True

0 comments on commit 7ce5051

Please sign in to comment.