Daikin Altherma 3 Heat Pump, Home Assistant, Emoncms and heatpumpmonitor.org

I have finally got my ESPAltherma configuration set up. I wanted to get my heat pump data published to heatpumpmonitor.org. By default it will default to 72 days. You will need to lower that to see my site. My site is, Buntingford, Hertfordshire, or use this link.

I am using an M5 Tough as my M5Stack connection. The M5 Tough is not currently supported in the main branch of ESPAltherma, I used this fork. I also have a Shelly Pro EM 50A. This has two CT clamps. One is monitoring the immersion feed and the other heat pump feed. The Shelly was really easy to add to the network. I followed these instructions. I used the web version. I installed the Shelly Integration in Home Assistant.

Following Oliver’s video from Speak To The Geek, I setup Home Assistant to receive the feed from the M5 Tough. He and others are much better at explaining ESPAltherma than I am. Oliver has also made this video about the Daikin Onecta API. This will be used for the target room temperature.

You will need an account at Emoncms. There you will make a web application that you publish via heappumpmonitor.org. There is a small charge per feed to use Emoncms. For me, it will be around £15 per year.

Below are the heat pump sensors I made by adding them to my config.yaml file.

template:
  - binary_sensor:
# Heat Pump code
      - name: "ESPAltherma - 3way valve(On:DHW_Off:Space)"
        unique_id: espaltherma_threewayvalve
        device_class: power
        icon: mdi:valve
        state: >
            {{ state_attr('sensor.althermasensors','3way valve(On:DHW_Off:Space)') }}
            
      - name: "ESPAltherma - 4 Way Valve"
        unique_id: espaltherma_fourwayvalve
        device_class: power
        icon: mdi:valve
        state: >
            {{ state_attr('sensor.althermasensors','4 Way Valve') }}
            
      - name: "ESPAltherma - Main pump"
        unique_id: espaltherma_mainpump
        device_class: power
        icon: mdi:valve
        state: >
            {{ state_attr('sensor.althermasensors','Main pump') }}   
            
            
  - sensor:      
        
