Merge pull request #12357 from kamiKAC/development

Add Opentherm ot_dhw command (enable disable DHW)
This commit is contained in:
Theo Arends 2021-06-13 11:22:20 +02:00 committed by GitHub
commit 766af2ac99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 2 deletions

View File

@ -465,15 +465,20 @@ uint8_t sns_opentherm_read_flags(char *data, uint32_t len)
// and "ot_ch" is "1", boiler will keep heating
#define D_CMND_SET_CENTRAL_HEATING_ENABLED "ch"
// Get/Set boiler status m_enableHotWater value. It's equivalent of the EnableHotWater settings
// flag value, however, this command does not update the settings.
#define D_CMND_SET_HOT_WATER_ENABLED "dhw"
const char kOpenThermCommands[] PROGMEM = D_PRFX_OTHERM "|" D_CMND_OTHERM_BOILER_SETPOINT "|" D_CMND_OTHERM_DHW_SETPOINT
"|" D_CMND_OTHERM_SAVE_SETTINGS "|" D_CMND_OTHERM_FLAGS "|" D_CMND_SET_CENTRAL_HEATING_ENABLED;
"|" D_CMND_OTHERM_SAVE_SETTINGS "|" D_CMND_OTHERM_FLAGS "|" D_CMND_SET_CENTRAL_HEATING_ENABLED "|" D_CMND_SET_HOT_WATER_ENABLED;
void (*const OpenThermCommands[])(void) PROGMEM = {
&sns_opentherm_boiler_setpoint_cmd,
&sns_opentherm_hot_water_setpoint_cmd,
&sns_opentherm_save_settings_cmd,
&sns_opentherm_flags_cmd,
&sns_opentherm_set_central_heating_cmd};
&sns_opentherm_set_central_heating_cmd,
&sns_opentherm_set_hot_water_cmd};
void sns_opentherm_cmd(void) { }
void sns_opentherm_boiler_setpoint_cmd(void)
@ -537,6 +542,16 @@ void sns_opentherm_set_central_heating_cmd(void)
ResponseCmndNumber(sns_ot_boiler_status.m_enableCentralHeating ? 1 : 0);
}
void sns_opentherm_set_hot_water_cmd(void)
{
bool query = strlen(XdrvMailbox.data) == 0;
if (!query)
{
sns_ot_boiler_status.m_enableHotWater = atoi(XdrvMailbox.data);
}
ResponseCmndNumber(sns_ot_boiler_status.m_enableHotWater ? 1 : 0);
}
/*********************************************************************************************\
* Interface
\*********************************************************************************************/