THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.

Begonnen von immi, 02 Februar 2015, 11:42:16

Vorheriges Thema - Nächstes Thema

immi

Dear all
In FHEM, the communication (logging and controlling) to THZ Tecalor (aka LWZ Stiebel Eltron) heatpump has been implemented.
Module 00_THZ.pm reached a good maturity level (now version 0.130), but remember: do not relay on it for critical applications.
It has been written for experienced users, with a deep understanding of the heatpump. Always think twice before writing back to the heatpump.

Please consider that no official documentation from Tecalor exists.  At the moment, by reverse engineering, 3 groups of heatpumps have been identified. The optional attribute "firmware" takes care of fixing the differences.

Please start with reading the wiki and the command_ref:
DE http://www.fhemwiki.de/wiki/Tecalor_THZ_W%C3%A4rmepumpe
EN http://www.fhemwiki.de/wiki/Tecalor_THZ_Heatpump
En/de http://fhem.de/commandref.html#THZ

Please use this thread, if you want to discuss about the module itself, bug-fixes, code improvements.
A second thread  THZ Tecalor (LWZ Stiebel Eltron) Wärmepumpe -Optimierung und Erfahrungsaustausch should be used for heatpump optimization and experience exchange.

Before posting please
1)   read the original thread with 1397 posts http://forum.fhem.de/index.php/topic,13132.1395.html
2)   keep FHEM updated: use the update command and restart fhem
3)   post in English as preferred language: your question will be probably better understood. German is also fine as second choice.

have fun
immi

houseowner123

v.130 works great for me with a room temp probe. The operating point on the heating curve is now spot on! :) See screen shot. Thanks also for finding p99 "inside therm correction".

immi

v 0.131 uploaded
changelog
- added p35PasteurisationInterval, p35PasteurisationTemp,   p34BoosterDHWTempAct, p99DHWmaxFlowTemp, p89DHWeco
immi

belu

Hi,

wie versprochen die Erweiterungen mit dem Display...



# Aufruf der Intervalle, hier werden benötigt
attr Mythz interval_sGlobal 300
attr Mythz interval_sHC1 300
attr Mythz interval_sFlowRate 300
attr Mythz interval_sDisplay 300

#userReadings  hier werden die Userreagings für das Display generiert

attr Mythz userReadings sD_outsideTemp {(split ' ',ReadingsVal("Mythz","sHC1",0))[1]}, sD_flowTemp {(split ' ',ReadingsVal("Mythz","sHC1",0))[9]}, sD_returnTemp {(split ' ',ReadingsVal("Mythz","sHC1",0))[5]}, sD_insideTempRC {(split ' ',ReadingsVal("Mythz","sHC1",0))[27]}, sD_sFlowRate {(split ' ',ReadingsVal("Mythz","sFlowRate",0))[0]}, sD_dhw_temp {(split ' ',ReadingsVal("Mythz","sDHW",0))[1]}, sD_switchingProg {(split ' ',ReadingsVal("Mythz","sDisplay",0))[1]}, sD_compressor {(split ' ',ReadingsVal("Mythz","sDisplay",0))[3]}, sD_heatingHC {(split ' ',ReadingsVal("Mythz","sDisplay",0))[5]}, sD_heatingDHW {(split ' ',ReadingsVal("Mythz","sDisplay",0))[7]}, sD_boosterHC {(split ' ',ReadingsVal("Mythz","sDisplay",0))[9]}, sD_filterBoth {(split ' ',ReadingsVal("Mythz","sDisplay",0))[11]}, sD_ventStage {(split ' ',ReadingsVal("Mythz","sDisplay",0))[13]}, sD_pumpHC {(split ' ',ReadingsVal("Mythz","sDisplay",0))[15]}, sD_defrost {(split ' ',ReadingsVal("Mythz","sDisplay",0))[17]}, sD_filterUp {(split ' ',ReadingsVal("Mythz","sDisplay",0))[19]}, sD_filterDown {(split ' ',ReadingsVal("Mythz","sDisplay",0))[21]}

#### Status Symbole des Displays werden generiert