# Heat pump sensors
    # ===============================================================
    # Daikin Altherma ASHP Sensors from ESPAltherma
      - name: ESPAltherma - Operation Mode
        unique_id: espaltherma_operationmode
        state: "{{ state_attr('sensor.althermasensors','Operation Mode') }}"
        
      - name: ESPAltherma - Freeze Protection
        unique_id: espaltherma_freezeprotection
        state: "{{ state_attr('sensor.althermasensors','Freeze Protection') }}"
 
       
      - name: ESPAltherma - Outdoor Air Temperature
        unique_id: espaltherma_outdoorairtemp
        state: "{{ state_attr('sensor.althermasensors','R1T-Outdoor air temp.') }}"
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        
      - name: ESPAltherma - Indoor Air Temperature
        unique_id: espaltherma_indoorairtemp
        state: "{{ state_attr('sensor.althermasensors','Indoor ambient temp. (R1T)') }}"
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        
      - name: ESPAltherma - Ext. indoor ambient sensor (R6T)
        unique_id: espaltherma_extindoorambientsensor
        state: "{{ state_attr('sensor.althermasensors','Ext. indoor ambient sensor (R6T)') }}"
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        
      - name: ESPAltherma - LW setpoint (main)
        unique_id: espaltherma_lwsetpointmain
        state: "{{ state_attr('sensor.althermasensors','LW setpoint (main)') }}"
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        
      - name: ESPAltherma - Hot Water Tank Temperature
        unique_id: espaltherma_hotwatertemp
        state: "{{ state_attr('sensor.althermasensors','DHW tank temp. (R5T)') }}"
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        
      - name: ESPAltherma - Leaving Water Temperature Before BUH
        unique_id: espaltherma_leavingwatertempbeforebuh
        state: "{{ state_attr('sensor.althermasensors','Leaving water temp. before BUH (R1T)') }}"
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"    
        
      - name: ESPAltherma - Inlet Water Temperature
        unique_id: espaltherma_inletwatertemp
        state: "{{ state_attr('sensor.althermasensors','Inlet water temp.(R4T)') }}"
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"  
        
      - name: ESPAltherma - Water Pressure
        unique_id: espaltherma_waterpressure
        state: "{{ state_attr('sensor.althermasensors','Water pressure') }}"
        state_class: measurement
        device_class: pressure
        unit_of_measurement: "bar"    
        
      - name: ESPAltherma - Flow Sensor
        unique_id: espaltherma_flowsensor
        state: "{{ state_attr('sensor.althermasensors','Flow sensor (l/min)') }}"
        state_class: measurement
        unit_of_measurement: "l/min" 
      
      - name: ESPAltherma - Fan Speed
        unique_id: espaltherma_fanspeed
        state: "{{ state_attr('sensor.althermasensors','Fan 1 (step)')|int * 10 }}"
        state_class: measurement
        unit_of_measurement: "rpm" 
        
      - name: ESPAltherma - Heat Power Out
        unique_id: espaltherma_heatpowerout
        state: "{{ (((state_attr('sensor.althermasensors','Flow sensor (l/min)')| float / 60) * 4.1816 * (state_attr('sensor.althermasensors','Leaving water temp. before BUH (R1T)') | float - state_attr('sensor.althermasensors','Inlet water temp.(R4T)')|float) )) |round(2) }}"
        state_class: measurement
        device_class: power
        unit_of_measurement: "kW"    
        
      - name: ESPAltherma - COP
        unique_id: espaltherma_cop
        unit_of_measurement: 'COP'
        state_class: measurement
        state: >
         {% if is_state_attr('sensor.althermasensors','Operation Mode', 'Heating') and is_state_attr('sensor.althermasensors','Freeze Protection', 'OFF')  %}
           {{ ( states('sensor.espaltherma_heat_power_out')|float / (states('sensor.heat_pump_power')|float/1000))|round(2) }}
         {% else -%}     
           0
         {% endif %}
         
      - name: ESPAltherma - Fin Temp. Drop Control
        unique_id: espaltherma_fintempdropcontrol
        state: "{{ state_attr('sensor.althermasensors','Fin Temp. Drop Control') }}"
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"  
        
      - name: ESPAltherma - Heat Exchanger Mid-Temp
        unique_id: espaltherma_heatexchangermidtemp
        state: "{{ state_attr('sensor.althermasensors','Heat exchanger mid-temp.') }}"
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        
      - name: ESPAltherma - (Raw data)Water heat exchanger inlet temp.
        unique_id: espaltherma_waterheatexchangerinlettemp
        state: "{{ state_attr('sensor.althermasensors','(Raw data)Water heat exchanger inlet temp.') }}"
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        
      - name: ESPAltherma - (Raw data)Water heat exchanger outlet temp.
        unique_id: espaltherma_waterheatexchangeroutlettemp
        state: "{{ state_attr('sensor.althermasensors','(Raw data)Water heat exchanger outlet temp.') }}"
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        
      - name: ESPAltherma - Refrigerant pressure sensor
        unique_id: espaltherma_refriferantpressuresensor
        state: "{{ state_attr('sensor.althermasensors','Refrigerant pressure sensor') }}"
        state_class: measurement
        device_class: pressure
        unit_of_measurement: "bar"

One of the values the application will require is the target room temperature. This is harder to get than you may think. I have the Daikin Onecta integration installed. This will return the target room temperature for the system, but only as an attribute. I added this code to the config.yaml to make a sensor I could use in the application.

sensor:
  - platform: template
    sensors:
# Target Room Temperature
      altherma_target_room_temperature:
        friendly_name: "Altherma Target Room Temperature"
        unit_of_measurement: "°C"
        value_template: "{{ state_attr('climate.altherma_room_temperature_2', 'temperature') }}"

