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

>>I'm using the FritzBox Remote USB now.
bad idea; please consider better architectures.
you have so many very robust possibilities for remote serial ports

you install fhem directly in the fritzbox (1)
or use ser2net on the  fritzbox   (2)
or use  fhem on a raspberry  (3)
or use  ser2net on a raspberry (4)
or use  fhem on a nas (5)

are you familiar with ser2net or with fhem2fhem?
immi

p.s. I use solution 2 since 8 years, sometimes with vpn and 700km in between :)

Matthias-56

you install fhem directly in the fritzbox (1)    --> don't like to modify the FritzBox
or use ser2net on the  fritzbox   (2)              --> found no description of this config and the need of a RS232 HW still remain
or use  fhem on a raspberry  (3)                  --> did You try to buy a raspi today?
or use  ser2net on a raspberry (4)                -->
or use  fhem on a nas (5)                            --> not availabel and not planned

In my understanding ser2net needs in any case an additional host for com port. I'm wrong?
Fritz USB remote do not need an additional host.

I use vnc to connect to the FHEM host = netbook.
Because power consumption of this netbook I would like to remove it.
One year ago I bought a rasberry 4 kit as a gift for a person.
Today same part nearly double price and not deliverabel.

Matthias

immi

Zitat von: Matthias-56 am 22 Oktober 2021, 14:18:43
In my understanding ser2net needs in any case an additional host for com port. I'm wrong?
Fritz USB remote do not need an additional host.
you can use the fritzbox with ser2net; https://github.com/Freetz-NG/freetz-ng and compile the additional ser2net
you need the additional host in the same way as for FritzUSB
the difference relies in a easier, leaner transport protocoll with works without windows drivers out of the box.
It is a very robust solution, which could be intimidating..... you need a new firmware for the fritzbox ... but it is much easier than debugging an api like  FritzUSB in windows.


just my two cents
immi

TheTrumpeter

Hi immi,

It seems that you changed some parameter names in one of the last releases:
p99CoolingHC1HysterFlowTemp (former p99CoolingHC1HystersisFlowTemp)
p99CoolingHC1HysterRoomTemp (forme p99CoolingHC1HystersisRoomTemp)

Luckily I noticed that change as I started writing a documentation which parameters have to be changed if the LWZ shall be operated without FHEM.
As I use these parameters in a module which optimizes cooling-performance the module will not work without changing the parameter-names.

Are there further changes like this?
FHEM auf RPi3, THZ (LWZ404SOL), RPII2C & I2C_MCP342x (ADCPiZero), PowerMap, CustomReadings, RPI_GPIO, Twilight, nanoCUL (WMBus für Diehl Wasserzähler & Regenerationszähler für BWT AqaSmart), ESPEasy, TPLinkHS110

immi

Zitat von: TheTrumpeter am 12 November 2021, 10:25:07
It seems that you changed some parameter names in one of the last releases:
p99CoolingHC1HysterFlowTemp (former p99CoolingHC1HystersisFlowTemp)
p99CoolingHC1HysterRoomTemp (forme p99CoolingHC1HystersisRoomTemp)
Luckily I noticed that change as I started writing a documentation which parameters have to be changed if the LWZ shall be operated without FHEM.
Hi TheTrumpeter,
the change you are referring to, is probably 7-10 month old

Zitat
Are there further changes like this?
very unlikely but you can check yourself the history in github
https://github.com/mhop/fhem-mirror/commits/master/fhem/FHEM/00_THZ.pm
immi

celle

Hello,

I have a THZ 5.5 Flex with inverter technology. With a simple CAN Bus can bus analyzer I get some extra parameters, which show the status of the inverter. Because there is no integral value like on the on of values this is needed for monitoring of the pump.

Here is my patch. Its working for about a year. Can you implement this in upstream?

--- 00_THZ.pm   2019-10-28 20:50:15.000000000 +0100
+++ 00_THZ.pm   2021-11-12 18:13:18.680032336 +0100
@@ -359,6 +359,8 @@
               ],
   "4temp"     => [["", 8, 4, "hex2int",2560]
              ],
+  "1int"     => [["", 8, 4, "hex2int",1]
+             ],
   "5temp"     => [["", 8, 4, "hex2int",10]
              ],
   "6gradient" => [["", 8, 4, "hex", 100]
@@ -779,6 +781,9 @@
   "sFlowRate"          => {cmd2=>"0A033B", type =>"1clean", unit =>" cl/min"},
   "sHumMaskingTime"    => {cmd2=>"0A064F", type =>"1clean", unit =>" min"},
   "sHumThreshold"      => {cmd2=>"0A0650", type =>"1clean", unit =>" %"},
+  "sHeizleistungRelativ"       => {cmd2=>"0A069A", type =>"1int", unit =>" %"},
+  "sVerdichterNSollUnbegrenzt" => {cmd2=>"0A069C", type =>"1clean", unit =>" Hz"},
+  "sVerdichterNSollBegrenzt"   => {cmd2=>"0A069D", type =>"1clean", unit =>" Hz"},
   "sOutputReduction"   => {cmd2=>"0A06A4", type =>"1clean", unit =>" %"},
   "sOutputIncrease"    => {cmd2=>"0A06A5", type =>"1clean", unit =>" %"},
   "sHumProtection"     => {cmd2=>"0A09D1", type =>"1clean", unit =>""},

immi

Hi Celle
strange with the "lint" and 0A069A
normally "%" were implemented with 0clean or 1clean.
Maybe you can post 3 raw messages and your decoding? they are logged with verbose5
Would you mind suggesting a short engl. name for the added readings? if possible the same one of the tecalor manual.
thanks immi

Hi belu and godmorgon,
do you see any sideeffects with celle's patch?
immi

celle

Here is the debug


2021.11.14 22:02:32.826 5: THZ_Get: Try to get 'sHeizleistungRelativ'
2021.11.14 22:02:32.826 5: THZ_Get_Comunication: Check if port is open. State = '(opened)'
2021.11.14 22:02:32.827 5: Mythz sending 02
2021.11.14 22:02:32.827 5: DevIo_SimpleWrite Mythz: 02
2021.11.14 22:02:32.828 5: Mythz start Function THZ_ReadAnswer
2021.11.14 22:02:32.828 5: THZ_ReadAnswer: uc unpack: '10'
2021.11.14 22:02:32.828 5: Mythz sending 0100AB0A069A1003
2021.11.14 22:02:32.828 5: DevIo_SimpleWrite Mythz: 0100AB0A069A1003
2021.11.14 22:02:32.830 5: Mythz start Function THZ_ReadAnswer
2021.11.14 22:02:32.830 5: THZ_ReadAnswer: uc unpack: '10'
2021.11.14 22:02:32.830 5: Mythz start Function THZ_ReadAnswer
2021.11.14 22:02:32.835 5: THZ_ReadAnswer: uc unpack: '02'
2021.11.14 22:02:32.835 5: Mythz sending 10
2021.11.14 22:02:32.835 5: DevIo_SimpleWrite Mythz: 10
2021.11.14 22:02:32.836 5: Mythz start Function THZ_ReadAnswer
2021.11.14 22:02:32.837 5: THZ_ReadAnswer: uc unpack: '0100CD0A069A00221003'
2021.11.14 22:02:32.837 5: Mythz sending 10
2021.11.14 22:02:32.837 5: DevIo_SimpleWrite Mythz: 10
2021.11.14 22:02:32.838 5: Parse message: CD0A069A0022
2021.11.14 22:02:32.839 5: Message length: 12


The 22 is hex. It should be 34%

For the names. The English manual says:
HTG OUTPUT RELATIVE %
COMP N SET VAL UNLTD Hz
COMPR. N SET VAL LTD Hz

I also tried to get COMPRSSR SET OUTPUT, but there I do not get a persistent value.

TheTrumpeter

Zitat von: immi am 12 November 2021, 16:45:40
Hi TheTrumpeter,
the change you are referring to, is probably 7-10 month old

Haven't updated for some time it seems.
FHEM auf RPi3, THZ (LWZ404SOL), RPII2C & I2C_MCP342x (ADCPiZero), PowerMap, CustomReadings, RPI_GPIO, Twilight, nanoCUL (WMBus für Diehl Wasserzähler & Regenerationszähler für BWT AqaSmart), ESPEasy, TPLinkHS110

immi

Zitat von: celle am 14 November 2021, 22:27:58
Here is the debug
2021.11.14 22:02:32.838 5: Parse message: CD0A069A0022
The 22 is hex. It should be 34%
Hi,
1clean decodes your example perfectly, no need to add a new type; unless you find a different example

thanks for checking the engl manual, but they are really terrible names.
Why I  am boring about the names? I do not like to change them afterwards, and someone will have sideeffects like  TheTrumpeter.
The names of the readings should be self-explaining and not too long.

  "sHeatingRelPower"    => {cmd2=>"0A069A", type =>"1clean", unit =>" %"},
  "sComprUnlimit" => {cmd2=>"0A069C", type =>"1clean", unit =>" Hz"},
  "sComprLimit"    => {cmd2=>"0A069D", type =>"1clean", unit =>" Hz"},

I am also not really happy of my proposal. What is 0A069C-D? rotations of a compressor in Hz? or a frequency of an inverter?
immi

celle

Hello,

It looks like the number of rotations of the compressor, because it is something between 20 and at most I think something about 120hz at max in my logs, where I forced it to max power and where it was cold.

I will try 1clean for the reading. For negative values for relative power I get 65535+relative power. With my 1int not. I get negative values on dhw mode, or if the internal integral goes down, if in spring or autumn I have a night reduction because I want to use my PV power on day.

immi

Zitat von: celle am 15 November 2021, 21:48:23
I will try 1clean for the reading. For negative values for relative power I get 65535+relative power. With my 1int not. I get negative values on dhw mode...
I do not want to discuss if it makes sense a negative % of power. I just trust you :)
Please, give me 1 or 2 examples (raw data like CD0A069A0022) with the expected decoding an I will try to extend 1clean

Zitat von: celle am 15 November 2021, 21:48:23
It looks like the number of rotations of the compressor, because it is something between 20 and at most I think something about 120hz at max in....
Assuming they are rotation, what do you prefer?
  "sHeatingRelPower"  or "sHeatRelOutput"   or "sHeatingPowerRel"
  "sComprRotUnlimit"    or "sComprUnlimit"
  "sComprRotLimit"   or "sComprLimit"   
immi

Noobie47

Hi,
i am using a very first edition of  a Stiebel Eltron LWZ 303i. Maybe  the first one ever produced ;) There is no USB connectivity inside. I tried to establish a connection according to Robert Penz suggestion to build a cable and use also a RS232 to USB converter to my Raspberry. I got help from someone else in relation of configuration and editing plots.
It seems to run properly in fhem, but without real readings. Error message in THZ says:
state opened 2021-11-19 12:23:35
z_Last_fhem_err
THZ_Get: Error msg2: THZ_ReadAnswer: InterfaceNotRespondig. Maybe too slow THZ_Get_Com: error found at step0 -- F4 ->
2021-11-19 22:13:07

Anyone a suggestion what went wrong? How can i alter the baudrates? I think i read somewhere, that it might help to change the rates from 115200 to somethng else.

immi

Zitat von: Noobie47 am 19 November 2021, 22:19:14
Hi,
i am using a very first edition of  a Stiebel Eltron LWZ 303i. Maybe  the first one ever produced ;) There is no USB connectivity inside. I tried to establish a connection according to Robert Penz suggestion to build a cable and use also a RS232 to USB converter to my Raspberry. I got help from someone else in relation of configuration and editing plots.
Have you had a working connection, in which you can read something from the tecalor, via serial terminal or via the software from RobertPenz?
if not please check the cable, see https://forum.fhem.de/index.php/topic,33211.msg1181408.html#msg1181408

concerning fhem: are you using window or linux or macos?
please post your fhem config
immi

Noobie47

Hi all,
hi immi,

this is my config:

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 6193a144-f33f-2ef9-fdd3-9e765898612e3d3c

# Fake FileLog entry, to access the fhem log from FHEMWEB
define Logfile FileLog ./log/fhem-%Y-%m.log fakelog
setuuid Logfile 6193a145-f33f-2ef9-4b21-9c9fd0474588ac1d

define autocreate autocreate
setuuid autocreate 6193a145-f33f-2ef9-ce91-a85c9768fc27a28a
attr autocreate filelog ./log/%NAME-%Y.log

define eventTypes eventTypes ./log/eventTypes.txt
setuuid eventTypes 6193a145-f33f-2ef9-0f17-107cbca966b29c5d

# Disable this to avoid looking for new USB devices on startup
define initialUsbCheck notify global:INITIALIZED usb create
setuuid initialUsbCheck 6193a145-f33f-2ef9-94dc-3ec7a34eff875254
define rg_thz readingsGroup Mythz:<%temp_outside>,<Aussen>,AussenTemp Mythz:<%sani_supply_temp@red>,<Vorlauf>,VorlaufTemp Mythz:<%sani_return_temp@blue>,<Rücklauf>,RuecklaufTemp Mythz:<%sani_boiler_temp@BD7800>,<Wasser>,WWTemp Mythz:<%sani_solar_temp>,<Kollektor>,KollektorTemp
setuuid rg_thz 61977490-f33f-2ef9-6114-4ee4bc1bc2e15b8a
attr rg_thz alias Heizung Temperaturen
attr rg_thz group THZ
attr rg_thz room Sysintern
attr rg_thz valueFormat { AussenTemp => '%1.f °C', VorlaufTemp => '%1.f °C', AussenTemp=> '%1.f °C', RuecklaufTemp=> '%1.f °C', WWTemp=> '%1.f °C', KollektorTemp=> '%1.f °C' }
define MyDashboard Dashboard
setuuid MyDashboard 619774cf-f33f-2ef9-5f74-4ae21ada606689da
attr MyDashboard userattr dashboard_homeTab:1 dashboard_tab2backgroundimage dashboard_tab2colcount dashboard_tab2devices dashboard_tab2groups dashboard_tab2icon dashboard_tab2name dashboard_tab2rowcentercolwidth dashboard_tab2sorting dashboard_webRefresh:multiple-strict,WEB
attr MyDashboard dashboard_tab1groups Set your FHEM groups here and arrange them on tab 1
define Plot_Temp SVG FileLog_Mythz:thz:CURRENT attr Plot_Temp room Heizung
setuuid Plot_Temp 61977509-f33f-2ef9-8ddb-6fc04cf81e42fbbe
define Mythz THZ /dev/ttyUSB0@115200
setuuid Mythz 619787a5-f33f-2ef9-1e07-4b9e3e96d8f435cd
attr Mythz devStateIcon opened:10px-kreis-gruen disconnected:10px-kreis-rot
attr Mythz event-on-change-reading .*
attr Mythz event-on-update-reading p\d.*
attr Mythz icon sani_heating
attr Mythz interval_sGlobal 300
attr Mythz interval_sHC1 300
attr Mythz interval_sHistory 28800
attr Mythz room THZ
attr Mythz simpleReadTimeout 2
attr Mythz userReadings InnenTemp:sGlobal {((split ' ',ReadingsVal("Mythz","sGlobal",0))[81])-2.8}, AussenTemp:sGlobal {(split ' ',ReadingsVal("Mythz","sGlobal",0))[1]}, VorlaufTemp:sGlobal {(split ' ',ReadingsVal("Mythz","sGlobal",0))[3]}, RuecklaufTemp:sGlobal {(split ' ',ReadingsVal("Mythz","sGlobal",0))[5]}, WWTemp:sGlobal {(split ' ',ReadingsVal("Mythz","sGlobal",0))[9]}, VerdampferTemp:sGlobal {(split ' ',ReadingsVal("Mythz","sGlobal",0))[15]}, SeasonMode:sHC2 {(split ' ',ReadingsVal("Mythz","sHC2",0))[13]}, Verdampferlaufzeit_Heizen:sHistory {(split ' ',ReadingsVal("Mythz","sHistory",0))[1]}, Verdampferlaufzeit_WW:sHistory {(split ' ',ReadingsVal("Mythz","sHistory",0))[5]}, HeatSetTemp:sHC1 {(split ' ',ReadingsVal("Mythz","sHC1",0))[11]},HeatTemp:sHC1 {(split ' ',ReadingsVal("Mythz","sHC1",0))[13]},
define FileLog_Mythz FileLog ./log/Mythz-%Y-%m.log Mythz
setuuid FileLog_Mythz 619787a6-f33f-2ef9-f5ca-647032f63014f201
define wal_0 SVG FileLog_Mythz:thz:CURRENT
setuuid wal_0 619787a6-f33f-2ef9-69a5-cb5f424c308c5354
attr wal_0 room Heizung
define wal_1 SVG FileLog_Mythz:thz1:CURRENT
setuuid wal_1 619787a6-f33f-2ef9-4f7a-1a881a6f9406faac
attr wal_1 room Heizung
define wal_2 SVG FileLog_Mythz:thz2:CURRENT
setuuid wal_2 619787a6-f33f-2ef9-a18b-1ce6cbcc76ff6943
attr wal_2 room Heizung
define wal_3 SVG FileLog_Mythz:thz3:CURRENT
setuuid wal_3 619787a6-f33f-2ef9-d91d-74b0f74499960c77
attr wal_3 room Heizung
define wal_4 SVG FileLog_Mythz:thz4:CURRENT
setuuid wal_4 619787a6-f33f-2ef9-c073-2d535f973cefecb6
attr wal_4 room Heizung
define wal_5 SVG FileLog_Mythz:thz5:CURRENT
setuuid wal_5 619787a6-f33f-2ef9-3ec2-f19d89dc3de6c087
attr wal_5 room Heizung
define wal_6 SVG FileLog_Mythz:thz6:CURRENT
setuuid wal_6 619787a6-f33f-2ef9-6de9-b9fa558824696119
attr wal_6 room Heizung
define wal_7 SVG FileLog_Mythz:thz7:CURRENT
setuuid wal_7 619787a6-f33f-2ef9-9e28-a1a387c05ed0bb4e
attr wal_7 room Heizung
define wl_hr2 weblink htmlCode <div class="SVGplot"><embed src="/fhem/THZ_PrintcurveSVG/" type="image/svg+xml" name="wl_hr2"/></div> <a href="/fhem?detail=wl_hr2">wl_hr2</a><br>
setuuid wl_hr2 619787a6-f33f-2ef9-8779-24fb9ea7aafe42f7
attr wl_hr2 room Heizung

I never had a working connection to the heating. I will check the link you posted and i think the error is somewhere related to the cable, because atm its not connected and the same error message apears in fhem like yesterday when the cable was plugged into the heating:
state opened 2021-11-20 00:07:25
z_Last_fhem_err THZ_Get: Error msg2: THZ_ReadAnswer: InterfaceNotRespondig. Maybe too slow THZ_Get_Com: error found at step0 -- FB -> 2021-11-20 09:17:21

I am using Windows 10 home and Putty to talk to the Raspi. I reach Fhem also through Windows 10, using the typical ip adress.