Central Heating and TRV valves

Hi All, newbie here.

I have now been looking and reading many topics trying to find a solution.
I just need confirmation that what i am trying to do is possible and if so how would i configure Hassio. I want to use electrothermic actuators on the radiators connected to Tasmota Sonoff basics with DHT11 sensors. My plan was to somehow set the temperature so the actuator would activate and turn on the radiator. I was hoping to then be able to set each room to different temperatures at different times. I have got it working with a sonoff TH16 connecting to Itead, but would prefer to use a cheaper option and Home assistant. Thanks in advance for any advice.

SImon

1 Like

I’m sorry I have no experience with this but I am looking for a solution for controlling my radiators individually.

Do you mind if I ask which valves you are using?

I have currently got a Watts 26 LC actuator. I have only got the 1 whilst i am testing and working things out, but it does open and close the valve.

Thanks for the info.

But like usual they don’t have a US source that I can see. Radiator control valves are extremely difficult to find here. Boiler heating has been mostly phased out here I guess so there is not much of a market.

the actuators always seem to be for underfloor heating systems, but no reason why they shouldnt work.

I am now looking for how to configure a sonoff Tasmota basic with a DHT11 attached to switch on and off at given temoeratures. I am not sure if it is all done within home assistant or does the sonoff need a different sketch.

I just made several temp/humidity sensors using nodemcu’s and DHT11 sensors.

My recommendation is if you are going to use it for heating control then you may want to buy the (reportedly) more accurate DHT22. I think the accuracy of the DHT11 is around 2.5 degrees F. And I can see my sensors jumping around 2 degrees or so between readings.

I used a thread found here on the forum as the base example for my sensor and tweaked it a little to my liking.

Here is the sketch. But be aware that I’ve had troubles just copy and pasting from the thread into the Arduino-IDE.

#include <ESP8266WiFi.h>
#include <Wire.h>
#include <PubSubClient.h>

#include <DHT.h>

#define DHTPIN D3 // what digital pin we're connected to on NodeMCU (D3)

// Uncomment whatever type you're using!
#define DHTTYPE DHT11 // DHT 11
//#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
//#define DHTTYPE DHT21 // DHT 21 (AM2301)

// Connect pin 1 (+ on the left) of the sensor to +5V
// NOTE: If using a board with 3.3V logic like an Arduino Duo connect pin 1
// to 3.3V instead of 5V!
// Connect pin 2 of the sensor to whatever your DHTPIN is
// Connect pin 4 (- on the right) of the sensor to GROUND
// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor unless your sensor already has it 
// installed
    
DHT dht(DHTPIN, DHTTYPE);

//add your specifics to the below lines
#define wifi_ssid "XXXXXXX"
#define wifi_password "YYYYYYYY"

#define mqtt_server "111.111.1.111"
#define mqtt_user "ZZZZZZ"
#define mqtt_password "AAAAAAAA"

// change below to be unique for each sensor
#define clientName "DHTsensorXX"
#define humidity_topic "sensorXX/humidity"
#define temperature_celsius_topic "sensorXX/temperature_celsius"
#define temperature_fahrenheit_topic "sensorXX/temperature_fahrenheit"
#define heat_index_fahrenheit_topic "sensorXX/heat_index_fahrenheit"
//

WiFiClient espClient;
PubSubClient client(espClient);

void setup() {
Serial.begin(115200);
dht.begin();
setup_wifi();
client.setServer(mqtt_server, 1883);
}

String macToStr(const uint8_t* mac)
{
String result;
for (int i = 0; i < 6; ++i) {
result += String(mac[i], 16);
if (i < 5)
result += ':';
}
return result;
}

void setup_wifi() {
delay(10);
// We start by connecting to a WiFi network
Serial.println();
Serial.print("Connecting to ");
Serial.println(wifi_ssid);

WiFi.begin(wifi_ssid, wifi_password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}

Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}

