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

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

Vorheriges Thema - Nächstes Thema

willybauss

My feature to switch between DHW mode and automatic mode works quite well, but tonight I observed an unexpected behavior:
# prüfe alle 2 Stunden um xx:03:00 ob zu kalt und schalte ggf. Heizung ein
define OpModeDhwToAuto at +*02:00:00 IF (([Mythz:sHC1:[insideTempRC. (\d+)]] < [Mythz:p02RoomTempNightHC1:d]) and ([Mythz:pOpMode] eq "DHWmode")) (set Mythz pOpMode automatic)
attr OpModeDhwToAuto alignTime 00:03:00
attr OpModeDhwToAuto room Heizung

# prüfe 1 mal nachts un 2 Uhr, ob innen und aussen warm genug und schalte ggf, Heizung aus
define OpModeAutoToDhw at *02:02:00 IF (([Mythz:sHC1:[insideTempRC. (\d+)]] > [Mythz:p02RoomTempNightHC1:d]) and ([Mythz:outside_temp] > 4) and ([Mythz:pOpMode] eq "automatic")) (set Mythz pOpMode DHWmode)
attr OpModeAutoToDhw room Heizung

p02RoomTempNightHC1  is set to 21.5 °C.
So I expect the mode to switch from DHW to automatic just if insideTempRC is less than 21.5°C. But tonight this switch happened while insideTempRC was at 21.9°C. Can anyone imagine why?  As far as I understand the regular expression   (\d+)  should just cut the ' °C' part, but should not cut the '.9' as well. May I need to replace the dot by a comma, or what could be the root cause and/or the solution?
FHEM auf Raspberry Pi B und 2B; THZ (THZ-303SOL), CUL_HM, TCM-EnOcean, SamsungTV, JSONMETER, SYSMON, OBIS, STATISTICS

der-Lolo

Hey Willi,
i don't know what happens there, but when i try with Regex things i allways use a page like that one
http://www.regexr.com/
Copy & paste the related event to the field - an the REGEX to the line more in top...

enjoy & good luck!


immi

Zitat von: willybauss am 22 Mai 2015, 16:38:36
So I expect the mode to switch from DHW to automatic just if insideTempRC is less than 21.5°C. But tonight this switch happened while insideTempRC was at 21.9°C. Can anyone imagine why?  As far as I understand the regular expression   (\d+)  should just cut the ' °C' part, but should not cut the '.9' as well. May I need to replace the dot by a comma, or what could be the root cause and/or the solution?

Hi Willy
it probably truncates...
instead of insideTempRC. (\d+)
try following

insideTempRC. (-?\d+(\.\d+)?)
or
insideTempRC. (\S+)

I just tested them with http://www.regexr.com/ from der-lolo and they seam to work

p.s. why don´t you use doif intead of at+if ?
doif  shows you each condition in the frontend.
immi

willybauss

@ der-Lolo:
Thanks for the link - looks really good

@ immi:
Looks like  (\S+)  should work and is much easier than the other one. I'll test it for a while.

at + IF  <=> DOIF:
I had already changed everything to DOIF, but then I realized that the clear visibility of next execution time was gone. DOIF shows in the frontend something like

DOIF
Mythz.alarm_insideTempHigh  cmd_2
Mythz.alarm_insideTempLow   cmd_2


while the at + IF combination shows e.g.
at
OpModeAutoToDhw   Next: 02:02:00
OpModeDhwToAuto   Next: 10:03:00
FHEM auf Raspberry Pi B und 2B; THZ (THZ-303SOL), CUL_HM, TCM-EnOcean, SamsungTV, JSONMETER, SYSMON, OBIS, STATISTICS

willybauss

a different topic:
I frequently observe the issue, that unscheduled fan selector changes  (p43 ... p46)  are often not accepted by the THZ, though correctly requested via FHEM or via display. Again: even THZ display driven changes are not always executed by the THZ !

I believe I'm not the only one having this problem.

I wonder if I should enhance my fhem code to check shortly after every change if it works and redo the action if necessary. On the other side I think it's a more common issue and therefore might belong to the THZ module.

Any comments?
FHEM auf Raspberry Pi B und 2B; THZ (THZ-303SOL), CUL_HM, TCM-EnOcean, SamsungTV, JSONMETER, SYSMON, OBIS, STATISTICS

immi

Hi Willy
I thought on "unscheduled fan"
the peculiar feature about the parameter is that its status does tell you if it is active or not.
this means that you have to  monitor the speed of the fan in order to chek if it is activated..... and combining the two readings (to make it really failproof) is not easy.

therefore I differenciate.

If I want something "now" like "turn off the  vent for 1h because someone cuts  the grass", I use FHEM with the button 60minoff.
Easy and reliable.

If I want something automatic like "increase the speed of the vent for 30 min if airquality is low", I prefer unscheduled-fan.
It is not reliable, but I do not care, because if it doesn´t  start now, it will start 30 min later, if the airquality is still bad.

willybauss

unfortunately I do not yet have a connection between fan speed and air quality, so I have to do it manually. And in that case there's no automatic re-check every 30 minutes ...
FHEM auf Raspberry Pi B und 2B; THZ (THZ-303SOL), CUL_HM, TCM-EnOcean, SamsungTV, JSONMETER, SYSMON, OBIS, STATISTICS

NaCkHaYeD

#247
Hi,

ich wollte wie in diesem Thread schon Mal besprochen mir eine Mail bei diversen Events auf Handy schicken lassen, z.B. wenn der Unterdrucksensor geschalten hat, da dieser bei mir resettet werden muss. Hierzu benutze ich
define Mythz.alarm_ovenFireplace notify Mythz { if (((split ' ',ReadingsVal("Mythz","sGlobal",0))[49]) < ReadingsVal("Mythz", "ovenFireplace_old", 0)) { DebianMail('abc@@xyz.de','Alarm Waermepumpe, Unterdrucksensor','Unterdrucksensor für Kamin hat ausgelöst. Bitte an der Messdose oberhalb vom Kühlschrank die rechte Taste(Enter) zur Quittierung für 3sec drücken.','') ;; } fhem("setreading Mythz ovenFireplace_old ". ((split ' ',ReadingsVal("Mythz","sGlobal",0))[49]));; }

Dies funktioniert soweit bis auf zwei Einschränkungen.

1. Bei Stromausfall geht der Sensor auf Störung. Eine Mail kann aber nicht gesendet werden, da auch die DSL Leitung tod ist. Geht die Leitung wieder ist mein Trigger mit ovenFireplace < ovenFireplace_old vorüber.
2. Der Sensor macht ab und dann einen Selbsttest, d.h. auch hier bekommt die Wärmepumpe den Schaltkontakt mit. Die Mail darf aber nicht verschickt werden.

Idee:
1. Ich habe mir in SendMail einen Rückgabewert eingebaut, der das Successful prüft und so der Gedanke erst dann die Variable ovenFireplace in ovenFireplaceOld kopiert
2. Ich wollte mir mit ovenFireplace < ovenFireplace_old ein Event Triggern, dass beim nächsten Mal Lesen der sGlobals prüft, ob immer noch der Fehler ansteht. Wenn ja, dann erst Mail.

Problem:
Ich scheitere klaglos an FHEM Notify etc. Hat jemand eine Idee wie man einen Einschaltverzögerer baut und zusätzlich noch den positiven SendMail abfragt. Also dass ich SendMail mit "&&" verknüseln muss, dass weiß ich, jedoch wie der ganze Abschnitt lauten muss.

mfg
NaCkHaYeD

mlb

Zitat von: willybauss am 23 Mai 2015, 08:21:29
I frequently observe the issue, that unscheduled fan selector changes  (p43 ... p46)  are often not accepted by the THZ, though correctly requested via FHEM or via display. Again: even THZ display driven changes are not always executed by the THZ !

I believe I'm not the only one having this problem.

I wonder if I should enhance my fhem code to check shortly after every change if it works and redo the action if necessary. On the other side I think it's a more common issue and therefore might belong to the THZ module.

Any comments?

I can confirm - it usually does not start for me immediately when I'm trying to activate any of unscheduled fans level.
However I have noticed that my LWZ usually starts fans if I do a sequence:

step 1 - start level x
step 2 - pause a couple of seconds
step 3 - start level 0
step 4 - pause a couple of seconds
step 5 - start level x
(where x is in 1..3)

I wonder if you experienced such behaviour too... if so, maybe it would be worth to automate it?
LWZ 403SOL, FHEM + HomeAssistant

NaCkHaYeD

About the unscheduled fan selector changes i can also confirm this issue. I Need about two or three times pressing the Level setting, otherwise the THZ seems to ignore it. I think it doesn´t depend on the Level I press. I can also press three times the same, and it works also.

Anyway, nice FHEM Lib, i appreciate the work on it. It is not a big deal for me.

mfg
NaCkHaYeD

mlb

FHEM could help starting ventilation automatically at night (and p75passiveCooling = 1), after specific conditions are met.. I had a look at DOIF function, just the following returns error at set Mythz p99startUnschedVent 1, I have no idea why...
define AutoCoolingVentilation DOIF ([23:00-04:00] and [Mythz:inside_temp] > 26 and [Mythz:outside_temp] < 19 and [Mythz:outputVentilatorPower] eq 0) (set Mythz p99startUnschedVent 1)
LWZ 403SOL, FHEM + HomeAssistant

immi

Hi mlb
there are may things that could be a problem
1) eq  expects a string "0"  ; or you can use == 0
2) do you have user-defined inside_temp, outside_temp and  outputVentilatorPower outside of sGlobal?
or rewording, what happens when you write {ReadingsVal("Mythz","inside_temp","NaN")} or {ReadingsVal("Mythz","outputVentilatorPower","NaN")}

immi

mlb

Hi immi

Readings seem to work fine, please see the attached screenshot... Where this error could come from?

Also in log file I have 2015.07.24 20:02:25 2: AutoCoolingVentilationTest: set Mythz p99startUnschedVent 3: 3

Regards
LWZ 403SOL, FHEM + HomeAssistant

immi

if you get such a logfile it means the doif worked fine
2015.07.24 20:02:25 2: AutoCoolingVentilationTest: set Mythz p99startUnschedVent 3: 3

I have no idea what is the error field: you shoud ask damian, as PM and post the anwer here, or under Automatisierung

Damian

Zitat von: mlb am 24 Juli 2015, 20:06:46
Hi immi

Readings seem to work fine, please see the attached screenshot... Where this error could come from?

Also in log file I have 2015.07.24 20:02:25 2: AutoCoolingVentilationTest: set Mythz p99startUnschedVent 3: 3

Regards

error is set if the return value of the function (here: set Mythz p99startUnschedVent 3) is not zero or not "". But it has no effect on the execution.

Damian
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF