mirror of
https://github.com/home-assistant/core
synced 2024-08-31 05:57:13 +02:00
Add vicare fuelcell (#47167)
This commit is contained in:
parent
c7584a1f92
commit
96857b7466
@ -3,6 +3,7 @@ import enum
|
||||
import logging
|
||||
|
||||
from PyViCare.PyViCareDevice import Device
|
||||
from PyViCare.PyViCareFuelCell import FuelCell
|
||||
from PyViCare.PyViCareGazBoiler import GazBoiler
|
||||
from PyViCare.PyViCareHeatPump import HeatPump
|
||||
import voluptuous as vol
|
||||
@ -38,6 +39,7 @@ class HeatingType(enum.Enum):
|
||||
generic = "generic"
|
||||
gas = "gas"
|
||||
heatpump = "heatpump"
|
||||
fuelcell = "fuelcell"
|
||||
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema(
|
||||
@ -77,6 +79,8 @@ def setup(hass, config):
|
||||
vicare_api = GazBoiler(conf[CONF_USERNAME], conf[CONF_PASSWORD], **params)
|
||||
elif heating_type == HeatingType.heatpump:
|
||||
vicare_api = HeatPump(conf[CONF_USERNAME], conf[CONF_PASSWORD], **params)
|
||||
elif heating_type == HeatingType.fuelcell:
|
||||
vicare_api = FuelCell(conf[CONF_USERNAME], conf[CONF_PASSWORD], **params)
|
||||
else:
|
||||
vicare_api = Device(conf[CONF_USERNAME], conf[CONF_PASSWORD], **params)
|
||||
except AttributeError:
|
||||
|
@ -85,6 +85,7 @@ SENSORS_BY_HEATINGTYPE = {
|
||||
SENSOR_HEATINGROD_LEVEL2,
|
||||
SENSOR_HEATINGROD_LEVEL3,
|
||||
],
|
||||
HeatingType.fuelcell: [SENSOR_BURNER_ACTIVE],
|
||||
}
|
||||
|
||||
|
||||
|
@ -111,7 +111,7 @@ async def async_setup_platform(
|
||||
{
|
||||
vol.Required(SERVICE_SET_VICARE_MODE_ATTR_MODE): vol.In(
|
||||
VICARE_TO_HA_HVAC_HEATING
|
||||
),
|
||||
)
|
||||
},
|
||||
"set_vicare_mode",
|
||||
)
|
||||
|
@ -9,8 +9,10 @@ from homeassistant.const import (
|
||||
CONF_ICON,
|
||||
CONF_NAME,
|
||||
CONF_UNIT_OF_MEASUREMENT,
|
||||
DEVICE_CLASS_ENERGY,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
ENERGY_KILO_WATT_HOUR,
|
||||
ENERGY_WATT_HOUR,
|
||||
PERCENTAGE,
|
||||
TEMP_CELSIUS,
|
||||
TIME_HOURS,
|
||||
@ -59,6 +61,13 @@ SENSOR_COMPRESSOR_HOURS_LOADCLASS3 = "compressor_hours_loadclass3"
|
||||
SENSOR_COMPRESSOR_HOURS_LOADCLASS4 = "compressor_hours_loadclass4"
|
||||
SENSOR_COMPRESSOR_HOURS_LOADCLASS5 = "compressor_hours_loadclass5"
|
||||
|
||||
# fuelcell sensors
|
||||
SENSOR_POWER_PRODUCTION_CURRENT = "power_production_current"
|
||||
SENSOR_POWER_PRODUCTION_TODAY = "power_production_today"
|
||||
SENSOR_POWER_PRODUCTION_THIS_WEEK = "power_production_this_week"
|
||||
SENSOR_POWER_PRODUCTION_THIS_MONTH = "power_production_this_month"
|
||||
SENSOR_POWER_PRODUCTION_THIS_YEAR = "power_production_this_year"
|
||||
|
||||
SENSOR_TYPES = {
|
||||
SENSOR_OUTSIDE_TEMPERATURE: {
|
||||
CONF_NAME: "Outside Temperature",
|
||||
@ -216,6 +225,42 @@ SENSOR_TYPES = {
|
||||
CONF_GETTER: lambda api: api.getReturnTemperature(),
|
||||
CONF_DEVICE_CLASS: DEVICE_CLASS_TEMPERATURE,
|
||||
},
|
||||
# fuelcell sensors
|
||||
SENSOR_POWER_PRODUCTION_CURRENT: {
|
||||
CONF_NAME: "Power production current",
|
||||
CONF_ICON: None,
|
||||
CONF_UNIT_OF_MEASUREMENT: ENERGY_WATT_HOUR,
|
||||
CONF_GETTER: lambda api: api.getPowerProductionCurrent(),
|
||||
CONF_DEVICE_CLASS: DEVICE_CLASS_ENERGY,
|
||||
},
|
||||
SENSOR_POWER_PRODUCTION_TODAY: {
|
||||
CONF_NAME: "Power production today",
|
||||
CONF_ICON: None,
|
||||
CONF_UNIT_OF_MEASUREMENT: ENERGY_KILO_WATT_HOUR,
|
||||
CONF_GETTER: lambda api: api.getPowerProductionToday(),
|
||||
CONF_DEVICE_CLASS: DEVICE_CLASS_ENERGY,
|
||||
},
|
||||
SENSOR_POWER_PRODUCTION_THIS_WEEK: {
|
||||
CONF_NAME: "Power production this week",
|
||||
CONF_ICON: None,
|
||||
CONF_UNIT_OF_MEASUREMENT: ENERGY_KILO_WATT_HOUR,
|
||||
CONF_GETTER: lambda api: api.getPowerProductionThisWeek(),
|
||||
CONF_DEVICE_CLASS: DEVICE_CLASS_ENERGY,
|
||||
},
|
||||
SENSOR_POWER_PRODUCTION_THIS_MONTH: {
|
||||
CONF_NAME: "Power production this month",
|
||||
CONF_ICON: None,
|
||||
CONF_UNIT_OF_MEASUREMENT: ENERGY_KILO_WATT_HOUR,
|
||||
CONF_GETTER: lambda api: api.getPowerProductionThisMonth(),
|
||||
CONF_DEVICE_CLASS: DEVICE_CLASS_ENERGY,
|
||||
},
|
||||
SENSOR_POWER_PRODUCTION_THIS_YEAR: {
|
||||
CONF_NAME: "Power production this year",
|
||||
CONF_ICON: None,
|
||||
CONF_UNIT_OF_MEASUREMENT: ENERGY_KILO_WATT_HOUR,
|
||||
CONF_GETTER: lambda api: api.getPowerProductionThisYear(),
|
||||
CONF_DEVICE_CLASS: DEVICE_CLASS_ENERGY,
|
||||
},
|
||||
}
|
||||
|
||||
SENSORS_GENERIC = [SENSOR_OUTSIDE_TEMPERATURE, SENSOR_SUPPLY_TEMPERATURE]
|
||||
@ -245,6 +290,27 @@ SENSORS_BY_HEATINGTYPE = {
|
||||
SENSOR_COMPRESSOR_HOURS_LOADCLASS5,
|
||||
SENSOR_RETURN_TEMPERATURE,
|
||||
],
|
||||
HeatingType.fuelcell: [
|
||||
# gas
|
||||
SENSOR_BOILER_TEMPERATURE,
|
||||
SENSOR_BURNER_HOURS,
|
||||
SENSOR_BURNER_MODULATION,
|
||||
SENSOR_BURNER_STARTS,
|
||||
SENSOR_DHW_GAS_CONSUMPTION_TODAY,
|
||||
SENSOR_DHW_GAS_CONSUMPTION_THIS_WEEK,
|
||||
SENSOR_DHW_GAS_CONSUMPTION_THIS_MONTH,
|
||||
SENSOR_DHW_GAS_CONSUMPTION_THIS_YEAR,
|
||||
SENSOR_GAS_CONSUMPTION_TODAY,
|
||||
SENSOR_GAS_CONSUMPTION_THIS_WEEK,
|
||||
SENSOR_GAS_CONSUMPTION_THIS_MONTH,
|
||||
SENSOR_GAS_CONSUMPTION_THIS_YEAR,
|
||||
# fuel cell
|
||||
SENSOR_POWER_PRODUCTION_CURRENT,
|
||||
SENSOR_POWER_PRODUCTION_TODAY,
|
||||
SENSOR_POWER_PRODUCTION_THIS_WEEK,
|
||||
SENSOR_POWER_PRODUCTION_THIS_MONTH,
|
||||
SENSOR_POWER_PRODUCTION_THIS_YEAR,
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user