#ifdef FIRMWARE_VARIANT_HEATCONTROL

void heatcontrol_publish_sw_disableControl_heating() {
    char _tmp_topic_out[71];
    snprintf(_tmp_topic_out, 70, "%s/%s", confMqtt.mqtt_topic_out, "sw_disC_heat");

    char _tmp_payload[5];
    if (heatcontrol_in_sw_disableControl_heating) sprintf(_tmp_payload, "1");
    else sprintf(_tmp_payload, "0");

    mqttclient.publish(_tmp_topic_out, _tmp_payload);
}


void heatcontrol_publish_sw_disableControl_pump() {
    char _tmp_topic_out[71];
    snprintf(_tmp_topic_out, 70, "%s/%s", confMqtt.mqtt_topic_out, "sw_disC_pump");
    
    char _tmp_payload[5];
    if (heatcontrol_in_sw_disableControl_pump) sprintf(_tmp_payload, "1");
    else sprintf(_tmp_payload, "0");

    mqttclient.publish(_tmp_topic_out, _tmp_payload);
}


void heatcontrol_publish_in_heat_active() {
    char _tmp_topic_out[71];
    snprintf(_tmp_topic_out, 70, "%s/%s", confMqtt.mqtt_topic_out, "in_heat_active");

    char _tmp_payload[5];
    if (heatcontrol_in_heat_active) sprintf(_tmp_payload, "1");
    else sprintf(_tmp_payload, "0");

    mqttclient.publish(_tmp_topic_out, _tmp_payload);
}


void heatcontrol_publish_in_heat_request() {
    char _tmp_topic_out[71];
    snprintf(_tmp_topic_out, 70, "%s/%s", confMqtt.mqtt_topic_out, "in_heat_request");
    
    char _tmp_payload[5];
    if (heatcontrol_in_heat_request) sprintf(_tmp_payload, "1");
    else sprintf(_tmp_payload, "0");

    mqttclient.publish(_tmp_topic_out, _tmp_payload);
}


void heatcontrol_publish_out_heat() {
    char _tmp_topic_out[71];
    snprintf(_tmp_topic_out, 70, "%s/%s", confMqtt.mqtt_topic_out, "out_heat");
    
    char _tmp_payload[5];
    if (heatcontrol_out_heat) sprintf(_tmp_payload, "1");
    else sprintf(_tmp_payload, "0");

    mqttclient.publish(_tmp_topic_out, _tmp_payload);
}


void heatcontrol_publish_out_pump() {
    char _tmp_topic_out[71];
    snprintf(_tmp_topic_out, 70, "%s/%s", confMqtt.mqtt_topic_out, "out_pump");
    
    char _tmp_payload[5];
    if (heatcontrol_out_pump) sprintf(_tmp_payload, "1");
    else sprintf(_tmp_payload, "0");

    mqttclient.publish(_tmp_topic_out, _tmp_payload);
}


void heatcontrol_publish_lockTime() {
    char _tmp_topic_out[71];
    snprintf(_tmp_topic_out, 70, "%s/%s", confMqtt.mqtt_topic_out, "lockTime");

    char _tmp_payload[10];
    sprintf(_tmp_payload, "%d", heatcontrol_lockTime_getRemainingMins());

    mqttclient.publish(_tmp_topic_out, _tmp_payload);
}


void heatcontrol_publish_lockActive() {
    char _tmp_topic_out[71];
    bool _currStat = heatcontrol_getLockActive();
    snprintf(_tmp_topic_out, 70, "%s/%s", confMqtt.mqtt_topic_out, "lockActive");

    char _tmp_payload[10];

    if (_currStat) sprintf(_tmp_payload, "1");
    else sprintf(_tmp_payload, "0");
    mqttclient.publish(_tmp_topic_out, _tmp_payload);

    //if (_currStat) sprintf(_tmp_payload, "%d", heatcontrol_currentHeatCurveValue - confHeatc.hystereseOn);
    //else sprintf(_tmp_payload, "-");
    //mqttclient.publish(_tmp_topic_out, _tmp_payload);

    snprintf(_tmp_topic_out, 70, "%s/%s", confMqtt.mqtt_topic_out, "lockActiveUntil_HcHystOn");
    if (_currStat && heatcontrol_lockTime_getRemainingMins() == 0) sprintf(_tmp_payload, "1");
    else if (heatcontrol_lockTime_getRemainingMins()) sprintf(_tmp_payload, "0");
    mqttclient.publish(_tmp_topic_out, _tmp_payload);
}

void heatcontrol_publish_heatCurve_current() {
    char _tmp_topic_out[71];
    char _tmp_payload[10];
    
    snprintf(_tmp_topic_out, 70, "%s/%s", confMqtt.mqtt_topic_out, "heatCurve_curr");
    sprintf(_tmp_payload, "%d", heatcontrol_currentHeatCurveValue);
    mqttclient.publish(_tmp_topic_out, _tmp_payload);


    snprintf(_tmp_topic_out, 70, "%s/%s", confMqtt.mqtt_topic_out, "heatCurve_curr_hystOn");
    sprintf(_tmp_payload, "%d", heatcontrol_currentHeatCurveValue -  confHeatc.hystereseOn);
    mqttclient.publish(_tmp_topic_out, _tmp_payload);

    snprintf(_tmp_topic_out, 70, "%s/%s", confMqtt.mqtt_topic_out, "heatCurve_curr_hystOff");
    sprintf(_tmp_payload, "%d", heatcontrol_currentHeatCurveValue + confHeatc.hystereseOff);
    mqttclient.publish(_tmp_topic_out, _tmp_payload);
}

void heatcontrol_publish_pumpBacklash() {
    char _tmp_topic_out[71];
    snprintf(_tmp_topic_out, 70, "%s/%s", confMqtt.mqtt_topic_out, "pumpBacklash");

    char _tmp_payload[10];
    sprintf(_tmp_payload, "%d", heatcontrol_pumpBacklash_getRemainingMins());

    mqttclient.publish(_tmp_topic_out, _tmp_payload);
}

void heatcontrol_publish_testMode() {
    char _tmp_topic_out[71];
    snprintf(_tmp_topic_out, 70, "%s/%s", confMqtt.mqtt_topic_out, "testMode");

    char _tmp_payload[10];
    sprintf(_tmp_payload, "%d", heatcontrol_testMode_getRemainingMins());

    mqttclient.publish(_tmp_topic_out, _tmp_payload);
}

#endif