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

Offline immi

  • Developer
  • Hero Member
  • ****
  • Beiträge: 1046
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: 14
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: 1046
--> 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: 14
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: 1046
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: 14
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: 1046
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: 14
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: 1046
no... if it is not fixed since 10years, there is no easy fix

Offline hellijo

  • New Member
  • *
  • Beiträge: 6
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: 14
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: 1046
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