Control my heating pump with a temp sensor

Hey!
Ok so I have a Daikin heating pump, and it controls itself towards its internal temperature sensor. But since I want it to heat more than the room it’s located in I need to raise the set temp.
But wouldn’t it be possible to control the set temp of the heatingpump based on the temp inside the house of a temp sensor there? That way I could automate HA to lower the set temp when the temperature reaches what I set inside the house.
How would I do this? I guess I have to test the set temp around but if the temp inside the house reaches a good temp that I set I would save energy if HA then set the temp lower making the pump go lower.

Appreciate all help! (New to HA)

If you have a way to turn your heat pump on via home assistant then the Generic Thermostat integration can be used. Generic Thermostat - Home Assistant

1 Like

Assuming the heat pump thermostat can be controlled via HA. The generic thermostat works great with a Template Switch configured to operate the heat pump thermostat temperature setting (high/low) as an on/off state since the generic thermostat needs a switch.

1 Like

Sweet! Thanks both of you! Yes I can turn it on/off in HA. But heatingpumps dont like to be turned totally on/off so I’d rather just lower its set-temp when I want to lower the heating.
But what you said @crlogic that seem to be what i’m looking for to operate the temp settings on the pump!
But I think I need to learn how this works, is there any good guide on how to work with this Generic Thermostat?

I control my Daikin heatpump based on external thermostat, and that thermostat (as far as daikin is aware) is just fibaro relay that opens/closes. This signals pump to heat. Heating curve is set on Daikin (leaving water temp is different when there is 10 and -10 outside). That’s it.
Rest is on HA - I have 7 zones, each zone consists of 1 temp sensor and 1-5 valves opening/closing circuits. I am not using generic thermostat as it has large overshoot with underfloor water heating. Instead I am using multizone thermostat with PID controller.
Outside of it, there is automation that runs every 3 minutes and checks if any of thermostats’ hvac action is “heating”, if yes, it turns off heatpump. If not, it will turn it off.

2 Likes

But where do I begin to make this happen? Could you show me the idea how to build this controll in HA?

I normally start with the example provided in the docs. So starting w/ Generic Thermostat there is a minimum amount of data needed to configure it;

# Example configuration.yaml entry
climate:
  - platform: generic_thermostat
    name: Heatpump
    heater: switch.heat_pump
    target_sensor: sensor.study_temperature

As you can see, it is pretty basic. The temperature sensor in the target room. Next we have the switch. As mentioned by @stomko, that could be a relay, but it can also be the current heat pump thermostat inside a Template Switch. So in effect, you have a HA thermostat controlling the heat pump thermostat with two settings. And you get to choose if the HA switch off is actually off or just a lower setpoint. Start with the example in the docs (have taken a stab in the dark)

# Example configuration.yaml entry
switch:
  - platform: template
    switches:
      heat_pump:
        value_template: "{{ is_state_attr('climate.heat_pump', 'hvac_action','heating') }}"
        turn_on:
          service: climate.set_temperature
          target:
            entity_id: climate.heat_pump
           data:
            temperature: 25
        turn_off:
          service: climate.set_temperature
          target:
            entity_id: climate.heat_pump
          data:
            temperature: 15

I have Daikin Altherma heatpump (air-water) that basically has the following control panel:

image

This control panel can serve as indoor thermostat and control unit (if installed in room), or it can be just used as control unit of Daikin. In my setup, it is on the unit in technical room, so I have it set as control unit only. The heating then can be configured either to use 1) external thermostat or 2) based on water temperature differences.

It was some time ago that I set this up, so basically mode 1) relays on external thermostat that switches certain contacts on heatpump (in my case, it is fibaro relay that switches those contacts, it has dry contacts), mode 2) works on sampling and checking in intervals leaving/coming water temperature.
I have no way of controlling daikin’s setpoints nor control it in any other way other than switching external relay.

This is something you need to configure on your heatpump. I set it to external thermostat + I adjusted heating curve, so for instance when it is -10 outside, water is heated to 35 degrees, while when it is 10 outside, it heats water to 29. This saves energy as you don’t need to heat water too much when it is not that cold outside.

After that, it is easy.
Main question is - do you want multi zone heating, or not. If you are fine with one thermostat (basically here, thermostat means combination of temperature sensor + actor, some sort of switch). If yes, you can go with generic thermostat (as described above) but my experience is - with concrete underfloor heating which is slow to react, it has high overshoot. So at the time you get to desired temperature and switch will turn off, concrete is full of energy that will continue to increase interior temperature, so your temperature will rise.
Alternatively, you can go with https://github.com/vindaalex/multizone-thermostat that has PID controller.

If you want multizone, then your thermostats won’t switch heatpump, but switches that control your valves that open/close coming hot water to your zones. Therefore you need additional logic to signal heater to supply heat. Although multizone thermostat allows that directly, I found automation in HA to be easier, better and more adjustable.

Here is example of configuration of one of my rooms:

- platform: multizone_thermostat
  name: bathroom
  sensor: sensor.bathroom_temperature
  sensor_filter: 2
  room_area: 10
  initial_hvac_mode: "heat"
  initial_preset_mode: "none"
  precision: 0.1
  heat:
    entity_id: switch.underfloor_heating_bathroom
    min_temp: 17
    max_temp: 28
    initial_target_temp: 20
    away_temp: 17
    proportional_mode:
      control_interval:
        seconds: 180
      difference: 100
      minimal_diff: 5
      pwm:
        hours: 2
      PID_mode:
        kp: 100
        ki: 0.003
        kd: -220000
  sensor_stale_duration:
    hours: 12
  restore_from_old_state: False
  restore_parameters: False
  restore_integral: False

On my particular heatpump, external thermostat switches terminals 1 and 4 on connector X2M
X2M:

And connectors 1 and 4 that are switched by Fibaro Relay Switch (contacts IN and Q, L and N are 230V to power the relay itself). When closed (switch turned on), it signals Daikin that there is demand for heat from external thermostat). Within the relay, I set auto-off in 15 minutes as a “fail safe” if there is no action from HA, so that it does not heat indefinitely.

1 Like

Thanks! Was reading the document, and also this YouTube guide:

But there he make its own folder called “climate” where he made the thermostat-code in its own yaml-file.
What is diffrent from that and to put the core in the configuration.yaml? That part I dont quite get.
And the switch he made in Automation where he made one on and one off. Is that also the same as putting that code you did in the configuration-file?

within configuration.yaml, you have following:

climate: !include climate.yaml

That just says to look for climate configuration in other file. The only benefit (notable if you ask me) is that your configuration.yaml does not get filled with bunch of config, instead it sits in its own file. Just look above for my configuration, multiply it by 7 zones I have in house. It is just nicer to keep it separate. Anyhow, climate can’t be reloaded separately, so to make any changes to thermostat, you need to reload core anyway (unless you use calls dedicated to climate, if there are any)

1 Like

Interesting! Thanks for sharing your setup! The Daikin pump I have is a Air-pump so it heats just by flowing air into the house. And I dont a pure wooden house so I dont think there is much energy saved in the components in the house like in concrete?
And I dont really know if this setup is the way to go for me but I think something like this would be good for the climate and for the energy.
Again, thanks for sharing!

Ah ok then I get it! But when I do create that Generic Thermostat, shouldnt my Thermostat Card have a new entity? The one I just created for me to choose? I still only see the original one. Am I doing something wrong?

Do you see your new thermostat in developer tools - states? Did you try adding “Thermostat” card in your dashboard and configure that new climate entity in it?

Hm, no its not there! I made a folder “climate” in config. In that folder I created “generic_thermostat.yaml” and in that file I did this code:

  • platform: generic_thermostat
    name: test_ny
    heater: switch.värmestyrning
    target_sensor: sensor.kok_temperature
    min_temp: 7
    max_temp: 35
    ac_mode: false
    target_temp: 22
    cold_tolerance: 0.5
    hot_tolerance: 0
    initial_hvac_mode: “off”
    away_temp: 20
    precision: 0.1

Is something wrong there maybe?

Hm I dont see this line “climate” in my configuration.yaml ! is that the problem?

Climate is in configuration.yaml and refers to separate file (usually climate.yaml in the same root folder where configuration.yaml is). See my note above.

If that’s the case, just put your config in that file. Or if it is not, just create that reference, or just put your whole code in the configuration.yaml

So either put this in configuration.yaml:

climate:
 - platform: generic_thermostat
   name: test_ny
   heater: switch.värmestyrning
   target_sensor: sensor.kok_temperature
   min_temp: 7
   max_temp: 35
   ac_mode: false
   target_temp: 22
   cold_tolerance: 0.5
   hot_tolerance: 0
   initial_hvac_mode: “off”
   away_temp: 20
   precision: 0.1

or make a reference in configuration.yaml to look for climate configuration elswhere:

climate: !include climate.yaml

and create file climate.yaml in the same root folder where configuration.yaml is. That file will contain then:

- platform: generic_thermostat
  name: test_ny
  heater: switch.värmestyrning
  target_sensor: sensor.kok_temperature
  min_temp: 7
  max_temp: 35
  ac_mode: false
  target_temp: 22
  cold_tolerance: 0.5
  hot_tolerance: 0
  initial_hvac_mode: “off”
  away_temp: 20
  precision: 0.1

Don’t forget to check configuration and reload core (in server controls) after you add it.

PS: I would not name your file generic_thermostat as there could be other climate components later, not just generic thermostat. And I would definitely not put it in additional folder, no reason to do that at all.

2 Likes

Ah right! Now it working :slight_smile: Thanks. Ok that sounds like a plan to name if to something more unique?
Oh and also the system didnt like my Å Ä Ö :stuck_out_tongue:

Ok so now I have the new Thermostat, now to go for the switch!.. but btw… since I now have 2… wich one is the one who is controlling the pump?

edit: btw if I dont name the platform “generic_thermostat” I get an error!

About the Switch, I tried use the Automations in HA. There I could easy choose triggers, conditions and actions. But about actions, this is where I want it to lower/raise the set temperature right?
If I select Device > my pump I have 2 actions to choose from, “change HVAC mode on Daikin” and “change preset on Daikin” … tried here to add your code:
turn_off:
service: climate.set_temperature
target:
entity_id: climate.heat_pump
data:
temperature: 15

but that didnt work.

The idea isn’t to use an automation. The generic thermostat controls it.