Sorry for the late reply, can u post the sketch and how you configured the MQTT in homeassistant?
In essence with MQTT you’ll just create sensors which you then can use however you want.
Best to use their github example since i adjusted mine to get some more sensors.
No need to apologise!
So I have a few devices configured via ESPHome and the ability to upload configuration changes via Wi-Fi has always appealed to me. With that in mind I attempted to use https://github.com/rsciriano/ESPHome-OpenTherm. However; this aims to act as a “Virtual” Thermostat allowing set point to be set via a Lovelace card, and not to be set via a Templated Sensor like the one discussed above.
Tonight when the daughter is asleep and wife at work; I will upload the MQTT sketch above and let you know how I get on!
Hey guys. This thread seems to be the only active one.
I’m currently in the same process of purchasing smart TRVs, getting an OpenTherm shield from DIYLESS and my head will most probably explode from all of this
I’m having a bit trouble following this topic as it got started over a year ago.
Is the solution still using that Generic multizone thermostat you linked in the first post?
It looks to be the best way to choose which valve (or thermostat) is set to the higherst point.
All of this is very overwhelming but I’m here to learn something new, hopefully
In the end i just used Generic Thermostat - Home Assistant for the TRV’s to open or close. And created a Template for calculating which setpoint and current temperature needed to be send to the Opentherm Shield.
You just need to follow the steps in their github: GitHub - diyless/home-assistant-opentherm-thermostat: Home Assistant OpenTherm Thermostat
Since the shield just want to know an actual temperature and a setpoint, it will then deal with you boiler itself. No need to make it more complicated.
What my system does:
- The generic thermostats are per room and open the TRV of that room if needed.
- It will turn on or off the circulation pump of the boiler. (with an on for 10 minutes if the system was idle for a week, to prevent motor locking up)
- Whenever a room has a higher setpoint then the actual temperature of that room my template will check all rooms and sends the room which has the biggest difference. Otherwise it may send like a 0.2 difference and the boiler will not send out high enough temperature for another room that could have a delta of 2 degrees.
I’m happy to share whatever code or to help, at least 1 winter of testing done.
Thanks @Dujith. I’m still waiting for the hardware to arrive but I will try to follow the GIthub first and see how far I can get.
If you could share your template determing the set values, that would be great
Everything is received and I’m making a test setup. I’m running into the following difficulties:
- My boiler keeps the pump running as long as the heating mode is ‘on’, even when there is no heat request. Your solution doesn’t account for that. (In the code DIYLess provided ‘heating’ is on by default unless explicitly turned off via MQTT)
- My valves (wax motors) need time to fully open and close. There is a solution here
, but that doesn’t play well with your solution, as you are using generic thermostats (which only accept on/off switches)(what am I saying - it seems to work fine!) - I want to make a ‘boost’ mode, which sets a high target temperature for a specified amount of time to decrease the time needed to get to the desired temperature (be it with higher gas usage).
- How difficult is it to make an open window detection in this solution?
The following solutions come to mind:
- Create another (binary) sensor, called ‘heat_request’, which turns on or off based on the thermostats. If there is heat demand, use NodeRed to turn the ‘heating mode’ on.
- Use a script or automation to get around this? I have no idea what a solution might look like, I’m new to Home Assistant.
- Create a binary switch ‘boost’, which raises the temperature of the Virtual CV Setpoint by a lot. (Basically another if-statement in the value_template block)
If anyone has a more clever solution to these problems, it’d be more then welcome.
I did take that into account: (scroll up to the code sections)
alias: CV Aan/Uit
description: ''
trigger:
- platform: template
value_template: >-
{{ states('sensor.setpoint_cv_virtual') >
states('sensor.temperature_cv_virtual') and states('climate.heating') ==
"off" }}
id: StartWarmteVraag
- platform: template
value_template: >-
{{ states('sensor.setpoint_cv_virtual') <
states('sensor.temperature_cv_virtual') and states('climate.heating') ==
"heat" }}
id: EindeWarmteVraag
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: StartWarmteVraag
sequence:
- service: climate.set_hvac_mode
target:
entity_id: climate.heating
data:
hvac_mode: heat
- conditions:
- condition: trigger
id: EindeWarmteVraag
sequence:
- service: climate.set_hvac_mode
target:
entity_id: climate.heating
data:
hvac_mode: 'off'
default: []
mode: restart
the entity in question is defined as a mqtt climate:
climate:
- name: "Heating"
modes:
- "off"
- "heat"
current_temperature_topic: "opentherm-thermostat/current-temperature/get"
mode_command_topic: "opentherm-thermostat/mode/set"
mode_state_topic: "opentherm-thermostat/mode/get"
temperature_command_topic: "opentherm-thermostat/setpoint-temperature/set"
temperature_state_topic: "opentherm-thermostat/setpoint-temperature/get"
min_temp: 12
max_temp: 28
value_template: "{{ value }}"
temp_step: 0.5
You might want to look at this thread i once made for a boost function. While its not exactly for what u want to do. It should be able todo the same thing.
I think in the value_template
add another if statement to check the window sensor and just send a fixed value like 7 degrees to the virtual objects.
I am very interested in the DIYLess thermostat, my boiler sorts opentherm too. I have a question though, can opentherm support multi-zones? I have 2 thermostats currently controlling each zone independently. If so how would it operate?
@Dujith i followed your ideas, and i’m implementing them too. My diyless thermostat works great, altough i sometimes suspect there is still room to improve the algorithm in it. i will have a look at the esphome opentherm sketch too. However optimal PID parameters seem to be less important if you switch regularily to other rooms, which whould require other PID’s paramaters i think
One question tough, do you take into account the time your motors take to open or close? I’m testing one (NC) motor, and it takes 5 minutes to fully open. I think a bit more to fully close. Or is this time negligible? I suppose it could be easily implemented by just delaying the sending of virtual setpoint and room temperature to the opentherm thermostat?
Thx for sharing your solution!
My motors are instant unlike wax motors so i dont have to take that time into account.
Closing isnt the issue as those minutes wont make the difference temperature wise.
Opening is a problem with wax motors but that has more to do with the Central Heating pump as pumping while everything is closed isnt that great for the pump. Either have a bypass, delay on heating command or what i usually do when i implement this in houses have 1-2 locations always open.
For example:
The radiator in the hallway has no thermostat but will instead heat whenever a room requires heat.
Thus always providing flow and the pump can freely run.
Hey @Dujith, I am also looking to create a multiroom setup with an OpenTherm supporting heater (Intergas CV) using the DIYless OpenTherm Thermostat.
I have been able to follow up on your instructions, up to the point of sending the setpoint_cv_virtual to the DIYless thermostat using Node-RED.
Could you please provide some instructions on how to set this up in Node-RED?
I have Node-RED running within HomeAssistant, but have no experience working with with it.
Thanks for the answer. I have a bypass.
What kind of motors are you using?
I just bought one wax motor to test out (cheap). Plan is buying a collector where i can mount the motors. I still have all the possibilities to change the plan
@Dujith , could you please share an export of the Node-RED flow (or sequence) through which you send the virtual sensor data to the diyless shield?
The node red is only for repeating the setpoint and actual temperature. When the DIYLESS does not receive them for a while it will fallback to its defaults. So you can also set that up with an automation.
Seemed simpler when i started with HA to do it this way. But if memory serves my correctly i had to find a custom component for node red (resend)
I have setup the state_change node like this:
But how do I setup the mqtt out node? I have Mosquitto Broker running on HA and selected that. But which topic should I use?
Sorry for my ignorance.
Whatever topic you specified in your mqtt:
So in my case that would be:
Setpoint: opentherm-thermostat/setpoint-temperature/set
Actual Temp: opentherm-thermostat/current-temperature/set
Yours might differ since the code changed a bit since i used it.
Thanks for the swift reply.
I used your code above for the mqtt. I presume I need to rewrite this using the mqtt topics described here: OpenTherm Thermostat Initial Configuration - DIYLESS Electronics
Looking at the github and blog its still those 2 topics unless you changed something yourself.
I succeeded in in sending current and setpoint temperature to the diyless thermostat.
I only need those 2 topics:
diyless_thermostat/cmnd/things/thermostat/properties/targetTemperature
diyless_thermostat/cmnd/things/thermostat/properties/temperature
no mqtt climate code needed in HA.
Thanks a lot.
My next challenge is to make my setup resistant to unavailable sensor data (I am using XIAOMI Mijia BLE sensors, one per room).
In my current code this makes both: virtual setpoint and virtual temperature unavailable as well.
I had the same issue and it locked up the DIYLESS module.
Fixed it with adding a default value when the sensor isnt doing anything:
{{ state_attr('climate.alex','temperature') | float(18)}}
instead of:
{{ state_attr('climate.alex','temperature') }}