UncleSamSwiss / ioBroker.luxtronik2

ioBroker adapter that connects to Luxtronik heatpump controllers
Apache License 2.0
11 stars 13 forks source link

Couldn't handle 'Informationen.Energiemonitor' #317

Open Dino2p opened 1 year ago

Dino2p commented 1 year ago

Since the update to the firmware version wp2reg-V3.88.0-9015 the values for the "Wärmemenge" und "Eingesetzte Energie" are no longer read:

luxtronik2.0 2023-01-21 10:48:53.092 error Couldn't handle 'Informationen.Energiemonitor' -> 'Wärmemenge': Error: setStateAsync() not supported on section. luxtronik2.0 2023-01-21 10:48:32.709 error Couldn't handle 'Informationen.Energiemonitor' -> 'Eingesetzte Energie': Error: setStateAsync() not supported on section.

IOBroker:
Version: v6.3.5 Plattform: linux RAM: 971.6 MB Node.js: v14.21.1 NPM: 6.14.17 Adapter: luxtronik2 v0.4.2

Heatpump: Manufacturer: Alpha-Innotec Product: SWC122H3 Steering: Luxtronik 2.0 Firmware new: wp2reg-V3.88.0-9015 Firmware old: wp2reg-V3.87.1-8454

heatpumper commented 1 year ago

The "Energiemonitor" was changed in Version 3.8.8. It now not only shows the created heat in kWh but also shows the used electrical energy.

I just joined to Github for this issue. if I look at the source code, I would assume those at least those lines would need to be changed:

src/lux-meta.ts thermalenergy_heating: { role: 'value.power.consumption', type: 'number', unit: 'kWh' }, thermalenergy_warmwater: { role: 'value.power.consumption', type: 'number', unit: 'kWh' }, thermalenergy_pool: { role: 'value.power.consumption', type: 'number', unit: 'kWh' },

But I have no clue on how or what else :D In any case thanks to UncleSamSwiss for the cool module!

brandac commented 1 year ago

same here :)

felsnerino commented 1 year ago

it would be great to be able to log this too... I tried to have a look myself, but just didn't understand how the luxmet.js file needs to be updated... Please help us! really great adapter!!

Stroell commented 1 year ago

Same issue here

heatpumper commented 1 year ago

I did some investigation. It seems that with the new update to 3.8.8 the data of the heatpump has a new sublevel after the "energiemonitor" - it splits up in 'Wärmemenge' and 'Eingesetzte Energie'. Therefore the skript reading the values would need to consider this additional level as well. I assume the change is required in the main.js starting from line 131 onwards: async createLuxTreeAsync() { for (const sectionName in lux_meta_1.luxMeta) { const section = lux_meta_1.luxMeta[sectionName]; await this.extendObjectAsync(sectionName, { type: 'channel', common: { name: sectionName, }, }); for (const itemName in section) { const item = section[itemName]; if (!item) { // ignore it continue; }

Is there someone who can add this loop of investigation?

Stroell commented 1 year ago

Hey @UncleSamSwiss any chance you can have a look at this? I spend way to much time today to understand the issue, but I don´t get the problem :(

As mentioned above, the values for 'Wärmemenge' are now in a different section, once the Luxtronik got updated to a later version: grafik

You can also see this on the Website of the Luxtronik as well:

grafik

Thank you 👍

protree commented 10 months ago

I looked at the code and I think I found the bug. The problem seems to be in function handleWsMessageAsync in line 383 onwards in main.js. It misinterprets the subSections "Eingesetzte Energie" and "Wärmemenge" as items and doesn't loop through the actual "subitems". I created an additional check for the subsections and its items. It seems to work for me.

DISCLAIMER: I take no responsebility whatsoever for my code and any potential damage on your devices! I created the fix primarily for myself and won't maintain it.

You can try my fix here: https://github.com/protree/ioBroker.luxtronik2

If I find some spare time I might clean up the code and create a pull request.

EDIT: I don't really understand what the function createLuxTreeAsync actually does but it doen't seem to be related to the problem...

heatpumper commented 7 months ago

I looked at the code and I think I found the bug. The problem seems to be in function handleWsMessageAsync in line 383 onwards in main.js. It misinterprets the subSections "Eingesetzte Energie" and "Wärmemenge" as items and doesn't loop through the actual "subitems". I created an additional check for the subsections and its items. It seems to work for me.

DISCLAIMER: I take no responsebility whatsoever for my code and any potential damage on your devices! I created the fix primarily for myself and won't maintain it.

You can try my fix here: https://github.com/protree/ioBroker.luxtronik2

If I find some spare time I might clean up the code and create a pull request.

EDIT: I don't really understand what the function createLuxTreeAsync actually does but it doen't seem to be related to the problem...

Hi @protree, thank you for fixing it. I tried to take over your changes - but did not succeed. How can I add your change? I tried to add it to my local installation directly but could not find the main.js file in my local iobroker installation.

protree commented 7 months ago

This should help :)

https://www.smarthome-tricks.de/software-iobroker/adapter-von-github-installieren/amp/

heatpumper commented 7 months ago

Super, this works out perfectly! Thank you very much!