These are the lines I uncommented in the the Altherma(EBLA-EDLA D series 4-8kW Monobloc).h which is the file for my model of heat pump. The lines that have //new on the end are extra feeds the Octopus engineer thought would also be interesting. These are not part of Oliver’s configuration.

#include "labeldef.h"
//  This file is a definition file for ESPAtherma
//  uncomment each value you want to query for your installation.

{0x10,0,217,1,-1,"Operation Mode"},
{0x10,1,304,1,-1,"Defrost Operation"},
{0x10,12,307,1,-1,"Fin Temp. Drop Control"}, // New
{0x20,0,105,2,1,"R1T-Outdoor air temp."},
{0x20,8,105,2,1,"Heat exchanger mid-temp."}, // new
{0x21,0,105,2,-1,"INV primary current (A)"},
{0x21,2,105,2,-1,"INV secondary current (A)"},
{0x30,0,152,1,-1,"INV frequency (rps)"},
{0x30,1,211,1,-1,"Fan 1 (step)"},
{0x30,11,307,1,-1,"4 Way Valve"}, //new
{0xA1,0,119,2,1,"(Raw data)Water heat exchanger inlet temp."}, //new
{0xA1,2,119,2,1,"(Raw data)Water heat exchanger outlet temp."},//new
{0x60,2,303,1,-1,"Thermostat ON/OFF"},
{0x60,2,302,1,-1,"Freeze Protection"},
{0x60,7,105,2,1,"DHW setpoint"},
{0x60,9,105,2,1,"LW setpoint (main)"},
{0x60,12,306,1,-1,"3way valve(On:DHW_Off:Space)"},
{0x61,2,105,2,1,"Leaving water temp. before BUH (R1T)"},
{0x61,4,105,2,1,"Leaving water temp. after BUH (R2T)"},
{0x61,8,105,2,1,"Inlet water temp.(R4T)"},
{0x61,10,105,2,1,"DHW tank temp. (R5T)"},
{0x61,12,105,2,1,"Indoor ambient temp. (R1T)"},
{0x61,14,105,2,1,"Ext. indoor ambient sensor (R6T)"},
{0x62,2,304,1,-1,"Powerful DHW Operation. ON/OFF"},
{0x62,2,303,1,-1,"Space heating Operation ON/OFF"},
{0x62,8,302,1,-1,"Circulation pump operation"},
{0x62,9,105,2,-1,"Flow sensor (l/min)"},
{0x62,11,105,1,2,"Water pressure"},
{0x62,15,105,2,2,"Refrigerant pressure sensor"}, //new
{0x63,14,161,1,-1,"Current measured by CT sensor of L1"},
{0x63,15,161,1,-1,"Current measured by CT sensor of L2"},
{0x63,16,161,1,-1,"Current measured by CT sensor of L3"},
{0x64,9,301,1,-1,"Main pump"}, //new

You will need to make an Emoncms API key. I added this code to my config.yaml in Home Assistant. Pick a node number. The sensors you need to send are added to the whitelist. Notice that I am sending my weather station sensor. The heat pump outside temperate sensor only updates when the heat pump is running. Some of these sensors aren’t used, but as you only pay for the feeds and not the inputs, I left them in.

# Emoncms Integration
emoncms_history:
  api_key: <api key>
  url: https://emoncms.org
  inputnode: <node number>
  whitelist:
    - sensor.heat_pump_daily_utility_meter
    - sensor.espaltherma_flow_sensor
    - sensor.espaltherma_indoor_air_temperature
    - sensor.espaltherma_inlet_water_temperature
    - sensor.espaltherma_leaving_water_temperature_before_buh
    - sensor.heat_pump_power
    - sensor.espaltherma_heat_power_out
    - sensor.espaltherma_outdoor_air_temperature
    - sensor.espaltherma_lw_setpoint_main
    - binary_sensor.espaltherma_3way_valve_on_dhw_off_space
    - sensor.ibunti22_temperature
    - sensor.altherma_target_room_temperature

Once you have rebooted Home Assistant, the inputs should immediately appear in Emoncms. At this point there will be none of the logs assigned.

List of inputs in Emoncms sent from Home Assistant and there logging status

You will now need to map these to feeds. Click on the input and you will see the options below. Note the log, kwh and +inp icons. They are buttons and will be used for some feeds.

Give the feed a name and an update time. You can see my update times below. Some of the feeds below are not used. These were made when I was trying to get it working. These can be removed to reduce the cost.

Logging an input

You can see two of the inputs have multiple logging options

  • sensor.heat_pump_power

  • sensor.espaltherma_leaving_water_temperature_before_buh

Below shows how these are set up. Click on the kwh icon and the option will change. Give the feed a name and click add

Logging to more than one feed

sensor.espaltherma_leaving_water_temperature_before_buh is a bit more complex. This is a calculation that then logs to a feed. Click on the +inp icon. You can then add the input from the pull down your require. This is creating two feeds that are not coming directly from the Home Assistant sensors.

Creating feeds from a calculation

+inp pull down options

All the feed and refresh times

You now you need to make an application in Emoncms. This will be shared with heatpumpmonitor.org. Click on Apps at the top of the page and click new and My Heatpump from the list. You will see a list of fields on the right hand side. These need to be mapped to the feeds.

My Heatpump app field list

Below are my mappings between Home Assistant sensors, Emoncms Feeds and the application.

Input, Feeds and App Mappings

Home Assistant Sensor (Inputs) Emoncms Application
sensor.espaltherma_flow_sensor heatpump_flowrate Flow Rate
sensor.espaltherma_indoor_air_temperature heatpump_room Room Temperature
sensor.espaltherma_inlet_water_temperature heatpump_return Return Temperature
sensor.espaltherma_leaving_water_temperature_before_buh heatpump_leaving_water_temperature_before_buh Flow temperature
sensor.heat_pump_power heatpump_elec_watts Electric use in watts
Calculation heatpump_elec_kwh_v3 Cumulative electric use kWh
sensor.espaltherma_heat_power_out Not Used Not Used
sensor.espaltherma_outdoor_air_temperature heatpump_room Not Used
sensor.espaltherma_lw_setpoint_main Not Used Not Used
binary_sensor.espaltherma_3way_valve_on_dhw_off_space heatpump_dhw_3way_valve Status of Hot Water circuit (non-zero when running)
sensor.ibunti22_temperature heatpump_outside_temp_weather_station Outside temperature
sensor.altherma_target_room_temperature heatpump_target_temp Target (Room or Flow) Temperature
Calculation heatpump_heat_buh_kWh Cumulative heat output in kWh
Calculation heatpump_heat_buh Heat output in watts

Now you can launch the application and copy the URL. This is the URL you will add to the heatpumpmonitor.org.

Go to heatpumpmonitor.org and add a system. There is a form to fill in about your system. Your application will then go for approval to the admins.

heatpumpmonitor.org form

After a few days your site will default to this view. The reason the left hand bar has no blue in because I tried to use a Home Assistant utility meter. In the end I used sensor.heat_pump_power and a Emoncms calculation to calculate the kWh. After that all was good.

My application after 5 days, 4 of which were working

A full 24 hours of data. 1st September 2024

 
Michael Curtis

My introduction to computers started at my middle school in 1981 when our maths teacher brought in a ZX80. That led the computer club being founded and using a Research Machine 380Z

My first computer was a 48K ZX Spectrum which I loved to programme. Once I left school I worked as a photocopier engineer, then a fax engineer and finally moving on the Apple computers.

For the next 30 years I worked as a system administrator. I now work in the cyber security industry as a Sophos Professional Services consultant

https://www.bazmac.me
Previous
Previous

Using Ormanäs smart light strip with Home Assistant

Next
Next

August Solar Generation and Export Numbers