PID action

Yes it is! Give me some details (what type of heater, how many stages/steps, etc) and I’ll tell you how to do it.

Wow - that would be awesome for such a solution - i also asked for such a solution earlier to control my underfloor heating…
Could be great to have a kind of function where you could do the PID in :slight_smile:

The amount of variables per room is pretty big (around 14), so having a function with 14 parameters is very hard to control. My approach on this is to add an auto tuning PID section! I’ll keep you updated on the progress!

Sounds very nice - but no, not nessecary to have it as a function - but just a “small” section in the program… Would be very nice with a PID an some kind of auto tuner…

Currently i’m trying to control my underfloor heating in a way so the tiles never get cold, so i never shut off the valve completely - but it’s very hard to program without the PID part…

Dear Rasmus,

You will need a PWM driver for the valve control. More than that, take care with the surface contact temperature (if there is no heating demand from the ambient sensor, the floor temperature should not be set above the measured ambient temperature). You can use the heating PID, but you will need more code specific to your setup for what is turned ON/OFF and when (the so called temperature dead zone).

Best regards,


Yes i know that… i habe sensors on outside temperature and for the water into the underfloor heating, where I can do some dynamically adjustments for the dead zone in order to “hit” this zone so the floor feels hot…

The pwm Modulation is build in my output module, so I only send a % value for the valve

Best way to control the water temperature is using a mixing valve (3 way valve). If there is a 2 way valve the accuracy of the set temperature is pretty low, moreover the pressure loss increases. For what you want to achieve the PID above is ok for sending signal to the PWM, but tune the Kp, Kd, Ki constants, now they are set for ambient temperature control.

Indeed, the best thing would be to put in a mixer valve… I’ve also thought about that… my problem is I only have one pump and also my preheater for ventilation and towel rails is on the same system, so if I set the temperature very low for the floor it also takes the other components… but maybe I need to change that and split it in 2 circuits

Hi @george.erhan,
Some details of my electrical heater installation:

  • Day zone: 2 x Sauter Bolero 2000w with integrated thermostat and a “pilot” wire with six modes (off, out of freezing, eco, comfort, comfort -1°C and comfort -2°C)
  • Night zone: 2x Sauter Bolero 1500w with integrated thermostat and a “pilot” wire with six modes (off, out of freezing, eco, comfort, comfort -1°C and comfort -2°C)
    N.B: these heaters have inertness…

For each zone, I would like to define the mode (comfort, etc.) time period by time period. E.g: between 12:30 and 14:00 -> comfort -1°C mode, 14:00 - 18:00 -> eco mode, 18:00 - 22:00 -> comfort mode, etc.

Hi @george.erhan,

Its some while since the last update of this post.
Can you share some working examples?
So for example take one room with only a temperature sensor that measures the room temperature, a setpoint and a valve to open and close the heating demand, so basically an on-off switch.

if for such a situation both the items file and the rule can be provided it is a more practical approach to work from.



Hi @snowbird,

As lame as it may seem, the overall ambient temperature control is far more complicated. I shared these lines of code hoping someone will get in the same “boat”.
PID control is not something new, nor easy to understand!
So, please understand that I am willing to share knowledge, but not doing your homework! Thus said, please check the following links:
Not the best insight knowledge, but a very good start!,
then this one, with the enclosed not so very bright (but working!) initial contribution!
So, fair and square, if you want to switch a valve on and off, my topic is not for you. If you want to send some commands to devices that can handle the basic control (below 1-200ms), then you just hit the jackpot!


Hi George,

Thank you for your quick reply.
I am not sure if the question is weather I want to do homework or not, the
question is if something can be used in a modular way by a broader audience.
I do believe everybody in the community tries to make OpenHAB as easy to
use as possible.

If I buy a Honeywell thermostat I also don’t need to think about their
design logic, I can simply use the device.
Also there are plenty hardware based PID controllers which are more than
reasonable priced which simply require a temperature sensor to connect or
have an ADC input and a switching output.

I think the main question is, if you are able to provide some more or less
ready to use PID controller building block which can easily be used
within OpenHAB or not.
As of now there is no such building block so it could definitely be adding

If your answer is:“you need to study it by yourself”, then of course it can
from your point of view be a valid answer, but it I am not sure if it is
really helping the community.


1 Like

Yes I am (although you were not very polite)! Read the link provided previously, and put this in your openHAB addons folder!

If you already have this, why are you asking?

Any open source project requires studying (yes, by yourself)! IMHO helping the community means sharing knowledge!

1 Like

Hello George…
Finally i managed to get my 3-way valve… Do you know if i should mount it on the forward string or the return string? Basically i think it should be on the return string, then with a “one-way” valve on the forward string, so the return water won’t “cheat” and go retun in the forward string?

Hi George,

Thanks again for your quick response.

It is great to see you already have developed a PID contriller Thing which
can be used as an addon!
The intention is not to be rude, but my response was driven by your remark “you
need to study it by yourself”.
Like many people are using Z-Wave devices just a few know exactly how it
works under the hood and other contribute by testing it but not by studying
the protocol itself.

So sharing knowledge is for some people the die hard programming and for
others to contribute in testing the “in the field” solution, both sides
cant be successfull without the other side.

Further there are many many sensors that can do temperature readings and
provide OpenHAB witch such data, but as far as I know your addon is the
first PIDController that actually brings this logic directly in OpenHAB.

Once more thanks for your contribution.


Hey @george.erhan. I’m trying to join in into helping test and standardize your binding, which is an awesome idea and a very important piece in a smart home.

I saw Issues are disabled in your github repository. Where do you want us to file issues and improvements?

I also would like to de-localize the debugging output to english. I try to use it and it kinda works, because I know how PID controllers work, but it’s confusing anyways :smiley: Can I reformat your I saw what is open in your merge request. I would totally help out getting these things done.

I also have problems with the functionality of the binding itself, which stops working as soon as the INPUT diverges from the SETPOINT, but that may be better put into an github issue.

AFAIK it should stop scheduling (looping) when setpoint and input are the same not when they are different.

Yes, for the moment, it will not be issued as a binding, but as an automation module, so things are going to change. I will release it in the near future (still working).

So, thank you for your attention to details, I will definitely keep in touch with you and make things happen.

Best regards,

1 Like

This looks like being just the perfectly fitting thing. Great, I am waiting to help out where I can as soon as you tell me. :+1:


This should answer your question!

@george.erhan Just wanted to hear if you already started on the automation module and if there is anything we can help you with. :slight_smile: