mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
Merge pull request #58 from egrekov:master
Change boiler wwtemp via MQTT
This commit is contained in:
@@ -240,6 +240,7 @@ These incoming MQTT topics are also handled:
|
|||||||
| thermostat_cmd_temp | TOPIC_THERMOSTAT_CMD_TEMP | temperature as a float | sets the thermostat current setpoint |
|
| thermostat_cmd_temp | TOPIC_THERMOSTAT_CMD_TEMP | temperature as a float | sets the thermostat current setpoint |
|
||||||
| thermostat_cmd_mode | TOPIC_THERMOSTAT_CMD_MODE | auto, day, night | sets the thermostat mode |
|
| thermostat_cmd_mode | TOPIC_THERMOSTAT_CMD_MODE | auto, day, night | sets the thermostat mode |
|
||||||
| wwactivated | TOPIC_BOILER_WWACTIVATED | 0 or 1 | turns boiler warm water on/off (not tap) |
|
| wwactivated | TOPIC_BOILER_WWACTIVATED | 0 or 1 | turns boiler warm water on/off (not tap) |
|
||||||
|
| boiler_cmd_wwtemp | TOPIC_BOILER_CMD_WWTEMP | temperature as a float | sets the boiler wwtemp current setpoint |
|
||||||
|
|
||||||
If MQTT is not used use 'set mqtt_host' to remove it.
|
If MQTT is not used use 'set mqtt_host' to remove it.
|
||||||
|
|
||||||
|
|||||||
@@ -18,3 +18,13 @@
|
|||||||
|
|
||||||
temp_step: 0.5
|
temp_step: 0.5
|
||||||
|
|
||||||
|
- platform: mqtt
|
||||||
|
name: boiler
|
||||||
|
min_temp: 40
|
||||||
|
max_temp: 60
|
||||||
|
temp_step: 1
|
||||||
|
current_temperature_topic: "home/ems-esp/boiler_data"
|
||||||
|
temperature_state_topic: "home/ems-esp/boiler_data"
|
||||||
|
temperature_command_topic: "home/ems-esp/boiler_cmd_wwtemp"
|
||||||
|
current_temperature_template: "{{ value_json.wWCurTmp }}"
|
||||||
|
temperature_state_template: "{{ value_json.wWSelTemp }}"
|
||||||
|
|||||||
@@ -57,3 +57,6 @@ views:
|
|||||||
- sensor.dark_sky_temperature
|
- sensor.dark_sky_temperature
|
||||||
- type: thermostat
|
- type: thermostat
|
||||||
entity: climate.thermostat
|
entity: climate.thermostat
|
||||||
|
- type: thermostat
|
||||||
|
name: WarmWater
|
||||||
|
entity: climate.boiler
|
||||||
|
|||||||
@@ -845,6 +845,7 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
|
|||||||
myESP.mqttSubscribe(TOPIC_THERMOSTAT_CMD_TEMP);
|
myESP.mqttSubscribe(TOPIC_THERMOSTAT_CMD_TEMP);
|
||||||
myESP.mqttSubscribe(TOPIC_THERMOSTAT_CMD_MODE);
|
myESP.mqttSubscribe(TOPIC_THERMOSTAT_CMD_MODE);
|
||||||
myESP.mqttSubscribe(TOPIC_BOILER_WWACTIVATED);
|
myESP.mqttSubscribe(TOPIC_BOILER_WWACTIVATED);
|
||||||
|
myESP.mqttSubscribe(TOPIC_BOILER_CMD_WWTEMP);
|
||||||
myESP.mqttSubscribe(TOPIC_SHOWER_TIMER);
|
myESP.mqttSubscribe(TOPIC_SHOWER_TIMER);
|
||||||
myESP.mqttSubscribe(TOPIC_SHOWER_ALERT);
|
myESP.mqttSubscribe(TOPIC_SHOWER_ALERT);
|
||||||
myESP.mqttSubscribe(TOPIC_SHOWER_COLDSHOT);
|
myESP.mqttSubscribe(TOPIC_SHOWER_COLDSHOT);
|
||||||
@@ -897,6 +898,15 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// boiler wwtemp changes
|
||||||
|
if (strcmp(topic, TOPIC_BOILER_CMD_WWTEMP) == 0) {
|
||||||
|
float f = strtof((char *)message, 0);
|
||||||
|
char s[10] = {0};
|
||||||
|
myDebug("MQTT topic: boiler warm water temperature value %s", _float_to_char(s, f));
|
||||||
|
ems_setWarmWaterTemp(f);
|
||||||
|
publishValues(true); // publish back immediately
|
||||||
|
}
|
||||||
|
|
||||||
// shower timer
|
// shower timer
|
||||||
if (strcmp(topic, TOPIC_SHOWER_TIMER) == 0) {
|
if (strcmp(topic, TOPIC_SHOWER_TIMER) == 0) {
|
||||||
if (message[0] == '1') {
|
if (message[0] == '1') {
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#define TOPIC_BOILER_TAPWATER_ACTIVE "tapwater_active" // if hot tap water is running
|
#define TOPIC_BOILER_TAPWATER_ACTIVE "tapwater_active" // if hot tap water is running
|
||||||
#define TOPIC_BOILER_HEATING_ACTIVE "heating_active" // if heating is on
|
#define TOPIC_BOILER_HEATING_ACTIVE "heating_active" // if heating is on
|
||||||
#define TOPIC_BOILER_WWACTIVATED "wwactivated" // for receiving MQTT message to change water on/off
|
#define TOPIC_BOILER_WWACTIVATED "wwactivated" // for receiving MQTT message to change water on/off
|
||||||
|
#define TOPIC_BOILER_CMD_WWTEMP "boiler_cmd_wwtemp" // for received boiler wwtemp changes via MQTT
|
||||||
|
|
||||||
// shower time
|
// shower time
|
||||||
#define TOPIC_SHOWERTIME "showertime" // for sending shower time results
|
#define TOPIC_SHOWERTIME "showertime" // for sending shower time results
|
||||||
|
|||||||
Reference in New Issue
Block a user