Serial.println("No MQTT message for one hour, switching off.");
heater_off(heating_pin);
Serial.print("No MQTT message for one hour on topic ");
Serial.print(heaters[room].topic);
Serial.println(", switching off.");
heater_off(heaters[room].pin);
}
}
voidsetup()
voidsetup()
{
{
pinMode(heating_pin,OUTPUT);
pinMode(led_pin,OUTPUT);
heater_off(heating_pin);
unsignedi;
heaters[KITCHEN].room=KITCHEN;
heaters[KITCHEN].pin=14;
heaters[KITCHEN].topic="chauffage/cuisine";
heaters[KITCHEN].callback=kitchen_callback;
for(i=0;i<NB_HEATERS;i++){
pinMode(heaters[i].pin,OUTPUT);
heater_off(heaters[i].pin);
}
Serial.begin(115200);
Serial.begin(115200);
// Optionnal functionnalities of EspMQTTClient :
// Optionnal functionnalities of EspMQTTClient :
client.enableDebuggingMessages();// Enable debugging messages sent to serial output
client.enableDebuggingMessages();// Enable debugging messages sent to serial output
client.enableHTTPWebUpdater();// Enable the web updater. User and password default to values of MQTTUsername and MQTTPassword. These can be overrited with enableHTTPWebUpdater("user", "password").
client.enableHTTPWebUpdater();// Enable the web updater. User and password default to values of MQTTUsername and MQTTPassword. These can be overrited with enableHTTPWebUpdater("user", "password").
//client.enableLastWillMessage("TestClient/lastwill", "I am going offline"); // You can activate the retain flag by setting the third parameter to true