void reconnect() {
// Loop until we're reconnected
while (!client.connected()) {
Serial.print("Attempting MQTT connection
");

// Generate client name based on MAC address and last 8 bits of microsecond counter
//  String clientName;  
//  clientName += "esp8266-";
//  uint8_t mac[6];
//  WiFi.macAddress(mac);
//  clientName += macToStr(mac);
//  clientName += "-";
//  clientName += String(micros() & 0xff, 16);
  Serial.print("Connecting to ");
  Serial.print(mqtt_server);
  Serial.print(" as ");
  Serial.println(clientName);


// Attempt to connect
// If you do not want to use a username and password, change next line to
//if (client.connect((char*) clientName.c_str())) {
//if (client.connect("homeassistant","homeassistant","05081985"))
//if (client.connect("ESP8266Client", mqtt_user, mqtt_password))
if (client.connect(clientName, mqtt_user, mqtt_password))
{
Serial.println("connected");
} else {
Serial.print("failed, rc=");
Serial.print(client.state());
Serial.println(" try again in 5 seconds");
// Wait 5 seconds before retrying
delay(5000);
}
}
}

void loop() {
  if (!client.connected()) {
    reconnect();
  }
  client.loop();

  // Wait a few seconds between measurements.
  delay(5000);
  
  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  float h = dht.readHumidity();
  // Read temperature as Celsius (the default)
  float t = dht.readTemperature();
  // Read temperature as Fahrenheit (isFahrenheit = true)
  float f = dht.readTemperature(true);
  
  // Check if any reads failed and exit early (to try again).
  if (isnan(h) || isnan(t) || isnan(f)) {
  Serial.println("Failed to read from DHT sensor!");
  return;
  }
  
  // Compute heat index in Fahrenheit (the default)
  float hif = dht.computeHeatIndex(f, h);
  // Compute heat index in Celsius (isFahreheit = false)
  float hic = dht.computeHeatIndex(t, h, false);
  Serial.print("Humidity: ");
  Serial.print(h);
  Serial.print(" %\t");
  Serial.print("Temperature: ");
  Serial.print(t);
  Serial.print(" *C ");
  Serial.print(f);
  Serial.print(" *F\t");
  Serial.print("Heat index: ");
//  Serial.print(hic);
//  Serial.print(" *C ");
  Serial.print(hif);
  Serial.println(" *F");


//  Serial.print("Temperature in Celsius:");
//  Serial.println(String(t).c_str());
//  client.publish(temperature_celsius_topic, String(t).c_str(), true);

  Serial.print("Temperature in Fahrenheit:");
  Serial.println(String(f).c_str());
  client.publish(temperature_fahrenheit_topic, String(f).c_str(), true);

//  delay(1000);

  Serial.print("Humidity:");
  Serial.println(String(h).c_str());
  client.publish(humidity_topic, String(h).c_str(), true);

//  delay(1000);

  Serial.print("Heat Index in Fahrenheit:");
  Serial.println(String(hif).c_str());
  client.publish(heat_index_fahrenheit_topic, String(hif).c_str(), true);

//  delay(1000);
  }
1 Like

Hi guys

I have 39 radiators in the house, and have the ability to enable any single one of these independently. Radiators are grouped into zones which represent a room or combined space

Each radiator has a Thermostatic Release Valve which has the actuator and a temperature sensor (tuned to account for its physical closeness to the heat source.

Additionally I have a few room stats to get a measure in larger rooms or rooms where a window curtain may be interfering with the heat source flow and measurements

Originally I used a Honeywell Evohome solution but right now I am almost completely moved to a Zwave solution using the Eurotronic Spirit TRV, which are battery driven, and can be purchased for 38€ a head.

For scheduling there is an awsome Home assistant app daemon solution called Heaty which is very customisable.

Hopefully this info might help you get an inexpensive yet reliable solution.

(10 years ago I tried what your suggestions to roll your own - the current tech is less expensive and more reliable)

Damian

2 Likes

Hi

I am trying to keep things as simple as possible, and believe the below should work, but it doesn’t. the switch does not switch on or off dependant on temperature. Apologies for how it is displayed, haven’t worked out how to put it in properly.
Thanks

switch:
platform: mqtt
name: “Back_Room_Rad_1”
command_topic: “cmnd/Back_Room_Rad_1/power”
state_topic: “stat/Back_Room_Rad_1/POWER”
qos: 1
payload_on: “ON”
payload_off: “OFF”
retain: true

sensor:

  • platform: mqtt
    name: “Back_Room_Rad_1_Temperature”
    state_topic: “tele/Back_Room_Rad_1/SENSOR”
    value_template: “{{ value_json[‘DHT11’].Temperature }}”
    unit_of_measurement: “°C”
  • platform: mqtt
    name: “Tele Humidity”
    state_topic: “tele/Back_Room_Rad_1/SENSOR”
    value_template: “{{ value_json[‘DHT11’].Humidity }}”
    unit_of_measurement: “%”

climate:

  • platform: generic_thermostat
    name: “Back Room Rad1”
    heater: switch.Back_Room_Rad_1
    target_sensor: sensor.Back_Room_Rad_1_Temperature
    min_temp: 18
    max_temp: 23
    target_temp: 22
    Tolerance : 0

Hi

So i have now got the Switch and Climate part talking with Hassio, but cant get the sensors working. I have changed the above to DHT11 as it was set to DHT22. I get the icons in Hassio just not the readings. Any assistance always great fully received.
I may well change over to DHT22 or go for another system for sensors, advice always appreciated.

Thanks

What hardware/code did you use for the sensors?

To properly format the code for display when you are done entering it in the reply window just highlight all the code and hit the </> symbol at the top of the window.

Hi
What do you mean by hardware/code.? I am using Sonoff Basic with Tasmota, and a rasperry pi3b+.
My configuration.yaml file has the following to control it. Both the switch and the climate parts are working, I just dont get the current temperature showing on the Home Assistant overview screen.

switch:
platform: mqtt
name: “Back_Room_Rad_1”
command_topic: “cmnd/Back_Room_Rad_1/power”
state_topic: “stat/Back_Room_Rad_1/POWER”
qos: 1
payload_on: “ON”
payload_off: “OFF”
retain: true

sensor:

* platform: mqtt
name: “Back_Room_Rad_1_Temperature”
state_topic: “tele/Back_Room_Rad_1/SENSOR”
value_template: “{{ value_json[‘DHT11’].Temperature }}”
unit_of_measurement: “°C”
* platform: mqtt
name: “Tele Humidity”
state_topic: “tele/Back_Room_Rad_1/SENSOR”
value_template: “{{ value_json[‘DHT11’].Humidity }}”
unit_of_measurement: “%”

climate:

* platform: generic_thermostat
name: “Back Room Rad1”
heater: switch.Back_Room_Rad_1
target_sensor: sensor.Back_Room_Rad_1_Temperature
min_temp: 18
max_temp: 23
target_temp: 22
Tolerance : 0

sorry. i don’t know how the tasmota software sends the dht11 signal over mqtt.

my nodemcu just sends an mqtt topic to HA that contains the measured values and i just create a sensor to read them out. based on code i posted above here are the sensors:

- platform: mqtt
  state_topic: 'sensorLR/temperature_fahrenheit'
  name: 'Livingroom Temperature'
  unit_of_measurement: '°F'
  
- platform: mqtt
  state_topic: 'sensorLR/humidity'
  name: 'Livingroom Humidity'
  unit_of_measurement: '%'
  
- platform: mqtt
  state_topic: 'sensorLR/heat_index_fahrenheit'
  name: 'Livingroom Heat Index'
  unit_of_measurement: '°F'

then to display the temp (for example) i just read it directly into the front end:

- sensor.livingroom_temperature
  - sensor.livingroom_humidity
  - sensor.livingroom_heat_index

and it shows up like this:

ex

Hi again

Apologies for asking the same question again, but i just cant get the temperatures into HA. I have tried all mentioned on this thread and others i have found on the forum. I have now purchased a DHT22 and after changing the names to that of my sonoff, and configuring the Tasmota to SI7021 ( I beleive this is the same as DHT22 which is not an option in the dropdown). IT still willnot work.
So just to confirm, do I need to addd any other info to other YAML files or elsewhere, or do i need to re flash the sonoff with an edited Tasmota. I have read about NodeMCU, is this an easier or a suitable replacement, if so where do i get the flash from.
Again apologies for going on, its just i have been trying to suss this for nearly a month now and am going over and over the same things.
I really did think this was going to be more straight forward, and I am considering buying Xiaomi or similar sensors but thought i may run into other issues.
Thanks in advance for any help.

I will say again


I have no experience with sonoffs using DHT11/DHT22 sensors (i just use them as wifi light switches but not using tasmota) but if you want to use the nodemcu all you have to do is put the code in my first post into the ArduinoIDE, modify the code for your specific requirements (SSID, password, topic, sensor type, etc) then flash that code onto the nodemcu (using proper settings for the board). connect up the DHT sensor according to the comments in the code.

then create sensors by entering my code from the second entry into the HA configuration file and modifying that code to match the topics in the nodemcu.

This will give you a temperature and humidity sensor and will display it on the frontend and is usable in automations.

Hi again
Good news, i have now got the temperatures showing, not sure exactly what i did, but it did put a smile on my face. It may have just been a matter of giving it a few minutes.
However I now need the generic _thermostat to work. It displays on the Hassio overview ok, and i change the temperature setting on it, but this doesnt get back to the switch and switch it on. I guess this is either the generic thermostat not receiving the current temp, or it not sending the information correctly, or both.
I have looked at nodemcu, but this just gave me another headache and figured that what i have should be working.

The relevant part of my configuration.yaml is below. thanks

sensor:
  - platform: mqtt
    name: "Back Room 1 Temperature"
    state_topic: "tele/Back_Room_Rad_1/SENSOR"
    value_template: "{{ value_json['SI7021'].Temperature }}"
    unit_of_measurement: "°C"
  - platform: mqtt
    name: "Back Room 1 Humidity"
    state_topic: "tele/Back_Room_Rad_1/SENSOR"
    value_template: "{{ value_json['SI7021'].Humidity }}"
    unit_of_measurement: "%"
    
switch:
  - platform: mqtt
    icon: mdi:radiator
    name: "Back Room Rad 1"
    command_topic: "cmnd/Back_Room_Rad_1/power"
    state_topic: "stat/Back_Room_Rad_1/POWER"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    retain: true
    
climate:
  - platform: generic_thermostat
    entities: sensor.back_room_rad_1
    name: Back Room Rad 1
    heater: switch.back_room_rad_1
    target_sensor: sensor.back_room_rad_1_temperature
    target_temp: 28
    Tolerance : 1
    min_cycle_duration:
      seconds: 10
    keep_alive:
      minutes: 3

Just a couple of observations i have made. When manually turning the switch on, the generic thermostat changes from idle to heat, but does not switch off when it hits the target temp.

Not sure if this has any relevance , but when using the Hassio Configurator, the text for switch and sensor is green, for the thermostat it stays black. I have looked around for an answer as i am unsure of the importance of the colours.
Thanks

Ok, I’m thinking of doing the same thing, one question whats the forums opinion on configuring using NO vs NC valves?

Hey guys, basically I’m doing something similiar but DIY and I have a floor heating system.

You should keep in mind that those electrothermic actuators are like binary switches. They are either open or closed (with some minutes transition time).
This is OK for a slow control system due to the floor itself being heated, but I’d not consider this solution for radiators (just my opinion)
I could think of very short activation cycles due the heat radiation if the sensor is put near to the radiator.

Regarding NO or NC you should think about what is the common state of the actuator. For my floor heating I use NC, so if not powered the valve is closed means no heating. This is probably the best solution if not living in arctic regions where the valve needs to be open >50% of the time.

So any suggestions on cheap valves that would be suitable?

Hey

Its working. I am very happy, turned out that the name of my switch was different. now i can start some testing before i decide whether to go with this idea.

Simon