Spanni26 / pyHPSU

Python Script to read and send commands to a Rotex HPSU
26 stars 15 forks source link

get value for state of backup heater #32

Open pdcemulator opened 3 years ago

pdcemulator commented 3 years ago

Hi,

I am using pyHPSU for quite a long time, everything is working fine. But I found that it does not report when the backup heater is running. Based on the docs it should be the ehs value. But its reporting 0, even when the backup heater is active. And the value for qboh is increasing.

Is someone getting data for ehs? Regarding to #24, maybe 31 00 FA C0 F9 is the wrong CAN command?

Spanni26 commented 3 years ago

Hmm,

any Idea how I can test it? At the moment its to warm for the backup heater.

Am 24.11.2020 um 17:28 schrieb pdcemulator:

Hi,

I am using pyHPSU for quite a long time, everything is working fine. But I found that it does not report when the backup heater is running. Based on the docs it should be the ehs value. But its reporting 0, even when the backup heater is active. And the value for qboh is increasing.

Is someone getting data for ehs? Regarding to #24 https://github.com/Spanni26/pyHPSU/issues/24, maybe |31 00 FA C0 F9| is the wrong CAN command?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Spanni26/pyHPSU/issues/32, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2I5HD7KXRLW3V526TXCF3SRPNJLANCNFSM4UBDS2AA.

ahermann86 commented 3 years ago

Hello,

the problem is, that you get more than one responses with this request ([responseMsg]\r[responseMsg]\r). You have to parse the whole buffer after a request and split the resulting string with \r.

I dont have time to make this in this Python script. I made this with perl in my FHEM Module 70_HPSU.pm and it look like this:

`
..... while($msg =~ m/\r/) { my $msgSplit = "";

      ($msgSplit, $msg) = split("\r", $msg, 2);
      $msgSplit =~ s/ +$//; #delete whitespace

      my ($name, $nicename, $out) = HPSU_CAN_ParseMsg($hash, $msgSplit);

      if ($name and $out)
      {
        readingsSingleUpdate($hash, "HPSU.$nicename", $out, 1);
        $hash->{jcmd}->{$name}->{FHEMLastResponse} = gettimeofday();
        $hash->{jcmd}->{$name}->{AktVal} = $out; #for "verify"...
        $hash->{helper}{CANRequestPending} = 0;
      }
      $hash->{helper}{CANRequestPending} = 0 if ($hash->{helper}{CANHeaderID} eq "680");  #NoData
    }

`

Maybe someone can fix this with Python in this project...

For testing, you can connect the ELM327 with a terminal programm and look what you get.

Greetings Axel

Spanni26 commented 3 years ago

Hm,

I get only one message:   can0  190   [5]  31 00 FA C0 F9   can0  180   [7]  32 10 FA C0 F9 00 00

But my backup heater is not running. Its to warm here.

Am 25.11.2020 um 09:44 schrieb Axel Hermann:

Hello,

the problem is, that you get more than one responses with this request. You have to parse the buffer complete after a request and split the resulting string with \r.

I dont have time to make this in this phyton script. I made this with perl in my FHEM Module 70_HPSU.pm and it look like this:

` ..... while($msg =~ m/\r/) { my $msgSplit = "";

|($msgSplit, $msg) = split("\r", $msg, 2); $msgSplit =~ s/ +$//;

delete whitespace my ($name, $nicename, $out) =

HPSU_CAN_ParseMsg($hash, $msgSplit); if ($name and $out) { readingsSingleUpdate($hash, "HPSU.$nicename", $out, 1); $hash->{jcmd}->{$name}->{FHEMLastResponse} = gettimeofday(); $hash->{jcmd}->{$name}->{AktVal} = $out; #for "verify"... $hash->{helper}{CANRequestPending} = 0; } $hash->{helper}{CANRequestPending} = 0 if ($hash->{helper}{CANHeaderID} eq "680"); #NoData } |

`

Maybe someone can fix this with Python in this project...

Greetings Axel

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Spanni26/pyHPSU/issues/32#issuecomment-733557421, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2I5HEVW5WZ42XR5KG2O2LSRS7YHANCNFSM4UBDS2AA.

pdcemulator commented 3 years ago

At the moment its to warm for the backup heater.

For heating, yes. But when the warm water temperature is near the lower threshold and the bathtub is filled... in short the water is too cold, then the backup heater is starting. And yes, my goal is to minimize the usage of the heater :-)

ahermann86 commented 3 years ago

Hello,

if you send request: 31 00 FA C0 F9<\r> youre response will be: 22 0A FA C0 FB 00 64 <\r> 32 10 FA C0 F9 17 70 <\r> <\r>

17 70 -> 6000 W

This Python script has not implemented the responses who are not requested like "22 0A FA C0 FB 00 64" in this example. Someone have to fix this in the script...

Hardware: EHS 6kW

My FHEM Module EHS_FHEM

Greetings Axel

hackepeterOli commented 3 years ago

Here was my rotex Control unit faulty, pyHPSU ehs works:

Axel Hermann notifications@github.com schrieb am Mo. 30. Nov. 2020 um 21:55:

Hello,

if you send request: 31 00 FA C0 F9<\r> youre response will be: 22 0A FA C0 FB 00 64 <\r> 32 10 FA C0 F9 17 70 <\r> <\r>

17 70 -> 6000 W

This Python script has not implemented the responses who are not requested like "22 0A FA C0 FB 00 64" in this example. Someone have to fix this in the script...

Hardware: [image: EHS 6kW] https://user-images.githubusercontent.com/48262831/100661922-79e12600-3354-11eb-9ea6-2841045b6f4c.jpg

My FHEM Module [image: EHS_FHEM] https://user-images.githubusercontent.com/48262831/100663242-4bfce100-3356-11eb-9a18-8af2620d7357.png

Greetings Axel

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Spanni26/pyHPSU/issues/32#issuecomment-736037318, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKSSFLPFREPMGEUA75OUYYLSSQBDPANCNFSM4UBDS2AA .

-- Mit freundlichen Grüßen Oliver Rother


Kantstr. 19 D-36469 Tiefenort Mobil: +49(0)174 9561348 web: http://oliver@rother-it.de

Spanni26 commented 3 years ago

Ok, its cold here and the HPSU is using the backup heater.

So I checked it:

root@rotex:~# pyHPSU.py -c ehs -o json
[{'name': 'ehs', 'resp': '9000', 'timestamp': 1613062272.084939}]
root@rotex:~# pyHPSU.py -c ehs -o json
[{'timestamp': 1613062285.739523, 'resp': '0', 'name': 'ehs'}]
root@rotex:~# pyHPSU.py -c ehs -o json
[{'timestamp': 1613062290.793521, 'name': 'ehs', 'resp': '0'}]
root@rotex:~# pyHPSU.py -c ehs -o json
[{'name': 'ehs', 'timestamp': 1613063267.158688, 'resp': '0'}]
root@rotex:~# pyHPSU.py -c ehs -o json
[{'resp': '3000', 'timestamp': 1613064168.072003, 'name': 'ehs'}]

As we can see, at the first shot it runs with 9KW, then it was switched of. On the last shot it was used with 3kW. So I think it works as expected.

ckohrt commented 3 years ago

It works also for me. Same results as above from Daniel. e.g. pyHPSU.py -c ehs -d PYCAN -p /dev/ttyS0 -o CSV 1615202591.456367,ehs,0