THZ / LWZ Tecalor Stiebel Eltron Heizung

Begonnen von Heiner, 02 Juni 2013, 11:39:13

Vorheriges Thema - Nächstes Thema

immi

#1275
Zitat von: andre.k am 14 Januar 2015, 17:38:28
Hi immi,

your debug routine seems to be too fast for my communication. I inserted an additional read in line #1230 like in the THZ_Get_Comunication
   if ($msg eq "10") {
         ($err, $msg) = THZ_ReadAnswer($hash); # read 02
   }


In the next time I can provide you parsing rules for these registers I have found, but it takes a while. I'm not sure if this makes sense for every parameter register. I don't think that for example "dry heat" is not an real use case for FHEM. It would be also possible to write back the register of type parameter to the THZ. But as you already said, this is not so important at the moment.

Andre

Hi Andre
you seam to read my mind  :)
In v0126 which I uploaded 2 days ago, there was the same solution.
Happy that you got there alone!! Happy to merge your new code.

FYI: You can get most of your reverse eng. with following configuration.
heatpump -- ser2net -- proxy.pl --- net2comport --- LWZ303-LWA403.exe
proxy.pl can be used to store/redirect the comminication of LWZ303-LWA403.exe
By uncommenting the "#if (length(...." you can use proxy.pl  to inject commands into LWZ303-LWA403.exe, in order to test what the single byte do
Pay attention to encoding rules when injecting:  crc and all rules like 10-->1010 and 2B-->2B18
In decoding: 2B18 --> 2B and 1010 -->10


[~] # cat proxy.pl
#!/usr/bin/perl
#

use warnings;
use strict;

use IO::Socket::INET;
use IO::Select;

my @allowed_ips = ('all', '10.10.10.5');
my $ioset = IO::Select->new;
my %socket_map;

my $debug = 1;

sub new_conn {
    my ($host, $port) = @_;
    return IO::Socket::INET->new(
        PeerAddr => $host,
        PeerPort => $port
    ) || die "Unable to connect to $host:$port: $!";
}

sub new_server {
    my ($host, $port) = @_;
    my $server = IO::Socket::INET->new(
        LocalAddr => $host,
        LocalPort => $port,
        ReuseAddr => 1,
        Listen => 100
    ) || die "Unable to listen on $host:$port: $!";
}

sub new_connection {
    my $server = shift;
    my $remote_host = shift;
    my $remote_port = shift;

    my $client = $server->accept;
    my $client_ip = client_ip($client);

    unless (client_allowed($client)) {
        print "Connection from $client_ip denied.\n" if $debug;
        $client->close;
        return;
    }
    print "Connection from $client_ip accepted.\n" if $debug;

    my $remote = new_conn($remote_host, $remote_port);
    $ioset->add($client);
    $ioset->add($remote);

    $socket_map{$client} = $remote;
    $socket_map{$remote} = $client;
}

sub close_connection {
    my $client = shift;
    my $client_ip = client_ip($client);
    my $remote = $socket_map{$client};
   
    $ioset->remove($client);
    $ioset->remove($remote);

    delete $socket_map{$client};
    delete $socket_map{$remote};

    $client->close;
    $remote->close;

    print "Connection from $client_ip closed.\n" if $debug;
}

sub client_ip {
    my $client = shift;
    return inet_ntoa($client->sockaddr);
}

sub client_allowed {
    my $client = shift;
    my $client_ip = client_ip($client);
    return grep { $_ eq $client_ip || $_ eq 'all' } @allowed_ips;
}

die "Usage: $0 <local port> <remote_host:remote_port>" unless @ARGV == 2;

my $local_port = shift;
my ($remote_host, $remote_port) = split ':', shift();


print "Starting a server on 0.0.0.0:$local_port\n";
my $server = new_server('0.0.0.0', $local_port);
$ioset->add($server);

