coolchip / luxtronik2

Reads and controls heat pumps based on the Luxtronik 2.0 contol unit with Node.js.
MIT License
34 stars 16 forks source link

Request for Energy Consumption #41

Open moritzschrader opened 1 year ago

moritzschrader commented 1 year ago

Hi guys,

I recently discovered that my Webserver UI also displays the consumed energy in kWh ("Eingesetzte Energie"). I'm posting the xml response I get after login below.

I was not able to find anything resembling the values when dumping all calculations and parameters (also tried the bouni python version). Was anyone able to find it and could we add it here? Are they maybe encoded in any other way?

It also would be great to have the current power consumption, if anyone can find it. I know I could also take the time derivative of the energy in kWh, but that is quite slow/delayed. Instantaneous power would be amazing!

Thanks for any help, love what you've done so far!

<Navigation id="0x7cb050">
   <item id="0x7cd740">
      <name>Informationen</name>
      <item id="0x7ca200">
         <name>Temperaturen</name>
      </item>
      <item id="0x7ccf70">
         <name>Eingänge</name>
      </item>
      <item id="0x7c8ea0">
         <name>Ausgänge</name>
      </item>
      <item id="0x7ccf28">
         <name>Ablaufzeiten</name>
      </item>
      <item id="0x7c8f30">
         <name>Betriebsstunden</name>
      </item>
      <item id="0x7ccba0">
         <name>Fehlerspeicher</name>
      </item>
      <item id="0x7ccbe8">
         <name>Abschaltungen</name>
      </item>
      <item id="0x7cc6a8">
         <name>Anlagenstatus</name>
      </item>
      <item id="0x7cc6e0">
         <name>Energiemonitor</name>
         <item id="0x7c7d20">
            <name>Wärmemenge</name>
         </item>
         <item id="0x7caa50">
            <name>Eingesetzte Energie</name>
         </item>
      </item>
      <item id="0x7cc728">
         <name>GLT</name>
      </item>
   </item>
   <item id="0x7cc770">
      <name>Einstellungen</name>
      <item id="0x7cb1c8">
         <name>Betriebsart</name>
      </item>
      <item id="0x7cc298">
         <name>Temperaturen</name>
      </item>
      <item id="0x7ce928">
         <name>System Einstellung</name>
      </item>
   </item>
   <item id="0x7ca498">
      <name>Zeitschaltprogramm</name>
      <readOnly>true</readOnly>
      <item id="0x7cb290">
         <name>Heizung</name>
         <readOnly>true</readOnly>
         <item id="0x7ce480">
            <name>Woche</name>
         </item>
         <item id="0x7ce2e0">
            <name>5+2</name>
         </item>
         <item id="0x7cdd58">
            <name>Tage (Mo, Di...)</name>
         </item>
      </item>
      <item id="0x7cdb48">
         <name>Warmwasser</name>
         <readOnly>true</readOnly>
         <item id="0x7cdae0">
            <name>Woche</name>
         </item>
         <item id="0x7cda78">
            <name>5+2</name>
         </item>
         <item id="0x7cd958">
            <name>Tage (Mo, Di...)</name>
         </item>
      </item>
   </item>
   <item id="0x7cd648">
      <name>Zugang: Benutzer</name>
   </item>
   <item id="0x7ce348">
      <name>Fernsteuerung</name>
   </item>
</Navigation>
coolchip commented 1 year ago

Hello @moritzschrader. This Node-RED node is using the excellent smartmeter-obis module to parse all the data from smartmeters. So the work has to be done at the smartmeter-obis node. Also it would be very helpfull to know which smartmeter you are using.

moritzschrader commented 1 year ago

Hi @coolchip, as far as I understood, the heat pump has a rudimentary power calculation by itself. There's no smart meter connected to the heat pump.

coolchip commented 1 year ago

I think then this is the wrong node for you. Perhaps there is a dedicated node for your heat pump.

cheick66 commented 1 year ago

Hello, @moritzschrader is right, the the new Luxtronik2 FW which is read by this Module, will cover power consumtion in addition. There are lots of user without powermeter in front of the heatpump. So it would make sense to have that featcher request to Luxtronik. As you can see the registers are already offeren by a web session to Luxtronik.

I already did a short test and compared my powermeter against the internal calculation and it looks simular, if you do it on a base of kWh.

Best regards Christian (native German)

DrBlokmeister commented 5 months ago

This is not a complete solution, but I wanted to share my approach here as well. I recently hooked up a Shelly PM Mini to the pump. However, before that, I managed to do a quite good data fitting to predict the power of the heat pump based on the tapwater temperature and the hot gas temperature. It's just a linear model.

Basically, it checks if the tapwater and additional recirculation is on, to determine the heatpump state (probably this can be done smarter). It then calculates the predicted power usage, just a linear model. If that is higher than the actual consumption on my home meter, since the power of the heatpump can never be larger than the power of the entire home. Also it can never be below zero.

sensor:
  - platform: template
    sensors:
    #Fitted powers using model based on temperatures
      heatpump_tapwater_power_estimate:
        value_template: >-
          {% if is_state('binary_sensor.heatpump_tapwater_recirculation_pump', 'on')%}
            {% if (255.5 + (states('sensor.heatpump_tapwater_temperature')|float * 16.66)) > (states('sensor.electricity_meter_power_consumption_phase_l2')|float * 1000) %}
              {{ states('sensor.electricity_meter_power_consumption_phase_l2')|float*1000 }}
            {% else %}
              {{ 255.5 + (states('sensor.heatpump_tapwater_temperature')|float * 16.66) }}
            {% endif %}
          {% else %}
            0
          {% endif %}
        unit_of_measurement: "W"
        availability_template: "{{ states('sensor.heatpump_tapwater_temperature')|is_number }}" #Should also include recirculation pump being available
      heatpump_heating_power_estimate:
        value_template: >-
          {% if is_state('binary_sensor.heatpump_additional_circulation_pump', 'on') and is_state('binary_sensor.heatpump_tapwater_recirculation_pump', 'off') %}
            {% if (-1323.9 + (states('sensor.heatpump_hot_gas_temperature')|float * 38.59)) > (states('sensor.electricity_meter_power_consumption_phase_l2')|float * 1000) %}
              {{ states('sensor.electricity_meter_power_consumption_phase_l2')|float*1000 }}
            {% elif (-1323.9 + (states('sensor.heatpump_hot_gas_temperature')|float * 38.59)) < 0 %}
              0
            {% else %}
              {{ -1323.9 + (states('sensor.heatpump_hot_gas_temperature')|float * 38.59) }}
            {% endif %}
          {% else %}
            0
          {% endif %}
        unit_of_measurement: "W"
        availability_template: "{{ states('sensor.heatpump_hot_gas_temperature')|is_number }}" #Should also include recirculation pump being available
coolchip commented 4 months ago

ete

I didn't get it. Which firmware do i need to get the power consumption? I use firmware 1.x.