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

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

Vorheriges Thema - Nächstes Thema

immi

Hi Noobie47
I understand you have installed fhem on linux on a raspi --> good starting point.
let us forget all other mythz  attributes; they can be confusing for now; delete them

focus on

define Mythz THZ /dev/ttyUSB0@9600

find out your serial port name and  speed, which can vary 9600, 14400, 19200, 28800, 31250, 38400, 57600

for the speed, you have to try....
for the serial name, use linux command line "dmesg"
for my device, dmesg

[   28.348000] hub 2-0:1.0: USB hub found
[   28.352000] hub 2-0:1.0: 2 ports detected
....
[   29.624000] ftdi_sio 2-2:1.0: FTDI USB Serial Device converter detected
[   29.632000] usb 2-2: Detected FT232RL
[   29.636000] usb 2-2: FTDI USB Serial Device converter now attached to ttyUSB0


and do not forget the firmware attr. for older tecalor
attr Mythz firmware 2.06

Noobie47


celle

Hello immi,

I tested the value for negative ones:


2021.11.17 19:28:27.252 5: THZ_Get: Try to get 'sHeizleistungRelativ'
2021.11.17 19:28:27.253 5: THZ_Get_Comunication: Check if port is open. State = '(opened)'
2021.11.17 19:28:27.253 5: Mythz sending 02
2021.11.17 19:28:27.253 5: DevIo_SimpleWrite Mythz: 02
2021.11.17 19:28:27.254 5: Mythz start Function THZ_ReadAnswer
2021.11.17 19:28:27.255 5: THZ_ReadAnswer: uc unpack: '10'
2021.11.17 19:28:27.255 5: Mythz sending 0100AB0A069A1003
2021.11.17 19:28:27.255 5: DevIo_SimpleWrite Mythz: 0100AB0A069A1003
2021.11.17 19:28:27.256 5: Mythz start Function THZ_ReadAnswer
2021.11.17 19:28:27.257 5: THZ_ReadAnswer: uc unpack: '10'
2021.11.17 19:28:27.257 5: Mythz start Function THZ_ReadAnswer
2021.11.17 19:28:27.260 5: THZ_ReadAnswer: uc unpack: '02'
2021.11.17 19:28:27.260 5: Mythz sending 10
2021.11.17 19:28:27.260 5: DevIo_SimpleWrite Mythz: 10
2021.11.17 19:28:27.262 5: Mythz start Function THZ_ReadAnswer
2021.11.17 19:28:27.262 5: THZ_ReadAnswer: uc unpack: '0100940A069AFFEA1003'
2021.11.17 19:28:27.262 5: Mythz sending 10
2021.11.17 19:28:27.262 5: DevIo_SimpleWrite Mythz: 10
2021.11.17 19:28:27.264 5: Parse message: 940A069AFFEA
2021.11.17 19:28:27.264 5: Message length: 12


The result should be

2021-11-17_19:28:27 Mythz sHeizleistungRelativ: -22 %



2021.11.17 18:54:41.595 5: THZ_Get: Try to get 'sHeizleistungRelativ'
2021.11.17 18:54:41.595 5: THZ_Get_Comunication: Check if port is open. State = '(opened)'
2021.11.17 18:54:41.596 5: Mythz sending 02
2021.11.17 18:54:41.596 5: DevIo_SimpleWrite Mythz: 02
2021.11.17 18:54:41.597 5: Mythz start Function THZ_ReadAnswer
2021.11.17 18:54:41.597 5: THZ_ReadAnswer: uc unpack: '10'
2021.11.17 18:54:41.597 5: Mythz sending 0100AB0A069A1003
2021.11.17 18:54:41.597 5: DevIo_SimpleWrite Mythz: 0100AB0A069A1003
2021.11.17 18:54:41.599 5: Mythz start Function THZ_ReadAnswer
2021.11.17 18:54:41.599 5: THZ_ReadAnswer: uc unpack: '10'
2021.11.17 18:54:41.599 5: Mythz start Function THZ_ReadAnswer
2021.11.17 18:54:41.610 5: THZ_ReadAnswer: uc unpack: '02'
2021.11.17 18:54:41.611 5: Mythz sending 10
2021.11.17 18:54:41.611 5: DevIo_SimpleWrite Mythz: 10
2021.11.17 18:54:41.612 5: Mythz start Function THZ_ReadAnswer
2021.11.17 18:54:41.613 5: THZ_ReadAnswer: uc unpack: '01009E0A069AFFF41003'
2021.11.17 18:54:41.613 5: Mythz sending 10
2021.11.17 18:54:41.613 5: DevIo_SimpleWrite Mythz: 10
2021.11.17 18:54:41.614 5: Parse message: 9E0A069AFFF4
2021.11.17 18:54:41.615 5: Message length: 12


The result should be

2021-11-17_18:54:41 Mythz sHeizleistungRelativ: -12 %


For positive values it is working.

Also I tried decoding of 0A069B, which works now. It shows the power in percent the compressor should work (is 0 if not on). it is the same as 0A069A if the compressor is running and in heating mode. In dhw mode it shows the configured dhw mode power .

So i recommend the following:

fix 1clean for negative values and then:


+  "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"},


celle


immi

Hi celle
v0.198 implemented, uploaded, you can make an update tomorrow
Thanks for your contribution.
immi

Noobie47

#1054
Hi,
i deleted everything and made a brand new fhem.config according to Otto (I used his script):
wget https://svn.fhem.de/fhem/trunk/fhem/fhem.cfg
sudo systemctl stop fhem
# Kopie anlegen
sudo cp -R /opt/fhem/ ~/Sicherung/
# Ab hier wird zurück gesetzt
sudo cp fhem.cfg /opt/fhem/
sudo chown fhem:dialout /opt/fhem/fhem.cfg
sudo rm -R /opt/fhem/log/*
sudo rm -R /opt/fhem/backup/*
sudo rm -R /opt/fhem/restoreDir/*
sudo rm /opt/fhem/FHEM/controls_fhem.txt
sudo rm /opt/fhem/FHEM/99_myUtils.pm
# FHEM neu starten
sudo systemctl start fhem




I also used the dmesg command in linux to get the USB device name:

[ 4181.414687] usb 1-1.2: Product: USB2.0-Ser!
[ 4181.520431] usbcore: registered new interface driver usbserial_generic
[ 4181.520507] usbserial: USB Serial support registered for generic
[ 4181.524227] usbcore: registered new interface driver ch341
[ 4181.524307] usbserial: USB Serial support registered for ch341-uart
[ 4181.524421] ch341 1-1.2:1.0: ch341-uart converter detected
[ 4181.526644] ch341-uart ttyUSB0: break control not supported, using simulated break
[ 4181.527058] usb 1-1.2: ch341-uart converter now attached to ttyUSB0


The fhem.config looks like this now:

attr global userattr cmdIcon devStateIcon:textField-long devStateStyle icon sortby webCmd webCmdLabel:textField-long widgetOverride
attr global autoload_undefined_devices 1
attr global logfile ./log/fhem-%Y-%m.log
attr global modpath .
attr global statefile ./log/fhem.save
attr global verbose 3

define WEB FHEMWEB 8083 global
setuuid WEB 619cbf99-f33f-2ef9-de56-90925d7d32069bb2

# Fake FileLog entry, to access the fhem log from FHEMWEB
define Logfile FileLog ./log/fhem-%Y-%m.log Logfile
setuuid Logfile 619cbf99-f33f-2ef9-dcc6-e3ffecfa99833bcc

define autocreate autocreate
setuuid autocreate 619cbf99-f33f-2ef9-31c4-424c103e969a234e
attr autocreate filelog ./log/%NAME-%Y.log

define eventTypes eventTypes ./log/eventTypes.txt
setuuid eventTypes 619cbf99-f33f-2ef9-11f9-0e2d5aad2406d445

# Disable this to avoid looking for new USB devices on startup
define initialUsbCheck notify global:INITIALIZED usb create
setuuid initialUsbCheck 619cbf99-f33f-2ef9-30b0-78cf0993d6533f54
define Mythz THZ /dev/ttyUSB0@14400
setuuid Mythz 619cbffa-f33f-2ef9-c3bb-3839b2c0bed0468a
attr Mythz devStateIcon opened:10px-kreis-gruen disconnected:10px-kreis-rot
attr Mythz firmware 2.06


immi,
your advice was very helpful. Now i need to bring back those codeparts i deleted to have plottings right?

Summarize for others:
Setup: A very old Stiebel Eltron 303i, maybe the very first edition, no USB connectivity, Cable homemade according to Robert Penz (use google), USB to Serial cable from AmaXXX, used under linux dmesg to get the port name; used immi´s code (see above) and tried all baud rates; 28800 was the right one! I have the feeling that it works now:
UPDATE : it was just a feeling  :-\: see last screenshot, the connection was not stable established, after approx 3 Minutes error messages was shown.



immi

Hi Noobie,
"mythz device opened" does not tell you that it is the right freq, it just tells you it can open the serial port.
how did you understand that 28000 is the right freq for your tecalor?
have you read one register?

FYI1 the module starts reading the registers  some minutes after fhem starts
FYI2 I would disable the autocreate and the initialUsbCheck

Noobie47

#1056
Hi,
I was too optimitistic for a few minutes, because there was no error. 28800 did also not work. Registers were not read. All other frequencies did not work  as well. Measures: 1. I wiill double check the Cable, especially the part i built on my own.  2. I will delete the autocreate and the Initial usb check.
Under Windows the USB to serial cable Wants to automatically install some driverrs. Is this also for the raspberry needed?
Best, noobie

immi

Zitat von: Noobie47 am 24 November 2021, 21:13:40
I was too optimitistic for a few minutes, because there was no error. 28800 did also not work. Registers were not read. All other frequencies did not work  as well. Measures: 1. I wiill double check the Cable, especially the part i built on my own.  2. I will delete the autocreate and the Initial usb check.
Under Windows the USB to serial cable Wants to automatically install some driverrs. Is this also for the raspberry needed?
check the cable and stay away from windows.... your dmesg log shows your serial drivers on the raspi are ok

Noobie47

#1058
Ok, good to know that the raspi recognizes the cable automatically. After checking the cable today in respect of soldering failures, i will come back to the issue

celle


Noobie47

#1060
I resoldered the cables to improve the connectivity. But still error Message from Fhem. Maybe someone can have a Look at he cable picture to check if i did something wrong during soldering it (mixed up the cablecolor e.g.). I think i did it according to the instructions on Robert's Page.

immi

Zitat von: Noobie47 am 25 November 2021, 21:12:39
I resoldered the cables to improve the connectivity. But still error Message from Fhem. Maybe some cam habe a Look athe cable picture to check if i did something wrong during soldering it (mixed up the cablecolor e.g.). I think i did it according to the instructions on Robert's Page.
I also cannot solder well, pay attention not to have shorts between --> check with a multimeter

at first glance, you switched black and red  on the serial-d9 connector side


THZ(GND at the bottom) **************       Sub-D9

yellow Tx  1   --------------------------------   2  Rx     yellow
red_   Rx  2   --------------------------------   3  Tx     red
black gnd  3  -------------------------------    5  gnd   black

Noobie47

#1062
Now a connection to the heating is established. I get now values and infos, see screenshot as an example. In general all values from p1 to p 80 are now shown, also the programming of downtime, fan speed et cetera.
But also a error message:
z_Last_fhem_err   THZ_Get: Error msg2: THZ_Get_Com: error found at step1 15 NAK!! -- F2 -> 15   2021-11-29 14:13:54
Can i ignore this message? btw i used rate 14400
thanks for your help so far, immi.

immi

hi Noobie47
Happy you made it work;
Yes you can ignore the error, if you do not see it too often.

p.s. do not forget to help others with similar heatpumps in the forum.

Noobie47

#1064
Yes, anyone with need for help, also in german language, is welcome, but i am afraid i am only a very shallow user who can only convert hints from others. But maybe this enough to help others.  8)
Now i get those values, please see attachment. Why does the plotting stop at 04:30 hrs?