Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Community post] Show your ESPAltherma! #17

Open
raomin opened this issue Jan 21, 2021 · 263 comments
Open

[Community post] Show your ESPAltherma! #17

raomin opened this issue Jan 21, 2021 · 263 comments

Comments

@raomin
Copy link
Owner

raomin commented Jan 21, 2021

ESPAltherma Community post!

ESPAltherma is used all over the world! well... mostly in Europe... mainly in Germany ;)
Let's show each other what we did with ESPAltherma!
This will be nice to see, and will helpnew users can see what can be done with it!

Please post in this issue a small description of your installation with ESPAltherma.

PLEASE DO NOT USE THIS PAGE TO REPORT ISSUE
If you have a real problem with your ESPAltherma, please open a new issue.

Each post should contain the following information:

Model and option

  • Daikin / ROTEX model
  • ESP32 board type
  • if you use the relay or not, the Daikin LAN controller, a custom device on P1P2 etc...

View of your PCB / ESP32

just copy a picture and paste it

Monitoring / control

just copy a picture and paste it

  • Describe the solution components (Home Assistant, ioBroker, Graphana etc.)

Any other info

  • specific hacks, tips/tricks, future project etc.
  • location, contact information (optional)
  • ...
@raomin
Copy link
Owner Author

raomin commented Jan 21, 2021

Model and option

  • Daikin Altherma 3 EAVX-D6V + EPGA016DV. Underfloor heating + cooling (maybe) + DHW
  • M5StickC
  • Relay as external thermostat

PCB / ESP32

image

Monitoring & Control

image

  • Home Assistant
  • Home made MQTT ESP thermometer (DS18b20) to feed the climate entity

Any other info

  • First user of ESPAltherma :)
  • Future plans: integrate energy limiting modes to ESPAltherma to better leverage peak/off-peak hours (could be used for smart grid also), read about other optimizations - eg avoiding defrost.
  • FR, raomin [at] protonmail.com

@KalaNagHTD
Copy link

KalaNagHTD commented Jan 22, 2021

Model and option

  • Rotex HPSU Ultra = Daikin Altherma ECH2O = R(E)HSX08(06)P50(30)D2 + R(E)RGA08(06)DAV3
    („R“ = Rotex, „E“ = Daikin, „08“ or „06“ = rated power, „50“ or „30“ = DHW capacity x 10)
  • M5StickC
  • pyHPSU and CAN for the valve positions and water pressure only (not available on X10A)

PCB / ESP32

IMG_6635
Position of X10A service connector on the PCB

Zwischenablage01
Power supply by USB charger (not final)

Monitoring and control

5852E577-6B5B-4925-9791-C6A30BFC4173

  • I use ioBroker to collect and display the data
  • Each value shown here is a table widget in ioBroker Vis

With support from the ioBroker community I have built a script that derives data objects from the JSON string. With these objects I can do calculations such as thermal power, electrical power and COP.
https://forum.iobroker.net/topic/41289/gelöst-json-tabelle-in-datenobjekte-auflösen-javascript/9

@raomin
Copy link
Owner Author

raomin commented Jan 23, 2021

Good idea! We have indeed everything we need for the COP.
I've just added it to mine.
image

Do you confirm the formula?

  ((state_attr('sensor.altherma','Flow sensor (l/min)')| float * 0.06 * 1.16 * (state_attr('sensor.altherma','Leaving water temp. after BUH (R2T)') | float - state_attr('sensor.altherma','Inlet water temp.(R4T)')|float) )
    /
  (state_attr('sensor.altherma','INV primary current (A)') | float * 250 / 1000))

I'll add it to the readme.

@KalaNagHTD
Copy link

KalaNagHTD commented Jan 23, 2021 via email

@misko903
Copy link

Guys, this is awesome. I hope I will get so far one day... Mine want to be OpenHAB with Meteostick. Waiting for the parts now.

@stosoorok
Copy link

stosoorok commented Jan 25, 2021

My ESPAltherma setup: ESP32-WROOM-32D, Daikin EHBX08DA9W (ALTHERMA(LT_DA_04-08KW).h),

Home Assistant OS on Proxmox:

image

Lovelace Daikin page:

image

Daikin X10A connection:

image

ESP32-WROOM-32D:

image

@KalaNagHTD
Copy link

KalaNagHTD commented Jan 26, 2021

Fine!
I see with a Daikin I/U (not HPSU / ECH2O) you can get the water pressure.

@pengemetal
Copy link

All fine except you should use the „Leaving water temp. before BUH(R1T)“. So you can monitor the COP while heating DHW too. And: The Voltage 250V is a bit high! Best is you take the „Voltage (N-phase) (V)“ for calculation (about 230V).

Am 23.01.2021 um 17:45 schrieb Raomin @.***>:  Good idea! We have indeed everything we need for the COP. I've just added it to mine. Do you confirm the formula? ((state_attr('sensor.altherma','Flow sensor (l/min)')| float * 0.06 * 1.16 * (state_attr('sensor.altherma','Leaving water temp. after BUH (R2T)') | float - state_attr('sensor.altherma','Inlet water temp.(R4T)')|float) ) / (state_attr('sensor.altherma','INV primary current (A)') | float * 250 / 1000)) I'll add it to the readme. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Hi,

My „Voltage (N-phase) (V)“ is always 0.00000 I dont know why? I rewrite the COP sensor fix 228 value but sensor is still unavailable, log said: TemplateError('ZeroDivisionError: float division by zero') while processing template 'Template("{{ ((state_attr('sensor.althermasensors','Flow sensor (l/min)')| float * 0.06 * 1.16 * (state_attr('sensor.althermasensors','Leaving water temp. before BUH (R1T)') | float - state_attr('sensor.althermasensors','Inlet water temp.(R4T)')|float) ) / (state_attr('sensor.altherma','INV primary current (A)') | float * 228 / 1000)) |round(2) }}")' for attribute '_state' in entity 'sensor.espaltherma_cop'
One more question: how do you calculate "Elektr. - und Thermische Leistung"? Thx in advance

@raomin
Copy link
Owner Author

raomin commented Jan 27, 2021

