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

Consumed Energy only updated every two hours #293

Open
Bl4d3s opened this issue Nov 11, 2024 · 8 comments
Open

Consumed Energy only updated every two hours #293

Bl4d3s opened this issue Nov 11, 2024 · 8 comments
Assignees
Labels
question Further information is requested todo issue ready to implement

Comments

@Bl4d3s
Copy link

Bl4d3s commented Nov 11, 2024

Hi,

On both the latest stable and the latest Beta version I experience the following:

Consumed kWh for heating or water is only updated every two hours, other data Like the current energy consumption is updated in real time.
The local webserver shows more frequent updates.

is this expected behavior?
If not what information do you require to debug?

Im a developer so I can change some source code as well to help debugging.

Thanks

@blue-bean
Copy link

blue-bean commented Nov 11, 2024

I can confirm this behaviour. It does not depend on changing the update interval in the config of the integration.

@Bl4d3s
Copy link
Author

Bl4d3s commented Nov 11, 2024

config_entry-luxtronik2-01JC7YC0VE8D3E75ASQM9ZW215.json

I have attached the diagnostics below

@BenPru BenPru self-assigned this Nov 15, 2024
@BenPru BenPru added question Further information is requested todo issue ready to implement labels Nov 15, 2024
@Bl4d3s
Copy link
Author

Bl4d3s commented Nov 28, 2024

I figured something out:

The data is not really updated on the socket api, thus the integration is working fine.

I am currently working on building an API for the websocket api, which the web UI itself uses (on port 8214).
I already managed to parse it into structured hierarchical data,

All thats left, is to map it into the same structure as the current python library to be compatible with.
I will try to make it an drop-in replacement, if possible. (There the values updates almost in realtime)

@BenPru
Copy link
Owner

BenPru commented Nov 28, 2024

I am currently working on building an API for the websocket api

I also tried this. But the ids are random in the websocket api and it only works with names and they are with a local translation.
Please note that Luxtronik work on another, new API.

@Bl4d3s
Copy link
Author

Bl4d3s commented Nov 28, 2024

I noticed that as well.

My approach would have been to look up what value it is based on the name (providing a list of translations and mapping it based on these values)

Sample:

temperature_group: list[str] = [
    'Temperaturen'
    'Another translation'
]


def get_property_name(name: str) -> str:
    if name in temperature_group:
        return 'temperatures'

Of course this is not ideal, but better than the two hour window screwing over my dashboard with negative power consumption because of the big jumps ;)

Do you have any more information/timelines in regards towards the new Api?
I must decide, if it would be better to wait for it ^^

@AJediIAm
Copy link
Contributor

AJediIAm commented Dec 1, 2024

I am currently working on building an API for the websocket api

I also tried this. But the ids are random in the websocket api and it only works with names and they are with a local translation. Please note that Luxtronik work on another, new API.

Is there any official or unofficial documentation for this new API?
I'm curious to read more about it.

@Bl4d3s
Copy link
Author

Bl4d3s commented Jan 11, 2025

FYI: I managed to get a workaround for the time being.

My heatpump exposes the current power consumption (albeit only for the total draw, not separate for heating/water), which updates with every pull interval.
I created an helper counting the total consumption based on that, which I then use in the energy dashboard.

the only thing thus missing is the separation of heating / warm water energy draw.

this works for me for now, I think we can close this with the fix being the new api (which hopefully does expose the data).

nevertheless do you know any ETA for the release of that API ? (I would be interested to help implement it)

@blue-bean
Copy link

blue-bean commented Jan 11, 2025

the only thing thus missing is the separation of heating / warm water energy draw.

You can do this by using two template sensors - so you can separate the current power consumption into two sensors:

  1. one for hot water: this one is equal to the build-in sensor 'current power consumption' when the WP prepares hot water, otherwise zero
  2. one for heating: this one is equal to the build-in sensor 'current power consumption' when the WP is heating, otherwise zero

By using some helper (two integral sensors for calculating the energy in kWh using for hot water preparation and heating, and the energy counter) you have all you need.
PS: in the options of the integral sensors you have to choose a time-based integration (e.g. 30 sec) for unchanged power values.

(xxxxxx_xxxx has to be replaced by the number in your installation)

  - name: "Leistung WW"
    unique_id: xxxxxx_xxxx_power_ww
    device_class: power
    unit_of_measurement: "W"
    state: >-
        {% set power = states('sensor.luxtronik_xxxxxx_xxxx_current_power_consumption') | float %}
        {% set mode = states('sensor.luxtronik_xxxxxx_xxxx_status') %}
        {% if power > 0 and mode == "hot water" %}
          {{ states('sensor.luxtronik_xxxxxx_xxxx_current_power_consumption') | float }}
        {% else %}
          {{ 0 }}
        {% endif %}
    
  - name: "Leistung Heizung"
    unique_id: xxxxxx_xxxx_power_heizung
    device_class: power
    unit_of_measurement: "W"
    state: >-
        {% set power = states('sensor.luxtronik_xxxxxx_xxxx_current_power_consumption') | float %}
        {% set mode = states('sensor.luxtronik_xxxxxx_xxxx_status') %}
        {% if power > 0 and mode == "heating" %}
          {{ states('sensor.luxtronik_xxxxxx_xxxx_current_power_consumption') | float }}
        {% else %}
          {{ 0 }}
        {% endif %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested todo issue ready to implement
Projects
None yet
Development

No branches or pull requests

4 participants