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

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

sunrise

@willybauss @immi
Vielen Dank! I have corrected the shield to be grounded on the Raspi's side of the cable.

The "Can't connect" below seems to appear at a time when the USB serial connection (ser2net) has not yet been established but does not seem to matter, as I can later read and change the values under "Mythz". BTW, 2000 is the port defined in ser2net.yaml.
2022.11.29 10:11:47 3: Opening Mythz device pi.fritz.box:2000
2022.11.29 10:11:47 1: Mythz: Can't connect to pi.fritz.box:2000: Invalid argument


Unfortunately, I still see "too slow" messages in the log:
2022.11.29 10:11:35 0: Server shutdown
2022.11.29 10:11:46 1: Including fhem.cfg
2022.11.29 10:11:47 3: WEB: port 8083 opened
2022.11.29 10:11:47 2: eventTypes: loaded 211 lines from ./log/eventTypes.txt
2022.11.29 10:11:47 3: Opening Mythz device pi.fritz.box:2000
2022.11.29 10:11:47 1: Mythz: Can't connect to pi.fritz.box:2000: Invalid argument
2022.11.29 10:11:47 1: Including ./log/fhem.save
2022.11.29 10:11:47 1: Messages collected while initializing FHEM:SecurityCheck:
  WEB is not password protected

Protect this FHEM installation by defining an allowed device with define allowed allowed
You can disable this message with attr global motd none

2022.11.29 10:11:47 1: usb create starting
2022.11.29 10:11:48 3: Probing ZWDongle device /dev/serial0
2022.11.29 10:11:48 3: Probing CUL device /dev/ttyAMA0
2022.11.29 10:11:48 3: Probing TCM_ESP3 device /dev/ttyAMA0
2022.11.29 10:11:48 3: Probing ZWDongle device /dev/ttyAMA0
2022.11.29 10:11:48 3: Probing SIGNALDuino device /dev/ttyAMA0
2022.11.29 10:11:49 3: Probing MYSENSORS device /dev/ttyAMA0
2022.11.29 10:11:49 3: Probing ArduCounter device /dev/ttyAMA0
2022.11.29 10:11:49 3: Probing ElsnerWS device /dev/ttyAMA0
2022.11.29 10:11:50 3: Probing FRM device /dev/ttyAMA0
2022.11.29 10:11:55 3: Probing TCM_ESP3 device /dev/ttyUSB0
2022.11.29 10:11:56 3: Probing TCM_ESP2 device /dev/ttyUSB0
2022.11.29 10:11:56 3: Probing FHZ device /dev/ttyUSB0
2022.11.29 10:11:56 3: Probing TRX device /dev/ttyUSB0
2022.11.29 10:11:57 3: Probing ZWDongle device /dev/ttyUSB0
2022.11.29 10:11:58 3: Probing SIGNALDuino device /dev/ttyUSB0
2022.11.29 10:11:58 3: Probing MYSENSORS device /dev/ttyUSB0
2022.11.29 10:11:59 3: Probing ArduCounter device /dev/ttyUSB0
2022.11.29 10:11:59 3: Probing ElsnerWS device /dev/ttyUSB0
2022.11.29 10:12:00 3: Probing FRM device /dev/ttyUSB0
2022.11.29 10:12:06 1: usb create end
2022.11.29 10:12:06 0: Featurelevel: 6.1
2022.11.29 10:12:06 0: Server started with 9 defined entities (fhem.pl:26635/2022-11-01 perl:5.032001 os:linux user:fhem pid:421)
2022.11.29 10:12:06 1: pi4.fritz.box:1883 reappeared (MyMQTT)
2022.11.29 10:12:52 1: pi.fritz.box:2000 reappeared (Mythz)
2022.11.29 10:12:54 3: Mythz/RAW: THZ_ReadAnswer: InterfaceNotRespondig. Maybe too slow
2022.11.29 10:21:49 3: THZ_Get: Error msg2:  THZ_ReadAnswer: InterfaceNotRespondig. Maybe too slow THZ_Get_Com: error found at step1  -- 06 ->
2022.11.29 10:24:30 3: THZ_Get: Error msg2:  THZ_ReadAnswer: InterfaceNotRespondig. Maybe too slow THZ_Get_Com: error found at step1  -- 07 ->
2022.11.29 10:26:43 3: THZ_Get: Error msg2:  THZ_ReadAnswer: InterfaceNotRespondig. Maybe too slow THZ_Get_Com: error found at step1  -- 0D ->
2022.11.29 10:26:43 1: PERL WARNING: Use of uninitialized value $msg2 in concatenation (.) or string at ./FHEM/00_THZ.pm line 1460.
2022.11.29 10:26:43 1: PERL WARNING: Use of uninitialized value $msg2 in concatenation (.) or string at ./FHEM/00_THZ.pm line 1488.
2022.11.29 10:30:13 3: THZ_Get: Error msg2:  THZ_ReadAnswer: InterfaceNotRespondig. Maybe too slow THZ_Get_Com: error found at step1  -- 07 ->
2022.11.29 10:34:28 3: THZ_Get: Error msg2:  THZ_ReadAnswer: InterfaceNotRespondig. Maybe too slow THZ_Get_Com: error found at step1  -- 0A ->
2022.11.29 10:34:29 3: Mythz/RAW: 01021A171003decode: CRC error in request

It seems that the RPi2 is not apt for fhem. At least in my case, I don't know what else I could do (except changing the RPi hardware).

Do you know if the PERL WARNINGs are related to the "too slow" problem?
2022.11.29 10:26:43 1: PERL WARNING: Use of uninitialized value $msg2 in concatenation (.) or string at ./FHEM/00_THZ.pm line 1460.
2022.11.29 10:26:43 1: PERL WARNING: Use of uninitialized value $msg2 in concatenation (.) or string at ./FHEM/00_THZ.pm line 1488.


It's about these code lines ($msg2 variable in second last row):
    if(defined($parent) ) {
        my ($seconds, $microseconds) = gettimeofday();
        $seconds= abs($seconds - time_str2num(ReadingsTimestamp($name, $parent, "1970-01-01 01:00:00")));
        my $risultato=ReadingsVal($name, $parent, 0);
        $risultato=THZ_Get($hash, $name, $parent) if ($seconds > 29 ); #update of the parent: if under 29sec use the current value
        #$risultato=THZ_Parse1($hash,"B81700C800BE00A001C20190006402010000E601D602");
        my $parenthash=$gets{$parent}; my $parsingrule = $parsinghash{$parenthash->{type}};
        my $i=0;
        for  (@$parsingrule) {
            last if ((@$parsingrule[$i]->[0]) =~ m/$cmd/);
            $i++;
            }
        $msg2=(split ' ', $risultato)[$i*2+1];
        Log3 $hash->{NAME}, 5, "THZ_split: $msg2 --- $risultato";
    }


And the context of the second warning (line 1488) is this:
    my $unit = $cmdhash->{unit};
    $msg2 = $msg2 .  $unit  if(defined($unit)) ;
    my $activatetrigger =1;
    readingsSingleUpdate($hash, $cmd, $msg2, $activatetrigger);
    return ($msg2);  
Viele Grüße/kind regards
sunrise
_________________
Tecalor THZ 303 (SOL, 2006/09-2008/08), FW 2.16 | FHEM THZ module testing with FW 2.06 (INTEGRAL, 2006/12-2008/08) & FW 2.14 (SOL, 2002/10-2004/08) on Raspberry Pi 2

zimb0

Hi all,

sFirmware version: 07.59
sFirmware-Id HW: 239 SW: 4.04 Date: JUN 18 2018

Which attr Firmware should I choose?`
Running without attribute in the past, just changed to 5.39 (which is wrong I think).
However after setting 5.39 I can read and write  p99PumpRateDHW and p99PumpRateHC
Can I Stick to 5.39?

THZ504

sunrise

Seeing the frequency of these "too slow" messages, would the experts here see this as a problem that I definitely should address, or is this something I can and should live with? I ask in order to better understand if the current status could become a "show stopper" for me?
Viele Grüße/kind regards
sunrise
_________________
Tecalor THZ 303 (SOL, 2006/09-2008/08), FW 2.16 | FHEM THZ module testing with FW 2.06 (INTEGRAL, 2006/12-2008/08) & FW 2.14 (SOL, 2002/10-2004/08) on Raspberry Pi 2

sunrise

I have replaced the RPi2 by a VM on a Symphony Diskstation DS918+ with 2GB RAM for the Debian 64bit guest OS and chem installed and Mythz defined. I still get "too slow" messages. Ser2net.yaml contains this:

define: &banner \r\nser2net port \p device \d [\B] (Debian GNU/Linux)\r\n\r\n

connection: &con0096
   accepter: tcp,2000
    enable: on
    options:
      banner: *banner
      kickolduser: true
      telnet-brk-on-sync: true
    connector: serialdev,
              /dev/ttyUSB0,
              9600n81,local

The baud rate set to 9600 should be correct for my old THZ 303 SOL, right?
I'm really lost as to what causes these messages. Maybe it's because my firmware is not officially supported?
Viele Grüße/kind regards
sunrise
_________________
Tecalor THZ 303 (SOL, 2006/09-2008/08), FW 2.16 | FHEM THZ module testing with FW 2.06 (INTEGRAL, 2006/12-2008/08) & FW 2.14 (SOL, 2002/10-2004/08) on Raspberry Pi 2

willybauss

if there's nothing else but some messages, please try to ignore.
FHEM auf Raspberry Pi B und 2B; THZ (THZ-303SOL), CUL_HM, TCM-EnOcean, SamsungTV, JSONMETER, SYSMON, OBIS, STATISTICS

willybauss

Zitat von: zimb0 am 29 November 2022, 14:18:50
Hi all,

sFirmware version: 07.59
sFirmware-Id HW: 239 SW: 4.04 Date: JUN 18 2018

Which attr Firmware should I choose?`
Running without attribute in the past, just changed to 5.39 (which is wrong I think).
However after setting 5.39 I can read and write  p99PumpRateDHW and p99PumpRateHC
Can I Stick to 5.39?
must be answered by immi; don'tknow
FHEM auf Raspberry Pi B und 2B; THZ (THZ-303SOL), CUL_HM, TCM-EnOcean, SamsungTV, JSONMETER, SYSMON, OBIS, STATISTICS

immi

Zitat von: sunrise am 29 November 2022, 16:59:11
I'm really lost as to what causes these messages. Maybe it's because my firmware is not officially supported?
Hi Sunrise
no firmware is officially supported,  it is a hobby from my side.
Moreover we are using a debugging interface to implement an IOT feature. Considering no documentation from tecalor, I am always surprised that it works.
With my firmware, I get circa 1 errors every 10 weeks.

Zitat
Do you know if the PERL WARNINGs line 1460&1488 are related to the "too slow" problem?
yes
ignore the remaing errors.

Zitat von: sunrise am 26 November 2022, 17:25:30
@immi @willybauss
I have now a new cable connection (shielded) with only very few "too slow" messages. Maybe it's because of the slow RPi2 and/or the slow serial connection (9600 baud rate) of this old heating.

No, the problem is in your heapump.
Several users in forum confirmed that older firmware seams to get stuck every now and than.
My last hint: increase the intervalls as  much as you can live with, in order to decrease the workload of your heatpump microcontroller.

immi

Zitat von: zimb0 am 29 November 2022, 14:18:50
sFirmware version: 07.59 sFirmware-Id HW: 239 SW: 4.04 Date: JUN 18 2018
Which attr Firmware should I choose?`
Can I Stick to 5.39?
for sure you can; 5.39 is the latest.
Just chose the one, which works better with your firmware.
Only after someone finds something new in the 7.59, i can try to implement it

zimb0

Zitat von: immi am 09 Dezember 2022, 21:12:30
for sure you can; 5.39 is the latest.
Just chose the one, which works better with your firmware.
Only after someone finds something new in the 7.59, i can try to implement it

Ty, so I will stick at 5.39
my problem is that I cant see all compressor related values.
So sHumMaskingTime etc is there,
sHeatingRelPower
sComprRelPower
sComprRotUnlimit are missing.

my %getsonly539 = (  #info from belu and godmorgon
  "sFlowRate" => {cmd2=>"0A033B", type =>"1clean", unit =>" cl/min"},
  "sHumMaskingTime" => {cmd2=>"0A064F", type =>"1clean", unit =>" min"},
  "sHumThreshold" => {cmd2=>"0A0650", type =>"1clean", unit =>" %"},
  "sHeatingRelPower" => {cmd2=>"0A069A", type =>"1clean", unit =>" %"},
  "sComprRelPower" => {cmd2=>"0A069B", type =>"1clean", unit =>" %"},
  "sComprRotUnlimit" => {cmd2=>"0A069C", type =>"1clean", unit =>" Hz"},
  "sComprRotLimit" => {cmd2=>"0A069D", type =>"1clean", unit =>" Hz"},
  "sOutputReduction" => {cmd2=>"0A06A4", type =>"1clean", unit =>" %"},
  "sOutputIncrease" => {cmd2=>"0A06A5", type =>"1clean", unit =>" %"},
  "sHumProtection" => {cmd2=>"0A09D1", type =>"1clean", unit =>""},
  "sSetHumidityMin" => {cmd2=>"0A09D2", type =>"1clean", unit =>" %"},
  "sSetHumidityMax" => {cmd2=>"0A09D3", type =>"1clean", unit =>" %"},
  "sCoolHCTotal" => {cmd2=>"0A0648", cmd3 =>"0A0649", type =>"1clean", unit =>" kWh"},
  "sDewPointHC1" => {cmd2=>"0B0264", type =>"5temp",  unit =>" °C"}
);


Is my fw to old to display this values?
THZ504

immi

Zitat von: zimb0 am 10 Dezember 2022, 20:14:59
Is my fw to old to display this values?
no idea
maybe your tecalor do not present such values
maybe it just uses diffrent address for these registers

in the second case you have to reverse eng your heatpump and find the right cmd2=>"0A0XXX" by trial and error

sunrise

Zitat von: immi am 09 Dezember 2022, 17:51:06
[...]
No, the problem is in your heapump.
Several users in forum confirmed that older firmware seams to get stuck every now and than.
My last hint: increase the intervalls as  much as you can live with, in order to decrease the workload of your heatpump microcontroller.

Can there be intervals set too short? The shortest is 300 seconds = 5 minutes. I can hardly believe that my THZ firmware/board is too slow to cope with 5 minutes intervals, but maybe I'm wrong? Ah, maybe the "event-on-change-reading .*"? How should I change it? Anything else? I know that you do all this as a hobby and I am both impressed by the time you invest and the help you offer - thank you so much for it! :)

attr Mythz event-min-interval s.*:3600
attr Mythz event-on-change-reading .*
attr Mythz firmware 2.06
attr Mythz interval_sDHW 300
attr Mythz interval_sElectrDHWDay 3600
attr Mythz interval_sElectrDHWTotal 28800
attr Mythz interval_sGlobal 600
attr Mythz interval_sHC1 300
attr Mythz interval_sHeatDHWDay 3600
attr Mythz interval_sHeatDHWTotal 28800
attr Mythz interval_sHeatRecoveredDay 3600
attr Mythz interval_sHeatRecoveredTotal 28800
attr Mythz interval_sHistory 28800
attr Mythz interval_sLast10errors 28800
Viele Grüße/kind regards
sunrise
_________________
Tecalor THZ 303 (SOL, 2006/09-2008/08), FW 2.16 | FHEM THZ module testing with FW 2.06 (INTEGRAL, 2006/12-2008/08) & FW 2.14 (SOL, 2002/10-2004/08) on Raspberry Pi 2

immi

Zitat von: sunrise am 12 Dezember 2022, 11:35:54
Can there be intervals set too short? The shortest is 300 seconds = 5 minutes. I can hardly believe that my THZ firmware/board is too slow to cope with 5 minutes intervals, but maybe I'm wrong?
my cheap understanding:
your tecalor processes lots of task; older tecalor do not like some requests from serial interface, when they are busy with them self.
If you disturb your tecalor every 5 min, it is more likely that you surprise your tecalor.
I would set it to 10 min for older hetpumps.

Zitat
Ah, maybe the "event-on-change-reading .*"? How should I change it? Anything else? I know that you do all this as a hobby and I am both impressed by the time you invest and the help you offer - thank you so much for it! :)
no problem, it is fhem only; the tecalor does not see it

joker4791

Hi,

when trying to change setting 'pClockHour' the new value it is not accepted. The other values (pClockMinutes, pClockDay, pClockMonth, pClockYear) can be changed as expected. Am I the only one who is experiencing this problem?

Best regards,
j.

immi

Zitat von: joker4791 am 13 Dezember 2022, 12:32:20
Hi,
when trying to change setting 'pClockHour' the new value it is not accepted. The other values (pClockMinutes, pClockDay, pClockMonth, pClockYear) can be changed as expected. Am I the only one who is experiencing this problem?
Best regards,
j.
please set the verbose to 5 in the module and post the relevant log;
thanks