I have a heat pump, but two factors has made me want to let HA get control of it:
- The heat pump thermostat is really quite poor, and will result in wildly varying indoor temperatures.
- Partly due to this, my wife handles the remote a lot, and tends to overcorrect somewhat… (Hello Antarctica!)
So I did a bit of research and found this library:
His libraries work with ESPEasy, and since I had a NodeMCU lying about, I managed to get that working with HA, connected a BME280 temp/humidity/pressure sensor, and a transistor-activated IR LED.
To go with HA’s newfound control of my heatpump, I made a manual control panel for it, and an automation that adjusts the heatpump settings to attain the desired living room temperature.
PS: Sorry for the norwegian everywhere, I couldn’t be bothered to translate it, but I think the automations should explain it if you are trying to do something similar:)
The results aren’t perfect, but it’s a lot better than I’m used to:)
(It’s been running since about 14:00 in this graph.)
One of the main reasons it fluctuates a bit is that I’m only letting it change settings every 5 minutes, mostly to prevent the heat pump from being too annyoing as it goes beep every time it receives a command.
My config looks like this:
input_select:
varmepumpe_mode:
name: Modus
options:
- "Auto"
- "Varme"
- "Kjøling"
- "Avfukting"
- "Vifte"
icon: mdi:air-conditioner
input_slider:
varmepumpe_temp:
name: Temperatur
initial: 21
min: 16
max: 30
step: 1
icon: mdi:thermometer
varmepumpe_vifte:
name: Viftehastighet (0=Auto)
initial: 0
min: 0
max: 5
step: 1
icon: mdi:fan
varmepumpe_retning:
name: Luftretning (0=Auto)
initial: 0
min: 0
max: 5
step: 1
icon: mdi:weather-windy
stue_temperatur:
name: Ønsket temperatur stue
initial: 25
min: 16
max: 30
step: 1
icon: mdi:thermometer
automation old varmepumpe_send:
alias: Varmepumpe Send
trigger:
platform: state
entity_id: input_boolean.varmepumpe_send
from: 'off'
to: 'on'
action:
- service: mqtt.publish
data:
topic: "/espeasy01/cmd"
payload_template: "heatpumpir,panasonic_dke,{% if states.input_boolean.varmepumpe_onoff.state == 'on' %}1{% elif states.input_boolean.varmepumpe_onoff.state == 'off' %}0{% endif %},{% if states.input_select.varmepumpe_mode.state == 'Auto' %}1{% elif states.input_select.varmepumpe_mode.state == 'Varme' %}2{% elif states.input_select.varmepumpe_mode.state == 'Kjøling' %}3{% elif states.input_select.varmepumpe_mode.state == 'Avfukting' %}4{% elif states.input_select.varmepumpe_mode.state == 'Vifte' %}5{% endif %},{{states.input_slider.varmepumpe_vifte.state|int}},{{states.input_slider.varmepumpe_temp.state|int}},{{states.input_slider.varmepumpe_retning.state|int}},0"
- service: homeassistant.turn_off
entity_id: input_boolean.varmepumpe_send
automation old stue_termostat_opp:
alias: Varmepumpetemperatur opp
trigger:
platform: time
minutes: '/10'
seconds: 00
condition:
condition: template
value_template: '{{ states.sensor.temperature.state | float - states.input_slider.stue_temperatur.state | float < 0.5 }}'
action:
- service: input_slider.select_value
data_template:
entity_id: input_slider.varmepumpe_temp
value: '{{ states.input_slider.varmepumpe_temp.state | float + 1 }}'
- service: mqtt.publish
data:
topic: "/espeasy01/cmd"
payload_template: "heatpumpir,panasonic_dke,{% if states.input_boolean.varmepumpe_onoff.state == 'on' %}1{% elif states.input_boolean.varmepumpe_onoff.state == 'off' %}0{% endif %},{% if states.input_select.varmepumpe_mode.state == 'Auto' %}1{% elif states.input_select.varmepumpe_mode.state == 'Varme' %}2{% elif states.input_select.varmepumpe_mode.state == 'Kjøling' %}3{% elif states.input_select.varmepumpe_mode.state == 'Avfukting' %}4{% elif states.input_select.varmepumpe_mode.state == 'Vifte' %}5{% endif %},{{states.input_slider.varmepumpe_vifte.state|int}},{{states.input_slider.varmepumpe_temp.state|int}},{{states.input_slider.varmepumpe_retning.state|int}},0"
automation old stue_termostat_ned:
alias: Varmepumpetemperatur ned
trigger:
platform: time
minutes: '/10'
seconds: 00
condition:
condition: template
value_template: '{{ states.sensor.temperature.state | float - states.input_slider.stue_temperatur.state | float > 0.5 }}'
action:
- service: input_slider.select_value
data_template:
entity_id: input_slider.varmepumpe_temp
value: '{{ states.input_slider.varmepumpe_temp.state | float - 1 }}'
- service: mqtt.publish
data:
topic: "/espeasy01/cmd"
payload_template: "heatpumpir,panasonic_dke,{% if states.input_boolean.varmepumpe_onoff.state == 'on' %}1{% elif states.input_boolean.varmepumpe_onoff.state == 'off' %}0{% endif %},{% if states.input_select.varmepumpe_mode.state == 'Auto' %}1{% elif states.input_select.varmepumpe_mode.state == 'Varme' %}2{% elif states.input_select.varmepumpe_mode.state == 'Kjøling' %}3{% elif states.input_select.varmepumpe_mode.state == 'Avfukting' %}4{% elif states.input_select.varmepumpe_mode.state == 'Vifte' %}5{% endif %},{{states.input_slider.varmepumpe_vifte.state|int}},{{states.input_slider.varmepumpe_temp.state|int}},{{states.input_slider.varmepumpe_retning.state|int}},0"