My „Voltage (N-phase) (V)“ is always 0.00000 I dont know why?

First, my sensor is called sensor.altherma. Yours is probably sensor.althermasensor.

You changed most of them but the 'INV primary current (A)' one is still sensor.altherma in your formula.

If it's not this, there are 2 possible definitions for „Voltage (N-phase) (V)“ 0x21,2,101,2 and 0x21,4,101,2. You can try with the one you are not using now.

Second, 'INV primary current (A)' is 0 when the heat pump is not heating. To avoid ZeroDivisionError when the heat pump is off you can extend the formula like this:

{% if is_state_attr('sensor.althermasensors','Operation Mode', 'Heating') and is_state_attr('sensor.althermasensors','Freeze Protection', 'OFF')  %} 
{{ 
  ((state_attr('sensor.althermasensors','Flow sensor (l/min)')| float * 0.06 * 1.16 * (state_attr('sensor.althermasensors','Leaving water temp. before BUH (R1T)') | float - state_attr('sensor.althermasensors','Inlet water temp.(R4T)')|float) )
    /
  (state_attr('sensor.althermasensors','INV primary current (A)') | float * state_attr('sensor.althermasensors','Voltage (N-phase) (V)')|float / 1000))
  |round(2)
}}
{% else %} 0 {%endif%}

Like this, the formula will be calculated only when state_attr('sensor.althermasensors','Operation Mode') is Heating

One more question: how do you calculate "Elektr. - und Thermische Leistung"? Thx in advance

I'm not sure what you are after but Google translated it as electric and thermal performance.
This is the ratio done in the formula.
Thermal performance is the Delta temperature x flow (l/min x 0.06 is m3/h) x thermal capacity of water which is 1.16

--
If this project has value for you, please consider supporting it. I don't do this for money but it feels good to get some support! Thanks :)

@m-reuter
Copy link
Contributor

Hi @pengemetal
(I used the german names, but you can lookup the english easily in the files):

      espaltherma_electrial:
        friendly_name: "Electrical"
        value_template: "{{ state_attr('sensor.althermasensors','INV Primärstrom (A)')  | float * 0.23 }}"
        unit_of_measurement: 'kW'
      espaltherma_rl:
        friendly_name: "Rücklauf Temp"
        value_template: "{{ state_attr('sensor.althermasensors','R4T-Wasser Rücklauftemp. vor dem Plattenwärmetauscher') }}"
        unit_of_measurement: '°C'
      espaltherma_vl1:
        friendly_name: "Vorlauf Temp1"
        value_template: "{{ state_attr('sensor.althermasensors','Auslass Wasser Wärmetauscher Temp. (R1T)') }}"
        unit_of_measurement: '°C'
      espaltherma_durchfluss:
        friendly_name: "Durchfluss"
        value_template: "{{ state_attr('sensor.althermasensors','Durchflussmenge (l/min)') | int * 60 }}"
        unit_of_measurement: 'l/h'
      espaltherma_wl:
        friendly_name: "Wärmeleistung"
        value_template: "{{ ( states('sensor.espaltherma_vl1') | float - states('sensor.espaltherma_rl') | float ) * 0.001163 * states('sensor.espaltherma_durchfluss')  | float}}"
        unit_of_measurement: 'kW'
      espaltherma_cop:
        friendly_name: "COP"
        value_template: "{{ (  ( states('sensor.espaltherma_wl') | float *  states('sensor.espaltherma_invstrom') | float ) / ( states('sensor.espaltherma_invstrom') | float  * states('sensor.espaltherma_invstrom') | float + 0.0001 ) ) | round(2) }}"

COP is just: thermal / electrical
here I did a trick to multiply both numerator and denominator by electrical and add an epsilon to the denominator to avoid division by zero. And to have zero COP if electrical usage is 0.

@stosoorok
Copy link

Yesterday I saw COP -19.43 :) Something fishy about the formula?

image

@pengemetal
Copy link

{% if is_state_attr('sensor.althermasensors','Operation Mode', 'Heating') and is_state_attr('sensor.althermasensors','Freeze Protection', 'OFF')  %} 
{{ 
  ((state_attr('sensor.althermasensors','Flow sensor (l/min)')| float * 0.06 * 1.16 * (state_attr('sensor.althermasensors','Leaving water temp. before BUH (R1T)') | float - state_attr('sensor.althermasensors','Inlet water temp.(R4T)')|float) )
    /
  (state_attr('sensor.althermasensors','INV primary current (A)') | float * state_attr('sensor.althermasensors','Voltage (N-phase) (V)')|float / 1000))
  |round(2)
}}
{% else %} 0 {%endif%}

Hi Guys,

Thank you for all of your help. I changed Voltage to 0x21,2,101,2 and it is working! But it is interesting values are between 110-117 V. I have not rewritten the if parameter yet, I used the original code.

@KalaNagHTD
Copy link

KalaNagHTD commented Jan 27, 2021

I changed Voltage to 0x21,2,101,2 and it is working! But it is interesting values are between 110-117 V.

It depends on the country you live!?

@raomin
Copy link
Owner Author

raomin commented Jan 27, 2021

Yesterday I saw COP -19.43 :) Something fishy about the formula?

You'll have this negative value when your heat pump is defrosting. It warms up the exchanger, hence giving a very negative heating performance...!

@pengemetal
Copy link

I live in Hungary, 220V thats why it is interesting :) (I wrote 2 * in the code)

@raomin
Copy link
Owner Author

raomin commented Jan 27, 2021

Thank you for all of your help. I changed Voltage to 0x21,2,101,2 and it is working! But it is interesting values are between 110-117 V. I have not rewritten the if parameter yet, I used the original code.

If this value is changing overtime it's probably not the right register, you are looking at the INV secondary current (A) value which is generally at 0x21,2.

In your case (like in every other except one), Voltage (N-phase) (V) should be in 0x21,4,101,2. Now if you have 0 maybe you have no or broken sensor (what is your model?). Anyway, if your electricity is of decent quality, it should be fairly stable and you can replace it in the formula as you did.

--
If this project has value for you, please consider supporting it. I don't do this for money but it feels good to get some support! Thanks :)

@pengemetal
Copy link

ERLQ011CV3 outdoor EHBX11CB3V indoor

@TingBrouwer
Copy link

Model and option
Daikin 08AV3 + 08CV3 (heating/cooling)

board type: M5StickC ESP32 PICO
no use off the relay function

image

image

Monitoring / control
(for now NodeRed and InfluxDB, later Grafana)

image

Describe the solution components (Home Assistant, ioBroker, Graphana etc.)
-Roomtemp. data sending to Domoticz, which also controls the 2e input off the unit. (seperate relay)

Any other info
-before used websocket

location, contact information (optional)
-Netherlands (middle)

Request: the option for a fixed IP address

@raomin
Copy link
Owner Author

raomin commented Jan 31, 2021

Nice work @TingBrouwer. Impressive nodered graph...!
You seem to have an M5StickC-Plus, @m-reuter added a platformio environment for it. Once selected the screen should work properly and use the whole resolution.
Also glad to see ESPAltherma reached Netherlands!

@rtenklooster
Copy link

rtenklooster commented Feb 5, 2021

Hi, first of all, thanx for your great effort! So far it's working great.
However is someone willing to share their HA configuration?
I can't get it to work. The MQTT autodiscovery isn't picking the data up. Tried to add the sensor manual using:
- platform: mqtt state_topic: espaltherma/ATTR name: espaltherma
However the attributes aren't listed. When listening to the topic in HA manual I see all data.

Request: The option to force a reboot using MQTT. Today ESPAltherma lost the serial connection, the log showed timeouts. I disconnected / reconnected the ESP and it came back online :)

@raomin
Copy link
Owner Author

raomin commented Feb 5, 2021

Hi @rtenklooster,

Welcome in the community!

For HA, do not declare manually, it's better to get mqtt discovery to work :)
Make sure you have it activated in your configuration.yaml with this line somewhere:

discovery:

And check HA logs, it should tell about the discovery module discovering ESPAltherma.

The disconnection is a weird behaviour. I doubt that restarting the ESP would have been enough...
You can try with an OTA update, this shall reboot the ESP remotely.

--
If this project has value for you, please consider supporting it. I don't do this for money but it feels good to get some support! Thanks :)

@eldi0s
Copy link

eldi0s commented Feb 22, 2021

First of all GREAT work raomin. Thank you very much.

I'm using Home Assistant Core and love to be in full control of my software by not using hassio ;-)

For those of you also not wanting any autodiscovery messing up your structured HA config here is how you configure the
sensors manually. As state_topic I gave it the LWT state (Online/Offline) for the main sensor which is
holding all selected values as attributes. For me this was the only reasonable value I wanted to show in
the headline. But feel free to change with a value template to whatever attribute you want to show.

Sensor showing LWT state as state_topic:

sensor:
  - platform: mqtt
    name: "althermasensors"
    state_topic: "espaltherma/LWT"
    json_attributes_topic: "espaltherma/ATTR"

Sensor showing whatever attribute you want as state_topic with value_template.

sensor:
  - platform: mqtt
    name: "althermasensors"
    state_topic: "espaltherma/ATTR"
    value_template: "{{ value_json.whatever_you_want_to_show }}"
    json_attributes_topic: "espaltherma/ATTR"

Oh, very important, if you want to extract single attributes for graphs etc. most of them are
containing spaces or if you use the German definition file "Umlaute", you have to remove
the "." after "value_json" and use ['name with spaces or Umlaute'] instead.

like this:

value_template: "{{ value_json['name with spaces or Umlaute'] }}"

Live Example:

sensor:
  - platform: mqtt
    name: "WP WT Mitteltemperatur"
    state_topic: "espaltherma/ATTR"
    value_template: "{{ value_json['Wärmetauscher Mitteltemp.'] }}"
    unit_of_measurement: °C

I don't use the relay function as I combined ESPAltherma with a Zennio Klic_DA to control the unit via KNX, but
it must be similar to this: (untested)

switch:
  - platform: mqtt
    name: "altherma"
    state_topic: "espaltherma/STATE"
    command_topic: "espaltherma/POWER"
    availability_topic: "espaltherma/LWT"
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"

@eldi0s
Copy link

eldi0s commented Feb 25, 2021

I also forgot to mention that I'm using the below listed board and had to lower Baudrate to I think 115200 or even lower (don't remember correctly) to get a connection established and having the board accepting the firmware upload.

AZDelivery ESP32 NodeMCU Module WLAN WiFi Dev Kit C Development Board mit CP2102

@FlexxFR
Copy link

FlexxFR commented Mar 2, 2021

Again, great work @raomin !!
With some help I managed to get it working.
I have a Altherma EHVX11S18CB3V and using a az-delivery-devkit-v4 / WROOM32D ESP32

Connected all 5 pins with dupont wire
image

Used several wires to extend and to place ESP outside the case
image

Temporary connection, need to fix it somewhere.
I'm using an external power source because it was not working directly connected to the X10A port.
So I only connected the TX/RX and the ground wire.
image

No fancy lovelace dashboards yet :)

@qris
Copy link

qris commented Mar 21, 2021

I haven't installed ESPAltherma on a board. However I have an EHBH08CB3V heat pump, and I'm working on a project to create a Python library and monitoring tools for this and other Daikin heat pumps. I started to painstakingly reverse-engineer the locations and types of variables in the serial port messages, but then discovered that you have already decoded them all, amazing!

So I wrote some Python code to parse the ESPAltherma C definition files and output Python code. I also plan to distribute some of those definition files, unmodified (attribution intact), as part of that project, as permitted by the MIT License.

So, many many thanks for your massive reverse-engineering effort @raomin, which will save me many hours of work!

@raomin
Copy link
Owner Author

raomin commented Mar 21, 2021

Hi @qris, nice to see my work on this project can help others :)
Good luck with your project! Let me know if you are missing some information!

@qris
Copy link

qris commented Mar 22, 2021

@raomin thank you! The one thing that would be nice to have, but definitely not essential, is the variable number given to each variable in D-Checker. You can see them in the column headings of the D-Checker CSV export. For example, O/U MPU ID (xx) is number 19.

