SOLVED. Intelligent thermostat algorithm needed. Guru needed

The eTRVs act as both the room thermostat and the valve to open or restrict the flow of water into each radiator. The six eTRVsv cost me £260 which is why I’m reluctant to spend more £££ and instead get these working. They are not the best, but i only discover this after 3 months of use. They communicate with HA via a RF433 board. The 15 min broadcast of data by the eTRVs is predefined by the manufacturer and can’t be changed.

My heating system is Closed Vented Sorage system using natural gas fired boiler. Boiler is controlled via a Z-wave 2 channel controller. one channel for room heating, one for hot water. The controller communicates with HA via a Z-wave USB stick

I have designed and coded a set of HA packages for HVAC 7 day programmer, Individual programmable virtual thermostats interfacing to the eTRVs, Heating, Water, Radiator controls, Automation, and and a raft of native and custom lovelace cards for the front end.

I also use PIRs and Alarm bell, outside lighting and wifi video door bell for security.

Inside the home, i have smart bulbs turning on/of as we move thought rooms but this can be overridden if needed. Also have power consumption meters for appliances and smart washing machine, clothes dryer, coffee machine, oven, microwave and dishwasher.

Hmm !
Modes: I was part of the crew testing modes to be included. The code was written by pnbruckner (‘5*’ coder in my book whose other contributions include the brilliant life360 integration).
Basically I think the default (single) mode is the best (though it spams the log without the max_exceeded: silent option). Use the others according to need.
Restart is used when you need to ensure you’re responding to the latest trigger
Queued is processor intensive and really only works when you make determinations on how the automation is triggered (applies more to scripts with passed parameters etc)
99% of my automations are of the first type.

eTRV Valves:
These sound excellent candidates for replacement


Quite cheaply too
Given that these won’t close, your options are limited, normal heating systems close off as the room reach temperature, so the last one (bypass) returns hot water and so shuts off the boiler.
Yours won’t as the heat loss will be sufficient to keep the boiler running.
I have a standard system run with a generic (software) thermostat and a boiler switch (like yours) the first year of operation saw me reducing gas kWh usage by 24% based on heat profile during the day, if we are out or away, if doors or windows are open.

Your control can not be that precise (due to the leaking valves) so all you can do is monitor the temperatures and shut the boiler off based on a sensor value.

The use of your current sensors and the (poor) frequency of updates dictates that you must either lower your set point or artificially raise the sensor value (so the boiler switches off sooner) hence the suggestion to use the mid point of the average and the highest. (or 60% of the difference, whatever works in your system)
The problem may be that this may be very sensitive to a) external temperature b) the amount of time doors and windows are open. The thermal inertia of the house will change because of these which makes undershoot and overshoot more variable.

Your best option is to change some hardware, choice is (in likely control and cost improvements order, ascending) : -

  • To buy a sensor that updates more frequently
  • Change the valves to some that close
  • Do both the above

I’m actually thinking about changing my standard TRV’s to something like : -
https://www.vpsunderfloorheating.co.uk/product/salus-t30nc230-electro-thermal-actuator-1
With something like a diy esp32 to measure the temperature and control the valve.
Each room would have its own generic (software) thermostat
If any valve was ‘on’ then the boiler runs
It’s a big project I’m still thinking through

Back to OP again. I find it also quite complicated to handle without quickly responsive temperature sensors. In my solution I have many extra sensors (zigbee). Mostly I use OSRAM Smart+ motion sensors, as they from my experience work very well as temperature sensors also. From Amazon.de they have now and then pretty good deals for them (last time 16 € a piece) As a backup I use those cheap Aqara temp/hum/hpa sensors. I have plenty of them. I think they were around 10 € a piece. Battery is around 20 cents in IKEA and last pretty long …

One more noob question for that time adjustment:

What happens to the input_number if for some reason temperature_sensor is not available?

Another question:

Would it be wise to add some kind of keep alive function for heating switch? With generic thermostat I think it checks in my case every 3 minutes the status of heater (input_boolean), just in case if it is not correct.

BTW: I also use this same system to keep my summer home (also my HA-NUC-ssd) from freezing :wink: . There is 5 heating elements. There is kitchen, master bedroom, dining and living room. In upstairs there is sleeping places. It is quite open space. Result from last day below, also quite accurate there:

You’re right. And with hindsight I would not have used eTRVs. They do not operate well and principally they are far too close (by nature) to the radiator. Never as good as a wall therm in each room. The fact they don’t close is not too much am issue because at max closed the temp is around 16C which is fine too take the chill . and for other rooms i just lower the setpoint to allow for the fact the valve is not fully closed so this actually heats the room to around thre desired temp anyway.
I can only repeat, my outlay of £240 on eTRVs and RF boards is not going to be thrown away. I need to focus on a software workaround and not more hardware purchases. I’m getting close. Although one or two very cheap wall thermostats might not be a hard swallow, only if I can find cheap, simple, but useable thermostats - any recommendations?

[

Nothing. It retains last value. You should assign a default value for start up on the input number. After that the value is persistent and updated when you’re sensor value changes … per your current config.

In your case with your devices, YES. use the keep_alive parameter on generic_thermostat

Not good, any ha restart will cause that value, the whole point of this is the self tuning, which you’ve lost if you do that (around the restarts anyway) best to trust on a restart that : - “I was pretty close before and it’ll adjust again in x minutes” (ie it does not retain last value if you set an initial)

Thanks again for valuable help!

Input_number is clear now! Keep_alive - I am not sure about that yet:

Using that same keep_alive might be a bit problematic because it adjust the input_boolean not the switch. And they are not supposed to be in same state all the time.

I do not understand you sorry. To be clear, keep_alive ensures that the “heater output” from generic_thermostat is periodically updated at the rate you specify in config. From what you wrote my impression is that your input_boolean reads this but needs the data to be updated? That is what keep_alive will do.
Otherwise you will need to rexpress what it is you are trying to do.

That was my suggestion for/to him, not me. He does it differently - or so I thought from reading his Portugese->UK English. Maybe I misunderstand?
For me, this is NOT what I want. I will be storing the value to a file which is read on startup - just in case :slight_smile: !

:slight_smile: :slight_smile: I had them on before - wish I had not changed them to spend £240 on crap eTRVs. I might end up biting the bullet if I cant get a software workaround implemented, put these Danfoss TRVs back on, and sell the eTRVs, and end up buying three cheap simple but working wall mounted smart thermostats. Any recommendation on such smart thermostats?

BTW - I just added that input_number. set_value-feature from @Mutt to adjust the delay-> seems to work OK! Thanks!

After 6 min heating time heater switch turns off. Keep alive would turn it on again because the temperature.sensor is still below the target. That’s why. I have used keep_alive in normal generic thermostats when you actually control directly the heater switch. It works great there.

But once again. Many thanks! This thread has helped me a lot. I think I do not need more help. I hope OP will get also a good solution. No more “Portugese” here (or maybe Portuguese) :wink:

Stay healthy!

keep_alive is on the generic thermostat heater output. I am not following you but merely repeating myself. I’ll leave you to it as you seem to have what you need it appears. I am just not understanding your text clearly. Stay safe :wink:

One more quick answer. In my case I do not use generic thermostat normal way. Heater in my case is input_boolean, not the heater switch which actually operates the heating. And these two (switch/Input_boolean) in my case does not have same state all the time for a reason.

Your English is better than my Portuguese :relieved: . I think perhaps confusion is through terminology.

  1. There is no way to use the generic_thermostat in a “non normal way”. It is what it is.
  2. target_sensor in generic_thermostat is the input line reading the temperature from whatever source you so desire.
  3. You are maybe mixing / reusing terms heater. In generic thermostat, this is the line out that can be used to determine whether the thermostat is demanding heat (or not). How you use that is at your discretion. For example, it can drive anything, such as a Boiler or indeed drive your input_boolean in order to drive something else. Whatever config you elect to impose.
  4. A Boiler is the English term (at least in the UK) for the fuel fired appliance that heats water so as to heat radiators in a central heating home. I sense you are using heater in both contexts of what we refer to in the UK as the boiler whilst you also use heater in the context of generic_thermostat - which is why I was confused maybe? I’m sure the US terminology is different - they have always sought to modify the Queens English since the insurrection (1775 to 1783) :grinning:. Kidding.

I understand what you are trying to do as an outcome, it was just how you are getting there that was tripping me up. Like I say, your English is waaaay better than any language I can speak , but then again the English are known for linguistic laziness :grinning: :grinning:

So, keep_alive will force an update from generic_thermostat.heater to your input_boolean.varastoheat at whatever rate you set in the config. If this is an issue - for example other outputs can modify your varestoheat - then change your config and/or introduce intermediate entities on which to mode your system.

1 Like

OK thanks! That explains a lot. But I think I use generic_thermostat “weird way”. Results are quite good anyway - if we talk about accuracy ±0.1 C. And now with your help with delay adjustment it is even better.

1 Like

True, In fact I believe it was Jefferson who argued for the division.
Despite the use of (about) 250 British Spellings (my memory is hazy) in the Constitution
And despite my own crap spelling I can always rely on the fact that it is called English (because it is) and who should be the arbiters on spelling of English other than the English ?
As Homer Simpson once said, “Why learn English ? I don’t ever plan on going to England”

Not entirely true. We have no qualms about stealing words from all over the world. (e.g. schadenfreud, pajamas, veranda, respond - the list is endless)
Unlike the French who insist on making up words to fill the need in their own language (‘computer’ is the one that instantly springs to mind, why have commonality when you can have confusion ?)
But you are right about learning languages. Why bother when saying it LOUDLY and SLOWLY works just as well, and if it doesn’t “well they’re just stupid aren’t they ?
I once stood in the the Cafeteria (English word ! (not)) in the Prada Museum in Madrid, the guy infront got the the front and asked for “Dos Beerio’s por favor” virtually everyone had to hide their snickers (like there was a chocolate shortage :rofl:).But at least he tried.

I think my biggest problem with the ‘English’ of the past was the way (on our travels) we asked “What is this Town/City/Province/Country Called ?” and then say “Hmm I can’t pronounce that (or it’s just requires some thought) I’ll call the place ‘X’ instead” (insert completely made up name here for ‘X’

No worries.

@mutt , I’m throwing the towel in. My rads are just heating up way beyond the setpoint on the eTRV due the valve not closing properly. The TRVs are not that good. The messing about in HA, well I don’t have time really, I just need it “to work”. I’ve more pressing matters to attend to. So I have refitted the non-smart Honeywell TRVs.
I will procure x3 room thermostats https://www.vesternet.com/products/z-wave-secure-wall-thermostat-with-lcd-display?gclid=EAIaIQobChMIoZWYwqaH7gIVAdtRCh3Y8gPiEAQYASABEgK9QvD_BwE#fo_c=521&fo_k=2a85d75c6fc9d0ee02d9506f5314f733&fo_s=gplauk
Will sell the eTRVs on eBay.

:grinning: :grinning: :grinning: - still laughing here.I love the way Brits on hol add gestures when repeating a question - in English - to some foreigner in their country. Makes all the difference :slight_smile:

How will you sell them ?
As, if I bought them, I’d find they were passing pretty quickly and return them as not functional

There’s only so much you can do in software to fix faulty hardware, sometime’s you just have to admit the truth. Good Luck

The saddest bit for me is occasionaly passing a ‘Brit’ hotel where they are flying the Union Flag UPSIDE DOWN !!! (grevious insult) and there are dozens of pink lobsters with their guts hanging out lying around the pool under said flag

Welcome to eBay :grinning: TBH, I’ve got old rads. Newer / different rads have different fittings for the base of the eTRV. As you will know, rad valves are all different / custom OEM bodies - in many cases - and often eTRV kits come with various adaptors to remedy this. I had to put a 5p inside the shaft of the eTRVs too. They just are not made for my rads. More current ones (<15 yrs old unlike mine!) will probably be ok. A colleague at work referred me to the eTRVs (AliExpress) as they work fine for him.

I so much wanted these to work and had invested a lot of time coding an MQTT broker for them. That’s why. I knew they were passing from the off, but put it down to poor firmware - which I upgraded.

Hindsight is a wonderful gift.