Autor Thema: THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.  (Gelesen 201345 mal)

Offline immi

  • Developer
  • Hero Member
  • ****
  • Beiträge: 1063
Antw:THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.
« Antwort #1020 am: 19 Oktober 2021, 20:42:36 »
concerning your direct connection to the usb of the heatpump.
You got hterm work, now you can test if your perl is working.
The script enclosed is selfexplaining
C:\Strawberry\fhem>perl testserialthz.pl
10
----
1002
----
0100b6fd01b71003


concerning your rs232 cable: pay attention that TX at rest should be below -4.5V
https://upload.wikimedia.org/wikipedia/commons/e/e1/RS232-UART_Oscilloscope_Screenshot.png
check again the cable: I remember that the bottom pin  of the rs232 of the heatpump is gnd
immi

Offline Matthias-56

  • New Member
  • *
  • Beiträge: 18
Antw:THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.
« Antwort #1021 am: 20 Oktober 2021, 08:17:07 »
Hi Immi,
great support!

I was also working ...

Yesterday I got new cable.
I investigated wiring inside THZ.

- RS232 Connector at THZ from top to bottom --> 1, 2, 3 (as You are writing)
- Baudrate 115200

--> RS232 connection stabil established.

So I can use FHEM for my THZ.

Thank You for the script. I will try to understand.
Did not use it till now because nearly same time RS232 worked.
My perl configuration seems ok.
Using Strawberry Perl Portable on Win10.

Direct connection FHEM THZ via USB does not work. THZ state = disconnected.
Same connection via e.g. Hterm ok.

According my experience the different USB - serial controller and/or win10 driver could be root cause.
Profilic --> state connected (external cable)
FTDI    --> state connected (external cable)
CP210x--> state disconnected (THZ onboard USB - serial controller)

Matthias

Offline immi

  • Developer
  • Hero Member
  • ****
  • Beiträge: 1063
Antw:THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.
« Antwort #1022 am: 20 Oktober 2021, 10:29:44 »
--> RS232 connection stabil established.
So I can use FHEM for my THZ.
excellent

Zitat
My perl configuration seems ok.
Using Strawberry Perl Portable on Win10.
The perl script will help you debugging without the complex construct of fhem.
It is very very easy to check the serial handshake, or other serial peculiarities linked to your special driver.
It would be great if you could share the results in the forum.

Motivation: Maybe some other users will benefit.
Making the rs232 cable and using linux is my preferred way, but it can be intimidating for many users.
Therefore I like to support also direct-usb connection and windows.... Are you familiar with the concept of gateway drug :)

Offline Matthias-56

  • New Member
  • *
  • Beiträge: 18
Antw:THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.
« Antwort #1023 am: 20 Oktober 2021, 11:44:15 »
It would be great if you could share the results in the forum.
... Give me short time.
Where to place such result?
I found a disadvantage using forum as there a lot of information but not organizeabel for fast finding.

Are you familiar with the concept of gateway drug

  Is this a drug which lead people try one week or more to place a serial connection? ;)


Matthias








Offline immi

  • Developer
  • Hero Member
  • ****
  • Beiträge: 1063
Antw:THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.
« Antwort #1024 am: 20 Oktober 2021, 14:20:18 »
hi Matthias
take your time and enjoy the nice weather today :)

Zitat
Where to place such result?
The forum is for problemsolving discussion and for preliminary results.

The final solution, even better an howto should go in the wiki
https://wiki.fhem.de/wiki/Tecalor_THZ_W%C3%A4rmepumpe
you can edit it yourself or send the  change to Micromat ; I have never done it


A very short hint can also go in the commandref; I should do it, because hardlinked in fhem-source-code.
immi



Offline Matthias-56

  • New Member
  • *
  • Beiträge: 18
Antw:THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.
« Antwort #1025 am: 20 Oktober 2021, 17:32:19 »
Hi Immi,

Test Com4 = USB - Serial cable, Profilic chip

C:\MyFHEM>perl\bin\perl testserialthz.pl
10
----
1002
----
0100b6fd01b71003

Test Com3 = THZ USB direct CP210x chip

C:\MyFHEM>perl\bin\perl testserialthz.pl
invalid COMMPROP block length= 66 at testserialthz.pl line 10.
Can't open COM3:

line 10:
$PortObj = new Win32::SerialPort ($PortName)  || die "Can't open $PortName: $^E\n";   

Bug in Win32::SerialPort or in CP210x driver?

Matthias


Offline immi

  • Developer
  • Hero Member
  • ****
  • Beiträge: 1063
Antw:THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.
« Antwort #1026 am: 20 Oktober 2021, 18:24:04 »
Bug in Win32::SerialPort or in CP210x driver?
now it is clear
"COMMPROP block length= 66"  looks like a pretty old problem
https://rt.cpan.org/Public/Bug/Display.html?id=33559
unfixed bug in perl for windows or an unproper api of the driver CP210x
for sure not a fhem issue.
immi



Offline Matthias-56

  • New Member
  • *
  • Beiträge: 18
Antw:THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.
« Antwort #1027 am: 20 Oktober 2021, 18:46:58 »
ok. In the linked article Wim de Vries changed a value in commport.pm to 66 in line639.
I did the same but no success.  :(
Is there a workaround?

Matthias

Offline immi

  • Developer
  • Hero Member
  • ****
  • Beiträge: 1063
Antw:THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.
« Antwort #1028 am: 20 Oktober 2021, 19:51:09 »
no... if it is not fixed since 10years, there is no easy fix

Offline hellijo

  • New Member
  • *
  • Beiträge: 10
Antw:THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.
« Antwort #1029 am: 20 Oktober 2021, 20:51:47 »
Hi immi,

ich have an additional question:
Homebridge is running.

This mapping works:
firmware   
      2.14   deleteattr
genericDeviceType 
      thermostat   deleteattr
homebridgeMapping
     CurrentHeatingCoolingState=state,values=opened:0;/.*/:1
     TargetHeatingCoolingState=state,values=opened:0;/.*/:1
     CurrentTemperature=p01RoomTempDay
     TargetTemperature=p01RoomTempDay::p01RoomTempDay minValue=10;maxValue=30,minStep=1
        deleteattr

But I would the Winter- oder Summermode for heating or off state of the thermostat.
What I hove done wrong?

homebridgeMapping
     CurrentHeatingCoolingState=seasonMode:sHC1,values=winter:1;/.*/:0
     TargetHeatingCoolingState=seasonMode:sHC1,values=winter:1;/.*/:0
     CurrentTemperature=p01RoomTempDay
     TargetTemperature=p01RoomTempDay::p01RoomTempDay minValue=10;maxValue=30,minStep=1

Is seasonMode:sHC1 the wrong one?
Or have I mapped the wrong signal?

BR Jörg


Offline Matthias-56

  • New Member
  • *
  • Beiträge: 18
Antw:THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.
« Antwort #1030 am: 21 Oktober 2021, 10:02:09 »
Hi Immi,

I remembered that I saw the error ... block length 66 ... already before.
If FHEM try to open com port the modul devio.pm is used.
This seems to replace the original io.pm.
It is signed by Rudolf Koenig.
Is'nt it the lucky situation that this problem could be solved by the FHEM developer?

Matthias

2021.10.21 09:54:28 3: Opening myTHZ_403 device COM3
2021.10.21 09:54:29 1: PERL WARNING: invalid COMMPROP block length= 66 at C:\MyFHEM/FHEM/DevIo.pm line 593.
2021.10.21 09:54:29 1: myTHZ_403: Can't open COM3: No such file or directory
Zugriff verweigert

2021.10.21 09:54:29 1: PERL WARNING: can't open device: \\.\COM3
 at C:\MyFHEM/FHEM/DevIo.pm line 593.
Zugriff verweigert

Offline immi

  • Developer
  • Hero Member
  • ****
  • Beiträge: 1063
Antw:THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.
« Antwort #1031 am: 21 Oktober 2021, 10:21:49 »
Hallo Jörg/hellijo
just plot  seasonMode and see if it is the reading of which you are interesten in.

as I already wrote before, I never used homebridge.
I expect that you cannot address seasonMode with the sintax you used.
I expect that you can solve your issue with userreadings --> see example heatingState in https://wiki.fhem.de/wiki/Homebridge_User_Configs

if you post here (heatpump code improvement), nobody can support you properly
the right place would be --> module owner  Andre (justme1968) in forum Frontends/Sprachsteuerung

immi

Offline Matthias-56

  • New Member
  • *
  • Beiträge: 18
Antw:THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.
« Antwort #1032 am: 22 Oktober 2021, 10:03:47 »
Hi Immi,
may be You had not seen my post from 2021-10-21 10 am?
Concerning to share my results here main points I missed.


1. Cable RS232 to connect THZ with PC

THZ MNL connector            PC Sub-D male
 (PIN 1 at the top)

TxD  1   -----------------------------------   2  (Rxd)
RxD   2   -----------------------------------   3  (TxD)
gnd   3   -----------------------------------   5  gnd

2. Win10 define com port
   define name THZ comx@115200 (or other value 9600 ... 115200; individuell)

3. USB direct connection - known problem
   problems with Win10 driver in common with THZ onboard USB - Serial chip CP210x


Matthias

Offline immi

  • Developer
  • Hero Member
  • ****
  • Beiträge: 1063
Antw:THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.
« Antwort #1033 am: 22 Oktober 2021, 11:56:51 »
I remembered that I saw the error ... block length 66 ... already before.
If FHEM try to open com port the modul devio.pm is used.
This seems to replace the original io.pm.
It is signed by Rudolf Koenig.
Is'nt it the lucky situation that this problem could be solved by the FHEM developer?
Hi Matthias
devio.pm in fhem calls Win32::SerialPort, like I do in the script.... just in a more fancy way.
If Win32::SerialPort does not work for you in the script, it will also not work in fhem
Win32::SerialPort does not belong to FHEM...
https://metacpan.org/pod/Win32::SerialPort
immi

Offline Matthias-56

  • New Member
  • *
  • Beiträge: 18
Antw:THZ Tecalor (LWZ Stiebel Eltron) module support and code improvement.
« Antwort #1034 am: 22 Oktober 2021, 12:37:47 »
what a pitty!

So You don't go boring see below.

2021.10.22 12:23:30 3: Opening myTHZ_403 device COM3
2021.10.22 12:23:30 3: Setting myTHZ_403 serial parameters to 115200,8,N,1
2021.10.22 12:23:30 3: myTHZ_403 device opened
2021.10.22 12:24:01 3: THZ_Get: Error msg2:  THZ_ReadAnswer: InterfaceNotRespondig. Maybe too slow THZ_Get_Com: error found at step0  -- 0B0005 ->

Background:
I'm using the FritzBox Remote USB now.
Communication Hterm and THZ is ok in this configuration (0x02 --> 0x10).
Port opening on THZ module also ok. USB - Serial adapter accepted by FHEM.

Why I got error msg2 ?
I tried already SimpleReadTimeout up to 1s but I don't know if it makes sense.

Matthias


 

decade-submarginal