I have been using these numbers as array indexes, and because the ESPAltherma definitions don't have them, I've had to create a synthetic ID from the definition files instead (page.offset.convid).

I don't mean to ask you to do any significant work, but if you had these variable numbers available and simply didn't put them into the header file because espaltherma doesn't need them, then I would find them useful, thank you :)

@thehijacker
Copy link

No way. It works :). I have EHVH08S26C9W. Connected one of my spare ESP32 to the serial port and I am getting readings. First thing I done is to buy you a beer. Well deserved!

I ordered M5StickC ESP32 and will replace it with that one and put inside the unit. Currently I put dupont connector to serial pins and extended it with UTP cable outside the unit where I put my ESP32.

Got some additional questions on how to proceed if you cen help me:

  • How to figure out what readings my unit can report and what are they? I am interested in power usage (in W), current outside temperature, current set temperature, temperature of in and out water that goes into my floor, etc...
  • I wish to separate readings for floor heating pump (turned off in summer) and for sanitary water (always on). Which reading is which? I am not native English speaker and all this fancy variables are confusing :).
  • How to get that fancy display in HA? That graphic diagram with readings. That looks so cool.

Thank you for support and this great project. Never knew I have all parts already at home that will allow me to read from my Daikin.

@ledermann
Copy link

@my-SmarthomeGmx Are you sure that the link to taja-elektronik.de is correct? It seems to me that this adapter has female pins, but the M5Stick requires male pins.

I'm currently looking for the right cable to connect a Daikin Altherma 3 H MT ECH2O to a M5StickC Plus 2.

@my-SmarthomeGmx
Copy link

@my-SmarthomeGmx Are you sure that the link to taja-elektronik.de is correct? It seems to me that this adapter has female pins, but the M5Stick requires male pins.

I'm currently looking for the right cable to connect a Daikin Altherma 3 H MT ECH2O to a M5StickC Plus 2.

Yes, the adapter in the link has unfortunately only female dupont connectors on the m5Stick side. (I was not able to find one with a 5pin JST EH on one side and with male dupont pins on the other side. (If you do find, please paste a link). But it can anyway properly connected to the M5Stick using single male/male "Stift" connectors (similar to picture below). This is what I used . You just need to make sure that the stift connector pins are long on both sides to fit well in the dupont female connectors.
For me it was important to have a proper connector to the X10A.

image

@pedrosalgueiro
Copy link

I'm using the external sensor. It works fine. I had to configure it in the parameters (in my case [0C-08] = 1 before getting correct values. The sensor itself is a thermistor: the higher the measured temperature the lower its electrical resistance (see table). Therefor you can use any type that correspond with that curve. Bildschirmfoto 2023-10-30 um 18 47 08

Can you share the specific sensor that you are using and where did you bought it?

@bashers222
Copy link

bashers222 commented Jun 14, 2024

As you say they are thermistors.
Both the internal and external connect on the same pin, therefore they have the same properties but are in different casings.
So I skipped on the external sensor (EKRSC1) at over £90 and purchased the indoor one at £8 on ebay (KRCS01-4B) and rehoused it for life outside

@mrhedstrom
Copy link

mrhedstrom commented Aug 24, 2024

Location: Sweden
Daikin Altherma GEO2 10kW EGSQH10S18AA9W
ESP32-C3 supermini
3D printed housing for ESP32 with super glued 5 pin connector. I had to destroy the plastic on the Daikin PCB connector to fit the 5 pin connector.
No relay control, only sensors.

I added HA templates for COP, Power in and Power out sensors:

    - name: "HeatPump COP"
      unique_id: 2b91a0b3-2b00-48aa-a517-33736480a626
      unit_of_measurement: "COP"
      icon: mdi:delta
      state: >
        {% if state_attr('sensor.althermasensors', 'INV primary current (A)') > 0
          and state_attr('sensor.althermasensors', 'Flow sensor (l/min)') > 0 %}
          {{
            (
              (state_attr('sensor.althermasensors','Flow sensor (l/min)')| float * 0.06 * 1.16 * 1000
              * (
                  state_attr('sensor.althermasensors','Leaving water temp. before BUH (R1T)') | float 
              - state_attr('sensor.althermasensors','Inlet water temp.(R4T)')|float
                )
              )
              /
              (state_attr('sensor.althermasensors','INV primary current (A)') | float 
              * state_attr('sensor.althermasensors','Voltage (N-phase) (V)')|float
              )
            )
            |round(2)
          }}
        {% else %}
          0
        {%endif%}
    - name: "HeatPump Power"
      unique_id: 49e2cfef-2d72-4c0d-8d63-6bf238ab404f
      unit_of_measurement: "W"
      device_class: power
      state: >
        {% set power = 0  %}
        {% if state_attr('sensor.althermasensors', 'INV primary current (A)') > 0 %}
          {% set power = (state_attr('sensor.althermasensors','INV primary current (A)') | float 
            * state_attr('sensor.althermasensors','Voltage (N-phase) (V)')|float)
            |round(2) %}
        {% endif %}
        {% if is_state_attr('sensor.althermasensors','BUH Step2', 'ON')  %}
          {% set power = power + 6000 %}
        {% elif is_state_attr('sensor.althermasensors','BUH Step1', 'ON')  %}
          {% set power = power + 3000 %}
        {% endif %}
        {{ power |round(2) }}
    - name: "HeatPump Power out"
      unique_id: ccfec460-81ea-4756-a6fd-e16188eb3a04
      unit_of_measurement: "W"
      device_class: power
      state: >
        {% set power = 0  %}
        {% if state_attr('sensor.althermasensors', 'Flow sensor (l/min)') > 0 %}
          {% set power = (state_attr('sensor.althermasensors','Flow sensor (l/min)')| float * 0.06 * 1.16 * 1000
              * (
                  state_attr('sensor.althermasensors','Leaving water temp. after BUH (R2T)') | float 
              - state_attr('sensor.althermasensors','Inlet water temp.(R4T)')|float
                )
              ) %}
        {% endif %}
        {{ power |round(2) }}

IMG_7180
IMG_7189
IMG_7183
IMG_7190

HA Dashboard:
image

If anyone is interested, here is the dashboard background picture
Ritning (3)

@AlexanderP27
Copy link

AlexanderP27 commented Aug 25, 2024

I added HA templates for COP, Power in and Power out sensors:

thank you for sharing. I like the plugged-in ESP - mine is wired and outside btw.

How realistic are the COP-Values you calculated? On your picture is 13, what could be some kind of peak. I have tried nearly every code for calculating COP on my ETSX12P50EF I found. Unfortunatly none was nearly realistic, because I have to use INV-Current Value and cannot measure consumption directly. I would expect a COP something between 2 an 5 depending on the heating mode.

( I use this code, PHASE A Voltage is from my PV-Meter:
espaltherma_cop:
friendly_name: "COP"
unique_id: "espaltherma_cop"
unit_of_measurement: "COP"
value_template: >
{% set q = (state_attr('sensor.none_althermasensors','Durchflussmenge (l/min)')| float * 0.06 * 1.163 * (state_attr('sensor.none_althermasensors','R2T-Wasser Vorlauftemp. nach dem Heizstab') | float - state_attr('sensor.none_althermasensors','R4T-Wasser Rücklauftemp. vor dem Plattenwärmetauscher') | float)) %}
{% set w = (( state_attr('sensor.none_althermasensors','Stromaufnahme INV-Verdichter (A) (Sekundärkreis)')| float ) * ( states('sensor.phase_a_voltage') |float ) / 1000 ) %}
{% if q >= 0 and w > 0 %}
{{ (q / w) | round(2) }}
{% else %}
0
{% endif %}
)

@mrhedstrom
Copy link

mrhedstrom commented Aug 25, 2024

mine is wired and outside btw.

I think that's better for the WiFi signal. Mine is now between two thick steel plates and insulation. But in my case the AP is in the room next to the heat pump. I see signal values around -85dBm.

How realistic are the COP-Values you calculated?

Well, I do not have an energy meter on electric input. This is calculated from inverter current/voltage and backup heaters. It is lacking measurement for all other consumers in the system such as heat losses, circulation pumps, electronics etc.

Currently it's to warm outside to see normal values since it's only turning on short periods. It seems to be stabilizing around 7-8 COP when heating the tap water. I think it's realistic for a geo-thermal pump with 240m depth and an inverter heat pump.

image

@AlexanderP27
Copy link

ok, a geo-thermal heatpump is very nice! :)

the expectations of the cop above was for my air-water-heatpump. since it was installed in April, I am only heating up water for showering and as I have solar panels, the pump is in forced-heat-mode to "over-heat" which also results in a more unfavorable cop (like in the picture).

I can also calculate the cop by hand based on the infos from the screen of the heat pump. This calculation is a bit higher than the cop in homeassistant.

Bildschirmfoto 2024-08-25 um 10 18 01

@THK56
Copy link

THK56 commented Aug 25, 2024

Congratulations, the plug-in version is a great idea and looks really professional.

@charlesosj
Copy link

Thanks a lot to Raomin for the work on EspAltherma. It runs for me quite nicely together with HomeAssistant for an Altherma 3 H HT. Here some pictures on the setup. I am using it with a "dual relay" to control the 2 SmartGrid contacts.

As I was not happy with the dupont pins on the connector pins, here a ready to use Adapter cable which fits on the Daikin Connector (JST EH) and with dupont connectors for the M5Stick. https://www.taja-elektronik.de/Adapterkabel-JST-EH-auf-Dupont-5-polig-50-cm-AWG-24

In addition I am using the dual realy from M5Stack which can be easily connected to the M5Stick. e.g. https://www.berrybase.de/m5stack-2-channel-spst-relay-unit?number=M5-U131&utm_source=google&utm_medium=cpc&gad_source=1&gclid=CjwKCAjw5v2wBhBrEiwAXDDoJd9-eSuCv5QNnYklMIIeZE3icKV3Vf3Ot8uZGSj7ygBgU2McsAOXTRoCtQcQAvD_BwE

20240415_105422

20240415_105508

Hi @my-SmarthomeGmx , Im trying to replicate your setup, and wanted to ask what the name of the cable connecting from the relay to the smart grid is, and what what pins have you got set in your SG Pins in the setup.h Thanks in advance

@my-SmarthomeGmx
Copy link

Hi @my-SmarthomeGmx , Im trying to replicate your setup, and wanted to ask what the name of the cable connecting from the relay to the smart grid is, and what what pins have you got set in your SG Pins in the setup.h Thanks in advance

Its a simple 4 wire cable (Klingelleitung YR 4x0.8mm2). According my Daikin installation manual it should be at least 0.5mm2.
See also this post
#433

I just used the Pin32+33 as prepared in the original espaltherma code

//Smart grid control - Optional:
//Uncomment and set to enable SG mqtt functions
#define PIN_SG1 32// Pin connected to dry contact SG 1 relay (normally open)
#define PIN_SG2 33// Pin connected to dry contact SG 2 relay (normally open)

@charlesosj
Copy link

Hi @my-SmarthomeGmx , Im trying to replicate your setup, and wanted to ask what the name of the cable connecting from the relay to the smart grid is, and what what pins have you got set in your SG Pins in the setup.h Thanks in advance

Its a simple 4 wire cable (Klingelleitung YR 4x0.8mm2). According my Daikin installation manual it should be at least 0.5mm2. See also this post #433

I just used the Pin32+33 as prepared in the original espaltherma code

//Smart grid control - Optional:
//Uncomment and set to enable SG mqtt functions
#define PIN_SG1 32// Pin connected to dry contact SG 1 relay (normally open)
#define PIN_SG2 33// Pin connected to dry contact SG 2 relay (normally open)

Amazing thank you soo much for the quick reply!

@pecan08
Copy link

pecan08 commented Nov 7, 2024

@DieterB61 that is similar setup I would like to implement (at least I think so).

I have Altherma 3 with X10A and X85A connectors available (no S21 to integrate Faikin module) and solar system which I would like to integrate into smart grid.