define rg_thz_stat readingsGroup \
Mythz:<Schaltprogramm>,sD_switchingProg \
Mythz:<Verdichter>,sD_compressor \
Mythz:<Heizen>,sD_heatingHC \
Mythz:<Warmwasserbereitung>,sD_heatingDHW \
Mythz:<Elektrische_Nachheizstufen>,sD_boosterHC \
Mythz:<Heizkreispumpe>,sD_pumpHC \
Mythz:<Abtauen_Verdampfer>,sD_defrost \
Mythz:<Lüfterstufe>,sD_ventStage \
Mythz:<Filter_oben>,sD_filterUp \
Mythz:<Filter_unten>,sD_filterDown \
Mythz:<Filterwechsel_ou>,sD_filterBoth

#Attribute für Status

attr rg_thz_stat alias Status
attr rg_thz_stat group THZ
attr rg_thz_stat room Sysintern
attr rg_thz_stat nonames 1

# Zuweisung der readings in Verbindung mit Symbolen

attr rg_thz_stat valueIcon {'sD_switchingProg.1'=>'hourglass@blue','sD_switchingProg.0'=>'hourglass', 'sD_compressor.1'=>'sani_garden_pump@blue','sD_compressor.0'=>'sani_garden_pump', 'sD_heatingHC.1'=>'sani_floor_heating_neutral@blue','sD_heatingHC.0'=>'sani_floor_heating_neutral', 'sD_heatingDHW.1'=>'sani_domestic_waterworks@blue','sD_heatingDHW.0'=>'sani_domestic_waterworks', 'sD_boosterHC.1'=>'sani_heating_boost@red','sD_boosterHC.0'=>'sani_heating_boost', 'sD_pumpHC.1'=>'sani_pump@blue','sD_pumpHC.0'=>'sani_pump', 'sD_defrost.1'=>'weather_frost@blue','sD_defrost.0'=>'weather_frost', 'sD_ventStage.1'=>'vent_ventilation_level_3@blue','sD_ventStage.0'=>'vent_ventilation', 'sD_filterUp.1'=>'vent_ventilation_level_manual_m@red','sD_filterUp.0'=>'vent_ventilation_level_automatic', 'sD_filterDown.1'=>'vent_ventilation_level_manual_m@red','sD_filterDown.0'=>'vent_ventilation_level_automatic', 'sD_filterBoth.1'=>'vent_ventilation_level_manual_m@red','sD_filterBoth.0'=>'vent_ventilation_level_automatic'}

# Anzeige der Prozesswerte aus den userreadings von oben

define rg_thz readingsGroup \
Mythz:<%temp_outside>,<Aussentemperatur>,sD_outsideTemp \
Mythz:<%temp_inside>,<Innentemperatur>,sD_insideTempRC \
Mythz:<%sani_supply_temp@red>,<Vorlauf>,sD_flowTemp \
Mythz:<%sani_return_temp@blue>,<Rücklauf>,sD_returnTemp \
Mythz:<%sani_pump>,<Durchfluss>,sD_sFlowRate \
Mythz:<%sani_boiler_temp@BD7800>,<Wassertemperatur>,sD_dhw_temp

# Attribute der Prozesswerte

attr rg_thz alias Prozesswerte
attr rg_thz group THZ
attr rg_thz room Sysintern

# Formatierung der Prozesswerte

attr rg_thz valueFormat { sD_outsideTemp => '%.1f °C', sD_insideTempRC => '%.1f °C', sD_flowTemp => '%.1f °C', sD_returnTemp => '%.1f °C', sD_sFlowRate => '%.1f cl/min', sD_dhw_temp => '%.1f °C' }



Ist jetzt die erste Version ist so ein eine Mischung aus Andre.k bzw dem Anzeigen der Prozesswerte aus dem Wiki.

Ich finde es ganz praktisch weil man alles wesentliche auf einem Blick hat.

LG

Belu

immi

Hi Belu, Hi Andre.k
I like both solution a lot.
But, I do not want to update sDisplay too often (e.g. each 30 sec)
What I miss is, an automatic way to update sDisplay before the webpage is generated.
Untill we find it, it makes sense to add a button "refresh"
immi

belu

@Immi,

ich finde ja das du recht hast, das mit den Intervallen nimmt überhand. Da sollten wir zusammenlegen bzw die Daten reduzieren. meinen sD_ Userreadings. Man benötigt sie nur wenn man schaut, wenn ich den HTTP aufruf mache. soll heißen wenn ich mich in FHEM einloggen kann er gern alle 30 Sekunden einen refresh machen, aber nur dann. In der ganzen Zeit wo ich nicht auf FHEM zugreife sollten die Daten auch nicht wirklich regestriert werden.

Hast du eine Idee wie man das umsetzt?
Aktuell ist es ja so das er nur ein Logeintrag schreibt aus den userreadings wenn wirklich eine Statusänderung des Wertes erfolgt, habe mir die Log genau angeschaut.

Was mir noch aufgefallen ist, es sind ja einige Readings Doppelt die auch geloggt werden.

sHC1 und sGlobal z.b

2015-02-05_08:54:24 Mythz sGlobal: outsideTemp: -5.7 flowTemp: 24.6 returnTemp: 23 hotGasTemp: 29.8 dhwTemp: 46.3 flowTempHC2: -60 evaporatorTemp: 5.3 condenserTemp: 23.5 mixerOpen: 0 mixerClosed: 0 heatPipeValve: 0 diverterValve: 0 dhwPump: 0 heatingCircuitPump: 0 solarPump: 0 compressor: 0 boosterStage3: 0 boosterStage2: 0 boosterStage1: 0 highPressureSensor: 0 lowPressureSensor: 1 evaporatorIceMonitor: 0 signalAnode: 0 evuRelease: 1 ovenFireplace: 0 STB: 0 outputVentilatorPower: 31 inputVentilatorPower: 30 mainVentilatorPower: 0 outputVentilatorSpeed: 29 inputVentilatorSpeed: 22 mainVentilatorSpeed: 0 outside_tempFiltered: -6.9 relHumidity: 0 dewPoint: 0 P_Nd: 5.33 P_Hd: 10.28 actualPower_Qc: 0.000 actualPower_Pel: 0.000 collectorTemp: -60 insideTemp: 26

2015-02-05_08:55:19 Mythz sHC1: outsideTemp: -5.7 x08: -32.5 returnTemp: 23 integralHeat: -4 flowTemp: 24.6 heatSetTemp: 26 heatTemp: 23.4 seasonMode: winter integralSwitch: 100 opMode: normal roomSetTemp: 20 x60: 0 x64: 691.2 insideTempRC: 22.7 x72: 0 x76: 2.7

outsideTemp returnTemp flowTemp das sind ja werte die wirklich doppelt sind und nicht notwendig.

Die sGlobal z.b wird ja alle 5 Minuten komplett geschrieben. Es gibt werte die werden immer mit geschrieben. Könnte man da nicht so ne Änderung einbringen das nur geschrieben wird was sich geändert hat.
Dadurch würde sich die Datenlast direkt um 50 % reduzieren. bei sDiyplay hätten wir vielleicht 50 Logeinträge pro Tage, bei sGlobal wären es auch sicherlich wesentlich weniger.



willybauss

Zitat von: belu am 05 Februar 2015, 09:19:28
Könnte man da nicht so ne Änderung einbringen das nur geschrieben wird was sich geändert hat.
sGlobal (as well as the other multi-data readings) always needs to have same sequence of data (sort order, number of values). Otherwise you wouldn't be able to create gplots or data extraction for other purposes; all data extractions rely on index number inside the data string.

For limiting the readings when no web UI is open you could do it similarly as my photovoltaik logging solution:

+*{sunrise_rel("REAL",-3600)} set PV_Zaehler INTERVAL 300
+*{sunset_rel("REAL",+1800)} set PV_Zaehler INTERVAL 3600

Just the triggers need to be replaced by something like "web UI open/closed". But this sounds easier that it might be ...
FHEM auf Raspberry Pi B und 2B; THZ (THZ-303SOL), CUL_HM, TCM-EnOcean, SamsungTV, JSONMETER, SYSMON, OBIS, STATISTICS

immi

Zitat von: belu am 05 Februar 2015, 09:19:28
Hast du eine Idee wie man das umsetzt?
no. I am still searcing for the perfect setting. My actual setting is

attr Mythz event-min-interval s.*:4800
attr Mythz event-on-change-reading .*

This means log only what changes. If something starting with "s" does not change for 80 min log it anyhow.
This does not influence sGlobal and sHC1, which are changing very often because contain many parameters.
Solution split sGlobal and sHC1 and log on change.
This is not elegant, therefore I do not do it :)
------------------
sDisplay doesn´t need to be logged at all--> easy
complex part (at least for me) is to update it only before the webpage is built
------------------
p.s. I like the elegant solution from Willy "changing the refresh interval depending on the time during the date", which I will use for another device.
immi

belu

Also meine Raspberry Pi 2 ist heute gekommen. Das wirklich ein Unterschied... Das ist erstmal die bessere Lösung :D

micomat

Zitat von: belu am 06 Februar 2015, 00:27:12
Also meine Raspberry Pi 2 ist heute gekommen. Das wirklich ein Unterschied... Das ist erstmal die bessere Lösung :D

meiner sollte heute ankommen :)
Synology DS218+ with fhem+iobroker in docker, 2x RasPi w. ser2net, CUL433+868, IT, EGPM2LAN, THZ/LWZ, FB_Callmonitor, HMS100TF, Homematic, 2x TX3-TH, Pushover, USB-IR-SML-Head, SONOS, GHoma, MBus, KLF200

willybauss

So lange meiner bei 2 - 3% CPU-Auslastung rum dümpelt sehe ich keinen Grund zum Raspi2, es sei denn die Zugriffszeiten auf die Filelogs, die im Filesystem meines NAS ausgelagert sind (NFS-mount) werden dramatisch besser.
FHEM auf Raspberry Pi B und 2B; THZ (THZ-303SOL), CUL_HM, TCM-EnOcean, SamsungTV, JSONMETER, SYSMON, OBIS, STATISTICS

immi

I installed a internal temp sensor last week-end;  The NXP KTY81 component has a terrible off-set of -5k :)

Now I am trying to understand the data delivered by the new parameter sHC1->insideTempRC
something is wrong if you look at following plot

In red you find the actual temp of a reliable sensor 1 meter away.
In brown you find the actual temp of the NXP-KTY81 (sHC1->insideTempRC)
In lila you find the flow temperature.

What you see is that when the compressor starts and the flow temperature increases, the NXP-KTY81 suddently decreases.
This makes no sense to me now, maybe you have an explanation or maybe you have the same behaviour.
immi

toggle

Are you sure that this is the intended use of insideTempRC? According to the feedback I think that this parameter is only valid if you have a remote control. In my heat pump the returned value is always 21. Shouldn't the additional temp sensor be displayed in sGlobal->roomTemp?

If the analog circuit for the temp sensor is not stabilzed properly any spikes etc. could influence the A/D converter.
THZ404SOL (FW 5.39, SW ID 7278, 14.03.2014)

immi

Zitat von: toggle am 06 Februar 2015, 19:07:26
Are you sure that this is the intended use of insideTempRC? According to the feedback I think that this parameter is only valid if you have a remote control. In my heat pump the returned value is always 21. Shouldn't the additional temp sensor be displayed in sGlobal->roomTemp?

If the analog circuit for the temp sensor is not stabilzed properly any spikes etc. could influence the A/D converter.
before installing the kty81 
sGlobal->roomTemp was -60C and sHC1->insideTempRC was always set-temp

after installing it,
sGlobal->roomTemp is the measured temperature and sHC1->insideTempRC is roomtemp plus p99RoomThermCorrection

what you mean by stabilizing? you mean shielding the cable? 
from the my measurements I should have spikes (pulses) which are 25 min long
strange
immi

toggle

Zitat von: immi am 06 Februar 2015, 20:20:21
what you mean by stabilizing? you mean shielding the cable? 
No, I meant the hardware implementation of the A/D part on the main board.
THZ404SOL (FW 5.39, SW ID 7278, 14.03.2014)