while (1) {
    for my $socket ($ioset->can_read) {
        if ($socket == $server) {
            new_connection($server, $remote_host, $remote_port);
        }
        else {
            next unless exists $socket_map{$socket};
            my $remote = $socket_map{$socket};
            my $buffer;
            my $read = $socket->sysread($buffer, 4096);
            my $data =  uc(unpack('H*', $buffer));

##following line for injecting
#if (length($data) > 15 ) { $data="0100C5090381038127AF0DD000000000001003" } #

            open (MYFILE, '>>data.txt');
    print MYFILE ($data . "\n");
    close (MYFILE);
            $buffer=  pack('H*', $data);
            if ($read) {
                $remote->syswrite($buffer);
            }
            else {
                close_connection($socket);
            }
        }
    }
}




immi

andre.k

Hi immi,

I found a difference in the parsing rule for FCtime. Here is an example of the response from THZ:
FC0000142D300F00010C
All values are shifted to right. In my FHEM the following parsing works perfect.

"FCtime" => [["Weekday: ", 7, 1,  "weekday", 1], [" Hour: ", 8, 2, "hex", 1],
      [" Min: ", 10, 2,  "hex", 1], [" Sec: ", 12, 2, "hex", 1],
      [" Date: ", 14, 2, "year", 1], ["/", 18, 2, "hex", 1],
      ["/", 20, 2, "hex", 1]


Andre

belu

Hallo,

wenn jemand zufällig die Softewar hat für die LWZ / THZ 304 / 404 würde mir das sehr helfen, bitte um Kontaktaufnahme.


Vielen Herzlichen Dank

LG

Belu

immi

Hi Andre
v0.127 added with your hint.
tomorrow you can update

Hi Belu
sorry I do not have the service software for your firmware.
immi

willybauss

Zitat von: belu am 15 Januar 2015, 22:56:16
wenn jemand zufällig die Softewar hat für die LWZ / THZ 304 / 404 würde mir das sehr helfen ...
Angeblich soll das die Software sein. ComSoft im Menü Downloads. Kannst es ja mal versuchen. Ich bin bislang noch nicht dazu gekommen.
FHEM auf Raspberry Pi B und 2B; THZ (THZ-303SOL), CUL_HM, TCM-EnOcean, SamsungTV, JSONMETER, SYSMON, OBIS, STATISTICS

firebal301

Zitat von: houseowner123 am 13 Januar 2015, 19:17:27
Danke an Willy und belu für die Erklärungen mit dem Rückschlagventil. Macht totalen Sinn. Ein Grund, warum das Rückschlagventil nicht richtig schliesst, könnten die Ablagerungen durch hartes Berliner Wasser sein (14-17°dH) oder, daß die Rückschlagklappe ein wenig ausgenuddelt ist. Der Grund dafür könnte der evuRelease durch den Energieversorger sein. Wird die WW Aufbereitung durch das evu unterbrochen, kühlt sich das WW rapide ab. Der Grund dafür war mir nie klar. Wird kaltes Wasser einfach nachgefüllt? Oder könnte das auch mit der Rückschlagventil zu tun haben? (siehe Bild). Hab ein wenig Angst das Rückschlagventil (es gibt ja 2) rauszunehmen. Kommt einem da nicht das ganze Wasser entgegen und muss nicht nach Öffnung neu entlüftet werden etc? Ich werde das mal im Haustechnik-Dialog Forum posten. Aber wenn man so dort liest, haben ja andere ganz andere Probleme mit dem Rückschlgventil und müssen teilweise Brachialgewalt bemühen um diese manuell zu verschliessen.

Ich hatte letzte Woche einen Techniker bei uns, da die Anlage (LWZ403) in Störung gegangen ist. Der Monteur erkläre mir unter anderem, dass die Rückschlagventile eine kleine Bohrung haben müssen, damit mögliche Luftblasen abgeführt werden und die darunterliegende Pumpe nicht trocken läuft. Durch diese kleine Bohrung findet leider auch immer ein kleiner Wärmeaustausch statt. Jedoch ist diese Wärme ja nicht verloren sondern geht ja dann ins andere System über (Heizung/Wasser). Dies nur mal als kleine Ergänzung...

Gruß
Kai

PhyTHZ

Hi,

Some weeks ago I installed fhem/THZ on my Zyxel NAS NSA325 (no jokes about the name pls :-). Basically everything works, but the connection to my THZ403sol (4.39) seems to be unstable: There are several "Mythz THZ_ReadAnswer got no answer from DevIo_SimpleRead. Maybe too slow?" messages in the log.
I already tried to use different USB/RS232 adapters (PL2303 and FT232) and a shorter cable. The RS232 signal looks fine on the oscilloscope. However, the timeout problems remain.

Frankly speaking I have no clue how to proceed. I attached a typical fhem log file. It would be great if someone could point me the right direction.

Thanks in advance,
Phy

Zu den Meibes Rückschlagkappen: Ich kann Kais Aussage bzw. die des Technikers bestätigen. Ich habe im letzten Jahr eine Klappe getauscht; die haben eine Luftschleuse. Bei WW-Bereitung erwärmt sich der Heizungsvorlauf daher leicht.

willybauss

@Phy
Herzlich willkommen im Club  :)

Zu den Verbindungsproblemen wird sich sicher immi bald äußern. Es gab auch auf den letzten 2 - 3 Seiten dieses Threads von ihm dazu Infos, aber ich will ihm da nicht vorgreifen.

Mich würde interessieren, wie Du die Rückschlagklappe ausgebaut hast. Geht das, ohne die Anlage zu entleeren? Und muss sie hinterher entlüftet werden?
Bei mir hat vor ein paar Wochen mal eine Klappe geklemmt. Wenn es ohne großen Aufwand geht würde ich die mal ausbauen und überprüfen.
FHEM auf Raspberry Pi B und 2B; THZ (THZ-303SOL), CUL_HM, TCM-EnOcean, SamsungTV, JSONMETER, SYSMON, OBIS, STATISTICS

willybauss

Zitat von: PhyTHZ am 16 Januar 2015, 23:03:56
Some weeks ago I installed fhem/THZ ...
Hast Du schon mal ein Update gemacht? Welche Mythz-Version verwendest Du? Das steht in der Liste in den Internals.
FHEM auf Raspberry Pi B und 2B; THZ (THZ-303SOL), CUL_HM, TCM-EnOcean, SamsungTV, JSONMETER, SYSMON, OBIS, STATISTICS

immi

Hi PhyTHZ
welcome on board; As willy asked, please keep THZ-fhem always to the last version (now v0.127)

Zitat von: PhyTHZ am 16 Januar 2015, 23:03:56
There are several "Mythz THZ_ReadAnswer got no answer from DevIo_SimpleRead. Maybe too slow?" messages in the log.
I already tried to use different USB/RS232 adapters (PL2303 and FT232) and a shorter cable. The RS232 signal looks fine on the oscilloscope. However, the timeout problems remain.
Excellent problem description.
To my opinion, you do not have a timeout problem.
Your logfile is full with NAK. If you have an oscilloscope at home, for sure you know what is a NAK in a serial protocoll.
Forget it :)
My feeling is that, in your case, the heatpump  says "I am busy now, try later"
My heatpump (same version as yours) hasn´t done it in the last 10 months.

During the initialization phase, I send lots of commands in very short time.
Do you see the NAK only in the initialization phase or also later (timerange init+10min .. init+10h)?
Do you have a second display installed?
immi

PhyTHZ

Zitat von: willybauss am 16 Januar 2015, 23:16:37
Bei mir hat vor ein paar Wochen mal eine Klappe geklemmt. Wenn es ohne großen Aufwand geht würde ich die mal ausbauen und überprüfen.
Zum Tausch muss der Heizkreis abgelassen werden. Das ging bei mir einfach, weil (leider) eine hydraulische Weiche mit Absperrhähnen verbaut ist. Aufgefüllt habe ich über einen Fillsoft Ionenaustauscher. Entlüften musste ich nur den Kreis mit der hydraulischen Weiche (Entlüften ist in der Anleitung beschrieben). Zum Öffnen der Verschraubung und zum Gegenhalten benötigt man zwei Rohrzangen/Schlüssel. Ich hatte prophylaktisch eine neue Klappe besorgt, von der ich dann aber nur die Dichtung benötigt habe. Ich könnte mir vorstellen, dass die Dichtung nicht so leicht zu bekommen ist: Fiberdichtung, Innen ca. 26 mm, Außen ca. 44.8, Dicke 1,5mm. Wenn die Klappe tatsächlich wegen Verschmutzungen hängt, muss aber wohl ohnehin die gesamte Anlage gespült werden – sonst hast Du das Problem gleich wieder. Wenn die Klappe jetzt wieder geht, wäre mir der Aufwand zu hoch – dank fhem erkennst Du ja schnell wenn die Klappe wieder hängt.


Zu Fhem:
I have currently installed thzversion = "0.126" Playing around with ,,select(undef, undef, undef, 0.1)" had no influence. However, I am no yet so deep into fhem/THZ.pm that I really understand what I am changing. NAK Messages are less frequently after init-phase; approx 1 time per hour (6 min interval for sGlobal). Sporadically I see these three problems in the log:

InterfaceNotRespondig:

2015.01.17 11:11:09 5: THZ_Get: Try to get 'sGlobal'
2015.01.17 11:11:09 5: THZ_Get_Comunication: Check if port is open. State = '(opened)'
2015.01.17 11:11:09 5: Mythz sending 02
2015.01.17 11:11:09 5: SW: 02
2015.01.17 11:11:09 5: Mythz start Funktion THZ_ReadAnswer
2015.01.17 11:11:09 5: THZ_ReadAnswer: uc unpack: '10'
2015.01.17 11:11:09 5: Mythz sending 0100FCFB1003
2015.01.17 11:11:09 5: SW: 0100FCFB1003
2015.01.17 11:11:09 5: Mythz start Funktion THZ_ReadAnswer
2015.01.17 11:11:09 3: Mythz THZ_ReadAnswer got no answer from DevIo_SimpleRead. Maybe too slow?
2015.01.17 11:11:09 5: THZ_Get: Error msg2: 'InterfaceNotRespondig'


NAK:

2015.01.17 12:46:09 5: THZ_Get: Try to get 'sGlobal'
2015.01.17 12:46:09 5: THZ_Get_Comunication: Check if port is open. State = '(opened)'
2015.01.17 12:46:09 5: Mythz sending 02
2015.01.17 12:46:09 5: SW: 02
2015.01.17 12:46:09 5: Mythz start Funktion THZ_ReadAnswer
2015.01.17 12:46:09 5: THZ_ReadAnswer: uc unpack: '10'
2015.01.17 12:46:09 5: Mythz sending 0100FCFB1003
2015.01.17 12:46:09 5: SW: 0100FCFB1003
2015.01.17 12:46:09 5: Mythz start Funktion THZ_ReadAnswer
2015.01.17 12:46:09 5: THZ_ReadAnswer: uc unpack: '15'
2015.01.17 12:46:09 5: THZ_Get: Error msg2: 'NAK received from device'


and this one after init
2015.01.16 22:41:26 5: THZ_Get: Try to get 'sFirmware-Id'
2015.01.16 22:41:26 5: THZ_Get_Comunication: Check if port is open. State = '(opened)'
2015.01.16 22:41:26 5: Mythz sending 02
2015.01.16 22:41:26 5: SW: 02
2015.01.16 22:41:26 5: Mythz start Funktion THZ_ReadAnswer
2015.01.16 22:41:26 5: THZ_ReadAnswer: uc unpack: '10'
2015.01.16 22:41:26 5: Mythz sending 0100FFFE1003
2015.01.16 22:41:26 5: SW: 0100FFFE1003
2015.01.16 22:41:26 5: Mythz start Funktion THZ_ReadAnswer
2015.01.16 22:41:26 5: THZ_ReadAnswer: uc unpack: '1002'
2015.01.16 22:41:26 5: Mythz sending 10
2015.01.16 22:41:26 5: SW: 10
2015.01.16 22:41:26 5: Mythz start Funktion THZ_ReadAnswer
2015.01.16 22:41:26 5: THZ_ReadAnswer: uc unpack: '01005FFE03B18391000100024D8A0006674A02051003'
2015.01.16 22:41:26 5: Mythz sending 10
2015.01.16 22:41:26 5: SW: 10
2015.01.16 22:41:26 5: Parse message: 5FFE03B18391000100024D8A0006674A0205
2015.01.16 22:41:26 5: Message length: 36
2015.01.16 22:41:26 3: THZ_Parsing: offset(36) + length(22) is longer then message : '5FFE03B18391000100024D8A0006674A0205'


Unfortunately there is not so much experience with my NAS and fhem. So I wonder whether it makes sense to install fhem on my windows laptop and give it a try.

Best wishes and thank you all for your help and support,

Phy

immi

#1286
Hi PhyTHZ
The third problem is because  register FE in your heatpump is 22 characters shorter that it should.
No comunication problem, just registers with different encoding.
my $buf = DevIo_SimpleReadWithTimeout($hash, 0.7);
Indeed your firmware-vs 4.39 is not like mine 4.39.
How old is your box?

InterfaceNotRespondig and NAK are, to my opinion, related.
For InterfaceNotRespondig, your heatpump waits more than 0.7s before responding.
For NAK, your heatpump says I am busy.
Therefore I asked you, if you have a second display for your heatpump in the living room.

Is there someone else with NAK issues?
immi

willybauss

Zitat von: PhyTHZ am 17 Januar 2015, 15:12:07
Wenn die Klappe jetzt wieder geht, wäre mir der Aufwand zu hoch – dank fhem erkennst Du ja schnell wenn die Klappe wieder hängt.
Danke, genau so werde ich es machen.

@immi:
no NAK at all, ver 4.19 incl. 2nd display
FHEM auf Raspberry Pi B und 2B; THZ (THZ-303SOL), CUL_HM, TCM-EnOcean, SamsungTV, JSONMETER, SYSMON, OBIS, STATISTICS

PhyTHZ

Hi immi,

My THZ403sol was manufactured / installed in 2010. Tecalor Service did the start-up. There was no software update since then (double-checked – it is really 4.39). Also, I read that you connect with 115200 baud, while I only get a connection with 57600 baud. It seems that my hardware is older.

ZitatTherefore I asked you, if you have a second display for your heatpump in the living room.

Sorry, overlooked your question. I don't have a second display.

Phy

godmorgon

Zitat von: immi am 17 Januar 2015, 16:38:40
Indeed your firmware-vs 4.39 is not like mine 4.39.
This is why it is important to know the actual software ID. As far as I know the displayed software version (at least in the newer models) does not change when the motherboard software is updated but the software ID does.

I also noticed that there are some registers which change their contents depending on previous operations. The register for the software ID (0a 024b) in the THZ404 belongs to that kind. The first read after a previous command returns some data. But subsequent reads always return the software ID.

I also noticed that the d2 reads return data blocks varying every now and then. So I assumed that d2 requires an additional index. It is a one byte index. It seems that the d2 reads provide the entries stored by an internal data logger every 42 minutes (the first bytes contain a time stamp).

Last but not least - I never get NACKs of any type (0x15, 0x0101, 0x0102, 0x0103 or 0x04) for any known messages.