Can you share what was the most helpful resource to gather info from?
Also - according your experience - would it be possible to switch between controlling the temperature via room thermostat and LWT settings manually or based on the condition that solar system gives more than defined output of power?

Thank you!

@bashers222
Copy link

I know you can't swap modes like that using this software

@pecan08
Copy link

pecan08 commented Nov 7, 2024

I know you can't swap modes like that using this software

Thank you for super fast response...would it be possible at least to modify LWT itself?

@DieterB61
Copy link

DieterB61 commented Nov 7, 2024

@pecan08

@DieterB61 ...
Can you share what was the most helpful resource to gather info from?

You get a lot of information from ESP Altherma, but you cannot control completely the heat pump (in my case only the max. energy can be set). I use IoBroker to collect data from everywhere and control with it everything that is controllable ;-)

Also - according your experience - would it be possible to switch between controlling the temperature via room thermostat and LWT settings manually or based on the condition that solar system gives more than defined output of power?

Switching the HP on and of is done by normal room thermostats (not the Daikin one). Parallel to the thermostats I have a shelly switch that I can control by IoBroker. The flow temperature of the heating can be set by +/- steps like in the Daikin App by the Daikin-Cloud instance in IoBroker. I also have the data from the electric energy coming in or leaving my house (data form the inverter). Thus I can switch on the heating system on, if there is enough energy produced by my solar power system. In that way I can store energy in form of heat (I have an old building with thick walls). If there is a lot of solar electric energy, I also heat up my water tank to the comfort temperature (this can also be switched on and of by the Daikin-Cloud instance in IoBroker). In the transition period before winter, I "pump" during the daily sunshine periode enough heat into my house for the whole day.

ESP Altherma gives me a lot of data about temperatures and flow control that I use to calculate COP value (using an extra energy meter that is only for the heat pump). ESP Altherma can not control the heat pump. Only the max. energy can be set using the extra relais on X85A. I use this to limit the power, if there is only a small amount of electric energy available from my solar system.

Of course you need some programming knowledge to implement such things.

@pecan08
Copy link

pecan08 commented Nov 8, 2024

@pecan08

@DieterB61 ...
Can you share what was the most helpful resource to gather info from?

You get a lot of information from ESP Altherma, but you cannot control completely the heat pump (in my case only the max. energy can be set). I use IoBroker to collect data from everywhere and control with it everything that is controllable ;-)

Also - according your experience - would it be possible to switch between controlling the temperature via room thermostat and LWT settings manually or based on the condition that solar system gives more than defined output of power?

Switching the HP on and of is done by normal room thermostats (not the Daikin one). Parallel to the thermostats I have a shelly switch that I can control by IoBroker. The flow temperature of the heating can be set by +/- steps like in the Daikin App by the Daikin-Cloud instance in IoBroker. I also have the data from the electric energy coming in or leaving my house (data form the inverter). Thus I can switch on the heating system on, if there is enough energy produced by my solar power system. In that way I can store energy in form of heat (I have an old building with thick walls). If there is a lot of solar electric energy, I also heat up my water tank to the comfort temperature (this can also be switched on and of by the Daikin-Cloud instance in IoBroker). In the transition period before winter, I "pump" during the daily sunshine periode enough heat into my house for the whole day.

ESP Altherma gives me a lot of data about temperatures and flow control that I use to calculate COP value (using an extra energy meter that is only for the heat pump). ESP Altherma can not control the heat pump. Only the max. energy can be set using the extra relais on X85A. I use this to limit the power, if there is only a small amount of electric energy available from my solar system.

Of course you need some programming knowledge to implement such things.

Great Dieter, thank you very much! That is exactly I wanted to hear although I am not too happy about limited options for controlling the HT via ESP32. However the shelly and IoBroker como seems like good fit. Adjusting flow temperature based on certain scenario seems enough for me! By flow temp you mean leaving water temp?
I am facing similar scenario as you do, but since I am below average at electr(on)ics and programming it would be a challenge.

@DieterB61
Copy link

@pecan08
By flow temp you mean leaving water temp?

Yes, in my case (leaving water temperature is controlled by outside temperature) this can be set in +/- 1°C steps in relation to the setpoint by the Daikin-Cloud Adapter in iobroker. Unfortunately, Daikin established a limit of the number of access per day below 200. Therfore I read out as much as possible from ESP Altherma and use the Daikin Cloud Adapter mainly for setting things up.

@Siepak98
Copy link

Hi,
After 3 days, I managed to configure the pump with home assistant. However, I have absolutely no idea how to set all the tiles correctly and how to calculate the COP. In my file it was not possible to unlock Voltage N-phase.

Would someone be so kind as to share their HA code with me and show me how to upload it?

@mauromorello
Copy link

Hi, I have an "old" espaltherma installation, modified by myself but still working well; I had to put some effort to "see" in HA but now is running flawlessly; I'll try to copy the most interesting parts:

#ALTHERMA
template: 
    
    binary_sensors:
      
      espaltherma_status:
        friendly_name: "Status Caldaia"
        value_template: "{% if (state_attr('sensor.althermasensors','Operation Mode') == 'Fan Only')  %} 
                           off
                    {% else  %}
                           on
                    {% endif %}"
        unique_id: "ALTH_STATUS"
        
      allarme_altherma:
        friendly_name: "Allarme Altherma"
        value_template:
                        "{% if states('sensor.espaltherma_error_type') == 'Normal' and 
                            states('sensor.spaltherma_alarm_output') == 'OFF' and 
                            states('sensor.spaltherma_error_code')|int == 0 and 
                            states('sensor.spaltherma_error_det_code')|int == 0 %}
                            off
                        {% else %}
                            on
                        {% endif %}"
        unique_id: "alth_alarm_status"
        icon_template: >-
          {% if is_state('binary_sensor.allarme_altherma', 'on') %}
            mdi:alarm-light
          {% else %}
            mdi:alarm-light-off
          {% endif %}

then some sensors, extrapolated from mqtt attribute

template:
  sensors:

      #EXTERNAL UNIT
      espaltherma_pressure:
        friendly_name: "Pressure"
        value_template: "{{ state_attr('sensor.althermasensors','Pressure') }}"
        device_class: pressure
        unit_of_measurement: 'Psi'
        unique_id: "ALTH_PRESSURE"
        
      espaltherma_discharge_pipe_temp:
        friendly_name: "Discharge pipe temp"
        value_template: "{{ state_attr('sensor.althermasensors','Discharge pipe temp.') }}"
        device_class: temperature
        unit_of_measurement: '°C'
        unique_id: "ALTH_Discharge_pipe_temp"
      
      espaltherma_heat_exchanger_mid_temp:
        friendly_name: "Heat exchanger mid-temp"
        value_template: "{{ state_attr('sensor.althermasensors','Heat exchanger mid-temp.') }}"
        device_class: temperature
        unit_of_measurement: '°C'
        unique_id: "ALTH_Heat_exchanger_mid-temp"

For the COP calculation (COPIED and PASTED from somewhere on the web):
this goes into configuration.yaml file, google it how to find and edit.
hope this helps a little :)

template:
  sensors:
      espaltherma_cop:
        friendly_name: "COP"
        unit_of_measurement: 'COP'
        value_template: "{% if is_state_attr('sensor.althermasensors','I/U operation mode', 'Heating')  %} 
            {{ 
              ((state_attr('sensor.althermasensors','Flow sensor (l/min)')| float * 0.06 * 1.16 * (state_attr('sensor.althermasensors','Leaving water temp. before BUH (R1T)') | float - state_attr('sensor.althermasensors','Inlet water temp.(R4T)')|float) )
                /
              (state_attr('sensor.althermasensors','INV primary current (A)') | float * 230 / 1000)) 
              |round(2)
            }}
            {% else %} 0 {%endif%}"  
        unique_id: "ALTH_COP"

@Siepak98
Copy link

Hi, I have an "old" espaltherma installation, modified by myself but still working well; I had to put some effort to "see" in HA but now is running flawlessly; I'll try to copy the most interesting parts:

#ALTHERMA
template: 
    
    binary_sensors:
      
      espaltherma_status:
        friendly_name: "Status Caldaia"
        value_template: "{% if (state_attr('sensor.althermasensors','Operation Mode') == 'Fan Only')  %} 
                           off
                    {% else  %}
                           on
                    {% endif %}"
        unique_id: "ALTH_STATUS"
        
      allarme_altherma:
        friendly_name: "Allarme Altherma"
        value_template:
                        "{% if states('sensor.espaltherma_error_type') == 'Normal' and 
                            states('sensor.spaltherma_alarm_output') == 'OFF' and 
                            states('sensor.spaltherma_error_code')|int == 0 and 
                            states('sensor.spaltherma_error_det_code')|int == 0 %}
                            off
                        {% else %}
                            on
                        {% endif %}"
        unique_id: "alth_alarm_status"
        icon_template: >-
          {% if is_state('binary_sensor.allarme_altherma', 'on') %}
            mdi:alarm-light
          {% else %}
            mdi:alarm-light-off
          {% endif %}

then some sensors, extrapolated from mqtt attribute

template:
  sensors:

      #EXTERNAL UNIT
      espaltherma_pressure:
        friendly_name: "Pressure"
        value_template: "{{ state_attr('sensor.althermasensors','Pressure') }}"
        device_class: pressure
        unit_of_measurement: 'Psi'
        unique_id: "ALTH_PRESSURE"
        
      espaltherma_discharge_pipe_temp:
        friendly_name: "Discharge pipe temp"
        value_template: "{{ state_attr('sensor.althermasensors','Discharge pipe temp.') }}"
        device_class: temperature
        unit_of_measurement: '°C'
        unique_id: "ALTH_Discharge_pipe_temp"
      
      espaltherma_heat_exchanger_mid_temp:
        friendly_name: "Heat exchanger mid-temp"
        value_template: "{{ state_attr('sensor.althermasensors','Heat exchanger mid-temp.') }}"
        device_class: temperature
        unit_of_measurement: '°C'
        unique_id: "ALTH_Heat_exchanger_mid-temp"

For the COP calculation (COPIED and PASTED from somewhere on the web): this goes into configuration.yaml file, google it how to find and edit. hope this helps a little :)

template:
  sensors:
      espaltherma_cop:
        friendly_name: "COP"
        unit_of_measurement: 'COP'
        value_template: "{% if is_state_attr('sensor.althermasensors','I/U operation mode', 'Heating')  %} 
            {{ 
              ((state_attr('sensor.althermasensors','Flow sensor (l/min)')| float * 0.06 * 1.16 * (state_attr('sensor.althermasensors','Leaving water temp. before BUH (R1T)') | float - state_attr('sensor.althermasensors','Inlet water temp.(R4T)')|float) )
                /
              (state_attr('sensor.althermasensors','INV primary current (A)') | float * 230 / 1000)) 
              |round(2)
            }}
            {% else %} 0 {%endif%}"  
        unique_id: "ALTH_COP"

Every of this formula, have to paste in configuration.yaml?

@mauromorello
Copy link

Technically yes but I suggest you to invest some time reading HA docs.

PS: this is not the right place to write about tech… it’s only for show results

@Siepak98
Copy link

Siepak98 commented Nov 16, 2024

@mauromorello Thanks for your help :)

I have a new problem, namely the COP sensor turns on and off.

image

- name: "COP_ALTHERMA" unique_id: "COP_ALTHERMA" unit_of_measurement: 'COP' state: "{% if is_state_attr('sensor.none_althermasensors','Operation Mode', 'Heating') and is_state_attr('sensor.none_althermasensors','Freeze Protection', 'OFF') %} {{ ((state_attr('sensor.none_althermasensors','Flow sensor (l/min)')| float * 0.06 * 1.16 * (state_attr('sensor.none_althermasensors','Leaving water temp. before BUH (R1T)') | float - state_attr('sensor.none_althermasensors','Inlet water temp.(R4T)')|float) ) / (state_attr('sensor.none_althermasensors','INV primary current (A)') | float * 240 |float / 1000)) |round(2) }} {% else %} 0 {%endif%}"

In mqtt log i saw that, any idea?

2024-11-16 20:11:33: New client connected from 192.168.31.79:50111 as ESPAltherma-dev (p2, c1, k15, u'mqttadmin'). 2024-11-16 20:26:55: Client ESPAltherma-dev has exceeded timeout, disconnecting. 2024-11-16 20:27:16: New connection from 192.168.31.79:50112 on port 1883. 2024-11-16 20:27:16: New client connected from 192.168.31.79:50112 as ESPAltherma-dev (p2, c1, k15, u'mqttadmin'). 2024-11-16 20:41:32: Saving in-memory database to /data//mosquitto.db. 2024-11-16 21:11:33: Saving in-memory database to /data//mosquitto.db. 2024-11-16 21:28:31: Client ESPAltherma-dev has exceeded timeout, disconnecting.

@myLens
Copy link

myLens commented Nov 18, 2024

Based on the code of Raomin I wrote a HA custom_component and run it on a TTGO with it's small display (still without case).
I also do the COP calculation in this component so my YAML file is quite short.
Altherma_TTGO
Thank you again for your efforts Raomin !

@Alanin
Copy link
Contributor

Alanin commented Nov 20, 2024

Please excuse me for asking such stupid questions. If I want to use the SG Ready functions, I basically have to connect the contacts on 5 and 6 for SG1 (switched accordingly, of course) and the contacts on 11 and 12 for SG2. Whereby the respective pins/ports may differ.

I just want to make sure that I have understood correctly that, for example, I have to connect the respective GND on port 5 and the other contact on port 6 from the SG Ready port - controlled by a relay.

And another question. The documentation mentions that the evaluation of the SG ports must be activated in the configuration of the heat pump. However, I cannot find this configuration option in my heat pump, neither in the user area nor in the area for the installer. Is there any other trick? Does the menu item appear once the ports have been connected or switched?

@HaiQ31
Copy link

HaiQ31 commented Nov 24, 2024

Hi everyone,
I used the compressure speed attribute to calculate the "switch-on frequency" (in German its called "Taktung"). This says how often the compressor starts working per hour. The more often the worse, because high switch-on frequency has impact on the lifetime of the HP. I use it to optimize the operation settings to reduce the switch-on frequency (8/h is quite high).
switch-on frequency per hour over a week

what you need:

  • home assistant
  • a counter entity "HP compressor switch-on frequency"
  • an automation that increments the counter every time the compressor speed leaves value "0"
  • a statistics card with the counter entity, configured as bar chart, hourly aggregation period and "state" selected.

I used the webUI. If necessary I'm happy to help to set it all up in webUI or with yaml files.

@ivoheiland
Copy link

Hello roamin,

I tried to get the ESPAltherma work on my M5StackCore2. First i used Arduino - but the file ESPAltherma.ino is missing.
The alternative way with Platformio is to difficult for me because no glue about Visual C.

Can you helb me getting startet with ESPAltherma on my Daikin Altherma 3 H HT?

Thanks
Ivo

@my-SmarthomeGmx
Copy link

Hi Roamin. Thanks again for the nice and helpful project. I already pasted some photos of my hardware installation setup somewhere above. (Altherma3H HT)
For completeness here a screenshot of my current integration into homeassistant. It uses a combination of

  • ESPAltherma/MQTT integration: Mainly for monitoring + display the heatpump sensor values and to control the SG contacts in summer when enough PV energy is there. To derive heatpump cycles and defrost periods, for optimisation purposes.
  • The Daikin Onecta integration: To control the heatpump - On/Off during warm nights and transition periods to avoid short cycling.
  • Other integrations for other sensors (e.g. my external pump)

Screenshot

@mx-vatte
Copy link

Nice configuration! How do you calculate the heatpump cycles, defrost periods and TAT/WAZ/MAZ/JAZ?

@my-SmarthomeGmx
Copy link

Nice configuration! How do you calculate the heatpump cycles, defrost periods and TAT/WAZ/MAZ/JAZ?

The "Defrost Cycle Count" and the "Heatpump Cyle Count" is calculated based on the template sensors which are extracted from the attributes from the ESP Atherma Sensors Attributes.

  1. Defrost Cycle Counts Per Day:
    This is purely based on the "template sensor" defrost on/off. To counting how often it was turned on per day I am using
    "history_stats" integration. (yaml code snippet below)
  2. Heatpump Cyle Count
    This is basically doing the same as above but counting how often the compressor was turned on using "history_stats" as well.
    The information if the compressor is on or off is derived from the compressor rotation speed "template sensor" from ESP
    Alterma.
    For the "compressor state" I have used an "input_boolean" (under HA helper) to store the state.
    This "compressor state" is set to on and off if the compressor speed goes from 0 -> X and from X -> 0 using an HA
    automation.
  3. The "Arbeitszahlen"/COPs are calculated based on
    • Sensor values the Daikin Onecta Integration provides. The Onecta Integration provides energy consumption values per
      Day/Month/Year for Heating and HotWater respectively. (I only use the ones for Heating.)
    • The "amount of heat" is calculated based on the 2 Temperature Sensors (Incoming/Outgoing) and the flow information.
      Actually I am using the external temperature sensors and the external flow information from the external pump I have. (But
      the same could be used from the Daikin HP from ESP Alterma info). Based on this I calculate a current "power value" for
      the amount of heat in a template sensor (with some conditions if heating is on). This I integrate over time using a HA
      helper (Integralsensor) to end up with the energy value for the amount of heat produced.
    • Based on trigger conditions at the end of the day/week/month/year I devide the 2 values and do some resetting to end up
      with these numbers

Some YAML code Snippet

  • platform: history_stats
    name: "DefrostCount"
    entity_id: sensor.defrost <--- Template Sensor based ESP on Altherma Attribute
    state: "ON"
    unique_id: "sensor.DefrostCountsPerDay"
    type: count
    start: "{{ now().replace(hour=0, minute=0, second=0, microsecond=0) }}"
    end: "{{ now().replace(hour=23, minute=59, second=59) }}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests