diff --git a/homeassistant/components/opentherm_gw/__init__.py b/homeassistant/components/opentherm_gw/__init__.py index c6cf14bfdce..71fd104bd2f 100644 --- a/homeassistant/components/opentherm_gw/__init__.py +++ b/homeassistant/components/opentherm_gw/__init__.py @@ -43,6 +43,7 @@ from .const import ( SERVICE_SET_CONTROL_SETPOINT, SERVICE_SET_GPIO_MODE, SERVICE_SET_HOT_WATER_OVRD, + SERVICE_SET_HOT_WATER_SETPOINT, SERVICE_SET_LED_MODE, SERVICE_SET_MAX_MOD, SERVICE_SET_OAT, @@ -145,6 +146,7 @@ def register_services(hass): ), } ) + service_set_hot_water_setpoint_schema = service_set_control_setpoint_schema service_set_hot_water_ovrd_schema = vol.Schema( { vol.Required(ATTR_GW_ID): vol.All( @@ -263,6 +265,21 @@ def register_services(hass): service_set_hot_water_ovrd_schema, ) + async def set_dhw_setpoint(call): + """Set the domestic hot water setpoint on the OpenTherm Gateway.""" + gw_dev = hass.data[DATA_OPENTHERM_GW][DATA_GATEWAYS][call.data[ATTR_GW_ID]] + gw_var = gw_vars.DATA_DHW_SETPOINT + value = await gw_dev.gateway.set_dhw_setpoint(call.data[ATTR_TEMPERATURE]) + gw_dev.status.update({gw_var: value}) + async_dispatcher_send(hass, gw_dev.update_signal, gw_dev.status) + + hass.services.async_register( + DOMAIN, + SERVICE_SET_HOT_WATER_SETPOINT, + set_dhw_setpoint, + service_set_hot_water_setpoint_schema, + ) + async def set_device_clock(call): """Set the clock on the OpenTherm Gateway.""" gw_dev = hass.data[DATA_OPENTHERM_GW][DATA_GATEWAYS][call.data[ATTR_GW_ID]] diff --git a/homeassistant/components/opentherm_gw/const.py b/homeassistant/components/opentherm_gw/const.py index b8d427ba193..14b54366b4a 100644 --- a/homeassistant/components/opentherm_gw/const.py +++ b/homeassistant/components/opentherm_gw/const.py @@ -29,6 +29,7 @@ DOMAIN = "opentherm_gw" SERVICE_RESET_GATEWAY = "reset_gateway" SERVICE_SET_CLOCK = "set_clock" SERVICE_SET_CONTROL_SETPOINT = "set_control_setpoint" +SERVICE_SET_HOT_WATER_SETPOINT = "set_hot_water_setpoint" SERVICE_SET_HOT_WATER_OVRD = "set_hot_water_ovrd" SERVICE_SET_GPIO_MODE = "set_gpio_mode" SERVICE_SET_LED_MODE = "set_led_mode" diff --git a/homeassistant/components/opentherm_gw/services.yaml b/homeassistant/components/opentherm_gw/services.yaml index 227c6d423bc..f60648ee8d4 100644 --- a/homeassistant/components/opentherm_gw/services.yaml +++ b/homeassistant/components/opentherm_gw/services.yaml @@ -52,6 +52,20 @@ set_hot_water_ovrd: state, or "A" to disable the override. example: "1" +set_hot_water_setpoint: + description: > + Set the domestic hot water setpoint on the gateway. + fields: + gateway_id: + description: The gateway_id of the OpenTherm Gateway. + example: "opentherm_gateway" + temperature: + description: > + The domestic hot water setpoint to set on the gateway. Not all boilers support this feature. + Values between 0 and 90 are accepted, but not all boilers support this range. + Check the values of the slave_dhw_min_setp and slave_dhw_max_setp sensors to see the supported range on your boiler. + example: "60" + set_gpio_mode: description: Change the function of the GPIO pins of the gateway. fields: