Giter VIP home page Giter VIP logo

Comments (123)

JoostBaltissen avatar JoostBaltissen commented on August 15, 2024 2

I installed the latest version and it look ok. All values seem more or less logical.
Result: 80 82 A4 00 01 6F 92 92 92 92 92 92 92 92 92 92 92 92 92 92 0C 0C 0C 0C 10 10 0C 00 00 00 10 10 0C 0C 0C 0C 0C 10 92 92 00 00 00 00 92 92 92 92 00 00 10 0C 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 00 00 20 00 00 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 00 00 00 A2 A5 92 92 90 10 00 00 00 00 10 ED
Status:
Result: 80 82 A4 01 01 AA 02 BC 13 6D 13 9E 02 8C 03 FE 1B 51 14 96 03 20 03 E2 09 1A 0A CC 00 78 01 53 00 00 00 00 00 00 00 00 05 71 00 00 45 64 05 AA 05 AA 01 00 00 01 00 01 24 08 48 08 34 00 03 06 00 02 28 16 53 02 28 16 53 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 13 00 00 00 00 00 00 00 00 00 00 08 5A 00 00 00 00 01 F4 17 00 61 94 C0 36 2D 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 01 00 00 00 00 01 00 00 00 01 01 FF FF FF D0 00 6A 1C 01 1A F9 00 00 00 3C 03 B5 01 09 29 1A 00 00 A7

Label Value
temp 0
hum 0
ppmw 0
Buitentemp (°C) 7
Boiler laag (°C) 49.04
Boiler hoog (°C) 49.55
Verdamper temp (°C) 6.46
Zuiggas temp (°C) 10.31
Persgas temp (°C) 68.89
Vloeistof temp (°C) 52
Naar bron (°C) 8.01
Van bron (°C) 9.94
CV aanvoer (°C) 23.39
CV retour (°C) 26.83
Druksensor (Bar) 1.19
Stroomtrafo 1 (A) 3.36
Stroomtrafo 2 (A) 0
Drukschakelaar 0
Hoog / laag 0
Condens beveiliging 0
Spare Ingang 0
Pulsteller 0
Flowsensor (lt/hr) 1403
Fase detectie 0
Cv pomp (%) 0
Bron pomp (%) 69
Boiler pomp (%) 100
Vrijkoelklep (pls) 1450
Cv klep (pls) 1450
Compressor 1
Element 0
Trickle heating 0
Fout 1
Vrijkoel 0
Expansieventiel (pls) 292
Kamertemp (°C) 21.18
Gevr temp (°C) 21
Vraag (%) 0
State 3
Sub_status 6
Blokkade 0
Berekende verdampings temp (°C) 5.46
Berekende condensatie temp (°C) 56.4
Berekende verdampings temp DHW (°C) 5.46
Berekende condensatie temp DHW (°C) 56.4
Fout_gevonden 0
Fout_retry 0
Taak aktief 0
Handbediening 0
Compr blok (sec) 0
Elek blok (sec) 0
Cv voor / nadraai (sec) 0
Bron voor / nadraai (sec) 0
Boiler voor / nadraai (sec) 0
Delay elektr (sec) 0
Min draaitijd compr (sec) 0
Afpomp tijd (sec) 0
EV drukvereffenen (sec) 0
EV verstellen (sec) 25
Vrijkoel interval (sec) 0
Handbediening (sec) 0
Lage druk timer (sec) 0
Compressor start (sec) 0
Compr power on delay (sec) 0
Vertraging cv start (sec) 2384
Vertraging cv stop (sec) 0
Adaptief timer (sec) 0
Adaptief oververhitting (K) 5
Adaptief fifo index 24
Fout hoogste prioriteit 0
UTC tijd 1637138240
Max cv retour temp (°C) 45
Bronpomp snelheid vrijkoel mode 0
Compressor in Cv mode 0
Compressor in boiler mode 1
Element in cv mode 0
Element in boiler mode 0
Cv mode geblokkeerd 0
Boiler mode geblokkeerd 0
Vrijkoel mode geblokkeerd 0
Ontlucht mode geblokkeerd 0
Elektr element geblokkeerd 0
Elektr Element DHW geblokkeerd 0
Compressor geblokkeerd 0
Off mode aktief 0
Cv mode aktief 0
Boiler mode aktief 1
Vrijkoel mode aktief 0
Cv pomp voordraaien 0
Bron pomp voordraaien 0
Element vrijgegeven door gebruiker 0
Vrijgave extra koelen 0
Cv vrijgegeven 1
Vrijkoel vrijgegeven 0
Tarief laag vanuit thermostaat 0
Ontluchten vanuit thermostaat 0
Eco geselecteerd op thermostaat 0
Comfort geselecteerd op thermostaat 1
Boiler blokkade vanuit thermostaat 0
Boiler boost vanuit thermostaat 0
Warmtevraag (%) 0
UTC tijd : 1
Element alleen voor DHW vrijgegeven 1
P fout bronflow -0.44
I fout bronflow 69.87315
PI bronflow resultaat 69.43
Actuele bronklepstand (%) 0
Utc Tijd offset (min.) 60
Gateway Tijd ontvangen 953
OT-tijd valid 1
Tijd uren (uur) 9
Tijd minuten (min) 37
Tijd seconden (sec) 20
Vrijkoel blokkade tijd (min.) 0

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024 1

This is where comments in code make sense I guess ;-)

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024 1

So this then should work better?

const uint8_t itho_WPUset11_17[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98 };

const uint8_t *ithoWPUSettingsMap[] =  { nullptr, itho_WPUset2,itho_WPUset4,itho_WPUset5,itho_WPUset6,itho_WPUset7,itho_WPUset8_9,itho_WPUset10,itho_WPUset11_17,itho_WPUset11_17,itho_WPUset11_17,itho_WPUset11_17,itho_WPUset11_17,itho_WPUset11_17,itho_WPUset18_19,itho_WPUset20,itho_WPUset21,itho_WPUset22,itho_WPUset23,itho_WPUset24,itho_WPUset25,itho_WPUset27,itho_WPUset31,itho_WPUset33,itho_WPUset34,itho_WPUset37};

Will tidy up the rest as well with some scripting.

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024 1

__FlashStringHelper is a wrapper class defined here:
https://github.com/espressif/arduino-esp32/blob/b94b38c9d11f3c4a85ac3e18a9ec22132351716d/cores/esp32/WString.h#L38

wpu.h or IthoSystemConstant.h are both fine, I'll pull the PR to a local dirty branch and test/compile the code. I can post the compiled version here

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024 1

Ok, to debug this. I can start with this Query Status?

" 80 82 A4 01 01 D4 F4 48 0B 38 10 FB 01 4A 03 6B 10 A1 09 BD 02 1A 03 50 09 8D 08 6A 00 E9 01 17 00 00 00 00 00 00 00 05 5A 00 5A 3D 00 00 00 01 00 00 01 00 01 F4 08 0E 08 66 64 02 07 00 01 18 0A 45 01 18 0A 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 00 00 00 00 00 00 00 00 00 00 00 00 2A 30 00 00 01 F4 20 00 5A 94 ED D3 2D 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 01 00 00 00 01 00 00 00 64 00 00 00 05 00 00 04 29 00 00 00 C5 00 00 00 56 00 01 27 10 00 06 63 00 00 00 00 F5 10 00 96 00 02 1A 05 78 3D 00 00 FF 00 00 00 00 0E 10 00 00 00 00 05 A0 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C7"

I saw 1065 displayed as CV pressure which translates to 04 29 in hex and values are separated by 00? But will have a better look at your code this evening

Ah nvm, you explained it already.

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024 1

Ah, that explains! The array index = itho version
So version 34 would translate to the pointer at *ithoWPUSstatusMap[34].

So the array must be something like this:
const uint8_t *ithoWPUSstatusMap[] = { nullptr,nullptr,itho_WPUstatus2,nullptr,itho_WPUstatus4, itho_WPUstatus5, itho_WPUstatus6, itho_WPUstatus7, itho_WPUstatus8_9, itho_WPUstatus8_9, itho_WPUstatus10, itho_WPUstatus11_17, itho_WPUstatus11_17, itho_WPUstatus11_17, itho_WPUstatus11_17, itho_WPUstatus11_17, itho_WPUstatus11_17, itho_WPUstatus11_17, itho_WPUstatus18_19, itho_WPUstatus18_19, itho_WPUstatus20, itho_WPUstatus21, itho_WPUstatus22_25, itho_WPUstatus22_25, itho_WPUstatus22_25, itho_WPUstatus22_25,nullptr, itho_WPUstatus27,nullptr,nullptr,nullptr, itho_WPUstatus31,nullptr, itho_WPUstatus33, itho_WPUstatus34_37, itho_WPUstatus34_37, itho_WPUstatus34_37, itho_WPUstatus34_37};

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024 1

Everything else looks good OK now. Havent seen anything that looks completely off.

Some suggestions for next versions:

  1. Add unit type (I can read it from Itho dbase and add it to the label) as otherwise it's difficult to interpret the values
  2. Selection of fields for MQTT?
    I guess out of all status values available, not everything is interesting for a HA system. MQTT supports the large message size all together and filtering can be done on receiving end, but sending a select number of fields feels cleaner.

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024 1

Thanks, I was trying to load the data via MQTT in Home Assistant but it seems there's another fix needed?

This is not relevant anymore?

No, It was my fault. I didn’t turn on mqtt with the new firmware so initially looked at the old mqtt from the previous version. Rookie mistake

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024 1

So much for the theory of full overlap then....

Having a per version all labels explicitly added to the .h file will just add bloat and just adding a baseline (v37) with per versions differences only is difficult I guess.

Having a per version all labels explicitly added to the .h file is not needed. What I did up until now was create one list with all the unique labels for all the different versions, this creates the flashstring array with all the possible labels. Then map it to the correct index position for a particular version. Where the mapping is the same between versions they are collapsed into one mapping.
So it seems that the only change needed to the script is that the total mapping is created for each version instead of assuming that parts of the mapping always overlap.

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024 1

Spaghetti code incoming. Had to rewrite it quite a few times to have the squashing done based on versions / record count.
I think the only part that's still relevant are the labels and not the structs anymore given your changes earlier and I didn't update that part.

class ExportWPU 
                
{                       
        private $db;    
                        
                        
        public function __construct() 
        {                               
                $this->db = new SQLite3('wpu.db');
        }                               
                                
        private function squashcounts(array $d): array
        {                       
                $output = [];
                $tmp = [];
                $tmpCount = [];
                foreach($d as $k=>$v) {
                        if (count($v) > 1)      {
                                $output[$k] = $v;
                        } else {
                                $results = $this->db->query("select count(*) as cnt from datalabel_v".$v[0]);
                                $row = $results->fetchArray();
                                $tmp[$v[0]] = $row[0];
                                if (! isset($tmpCount[$row[0]])) {
                                        $tmpCount[$row[0]] = [];
                                }
                                $tmpCount[$row[0]][] = $v[0];
                        }       
                }               
                                        
                foreach($tmpCount as $count=>$v) 
                {                       
                        if (count($v) == 1) {
                                $output[$v[0]][] = $v[0];
                        } else {        
                                $output[$v[0]] = $v;
                        }       
                }       
                ksort($output);
        
                return $output;
        }

        public function squashSettings(): void
        {
                $results = $this->db->query("select version,datalabel from versiebeheer");
                $v = [];
                while ($row = $results->fetchArray()) {
                        $v[$row['version']] = $row['datalabel'];
                }
                $dl = [];
                foreach($v as $key=>$value) {
                        if (! isset($dl[$value])) { $dl[$value] = []; }

                        $dl[$value][] = $key;
                }

                $dl = $this->squashcounts($dl);

                $settings = [];
                foreach($dl as $k=>$v) {
                        $av = array_values($v);
                        if (count($v) == 1) {
                                echo "const uint8_t itho_WPUset".$k."[] = { ".$this->getStatusByVersion($k)."};\n";

                                $settings[$av[0]] = "itho_WPUset".$k;

                        } else {
                                $c = count($v);
                                $from = array_shift($v);
                                $to = array_pop($v);
                                echo "const uint8_t itho_WPUset".$from."_".$to."[] = { ".$this->getStatusByVersion($k)." };\n";
                                for($i=0;$i<$c;$i++) {
                                        $settings[$from+$i] = "itho_WPUset".$from."_".$to;
                                }
                        //      $settings[$v] = "WPUset".$from."_".$to; 
                        }
                }
                echo "\n\n";
                echo "const uint8_t *ithoWPUSettingsMap[] =  { nullptr, ";
                foreach($settings as $version => $code) {
                        echo $code.",";
                }
                echo "255};\n\n";

        }

        public function squashStatus(): void
        {
                $results = $this->db->query("select version,datalabel from versiebeheer");
                $v = [];
                while ($row = $results->fetchArray()) {
                        $v[$row['version']] = $row['datalabel'];
                }
                $dl = [];
                foreach($v as $key=>$value) {
                        if (! isset($dl[$value])) { $dl[$value] = []; }
                        $dl[$value][] = $key;
                }

                $settings = [];
                $dl = $this->squashcounts($dl);
                foreach($dl as $k=>$v) {
                        $av = array_values($v);
                        if (count($v) == 1) {
                                echo "const uint8_t itho_WPUstatus".$k."[] = { ".$this->getStatusByVersion($k)."};\n";

                                $settings[$av[0]] = "itho_WPUstatus".$k;

                        } else {
                                $c = count($v);
                                $from = array_shift($v);
                                $to = array_pop($v);

                                echo "const uint8_t itho_WPUstatus".$from."_".$to."[] = { ".$this->getStatusByVersion($k)." };\n";
                                for($i=0;$i<$c;$i++) {
                                        $settings[$from+$i] = "itho_WPUstatus".$from."_".$to;
                                }
                        }
                }
                echo "\n\n";
                echo "const uint8_t *ithoWPUSstatusMap[] =  { nullptr, ";
                foreach($settings as $version => $code) {
                        echo $code.",";
                }
                echo "255};\n\n";

        }



        private function getStatusByVersion(int $version): string
        {
                $results = $this->db->query("select id from datalabel_v".$version);
                $rv = [];
                while ($row = $results->fetchArray()) {
                        $rv[] = $row['id'];
                }
                return join(",",$rv);
        }

        public function createSettingDescriptions(): void
        {
                echo "const __FlashStringHelper *ithoWPUSettingDescriptions[] = {\n";


                $results = $this->db->query("SELECT * from versiebeheer where datalabel = '37'");
                while ($row = $results->fetchArray()) {
                        $v = $row['datalabel'];
                        $q = "select title,tooltip from datalabel_v".$v;
                        $rq = $this->db->query($q);
                        while ($r2 = $rq->fetchArray()) {
                                if (! empty($r2['tooltip'])) {
                                        $labels = $r2['tooltip'];
                                } else {
                                        $labels = $r2['title'];
                                }
                                echo 'F("'.$labels.'"),';
                                echo "\n";
                        }
                }

                echo "\n};\n\n";

        }

        public function createStatusLabels(): void
        {
                echo "const __FlashStringHelper *ithoWPUStatusLabels[] =  {\n";
                        $results = $this->db->query("SELECT * from versiebeheer where datalabel = '37'");
                        while ($row = $results->fetchArray()) {
                                $v = $row['datalabel'];
                                $q = "select title,unit from datalabel_v".$v;
                                $rq = $this->db->query($q);
                                while ($r2 = $rq->fetchArray()) {
                                        $labels = $r2['title'];
                                        if ($r2['unit'] != '') {
                                        echo 'F("'.$labels.' ('.$r2['unit'].')"),';
                                        } else {
                                                echo 'F("'.$labels.'"),';
                                        }
                                        echo "\n";
                                }
                        }
                echo "\n};\n\n";


}



$w = new ExportWPU;
$w->squashSettings();
$w->squashStatus();
$w->createStatusLabels();
$w->createSettingDescriptions();

?>

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024 1

Hmm, Arjen beat me to it. :)

Some coding to get for each name (regardless of the version) the matching versions, not considering squashing (yet).

  1. Build an array with unique labels across all versions using name
  2. Iterate over all versions and create an array of label positions
  3. Show title + unit
const uint8_t itho_WPUstatus2[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60 }
const uint8_t itho_WPUstatus4[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67 }
const uint8_t itho_WPUstatus5[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,68 }
const uint8_t itho_WPUstatus6[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,64,65,66,67,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97 }
const uint8_t itho_WPUstatus7[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,64,101,66,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,102 }
const uint8_t itho_WPUstatus8[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,64,101,66,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,102,103 }
const uint8_t itho_WPUstatus10[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,102,103 }
const uint8_t itho_WPUstatus11[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,102,103 }
const uint8_t itho_WPUstatus18[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,102,103,112,113,114,115,116,117,118,119,120,121 }
const uint8_t itho_WPUstatus20[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,102,103,112,113,114,115,116,117,118,119,120,121,122 }
const uint8_t itho_WPUstatus21[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,102,103,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133 }
const uint8_t itho_WPUstatus22[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,102,103,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134 }
const uint8_t itho_WPUstatus23[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,102,103,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134 }
const uint8_t itho_WPUstatus24[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,102,103,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134 }
const uint8_t itho_WPUstatus25[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,102,103,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134 }
const uint8_t itho_WPUstatus27[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,135,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,54,53,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,136,137,138,139,102,103,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,140,141,142 }
const uint8_t itho_WPUstatus31[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,135,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,54,53,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,136,137,138,139,143,103,114,115,116,122,123,124,125,126,127,128,129,130,131,132,134,140,141,142,144,145,146,102 }
const uint8_t itho_WPUstatus33[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,135,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,54,53,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,136,137,138,139,143,103,114,115,116,122,123,124,125,126,127,128,129,147,131,130,132,134,140,141,142,144,145,146,102,148,149,150,151,152,153 }
const uint8_t itho_WPUstatus34[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,135,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,54,53,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,136,137,138,139,143,103,114,115,116,122,123,124,125,126,127,128,129,147,131,130,132,134,140,141,142,144,145,146,102,148,149,150,151,152,153,154 }
const uint8_t itho_WPUstatus37[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,155,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,54,53,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,136,137,138,139,143,103,114,115,116,122,123,124,125,126,127,128,129,147,131,130,132,134,140,141,142,144,145,146,102,148,149,150,151,152,153,154 }

Flash labels:

F(|0|"Buitentemp (°C)"),
F(|1|"Boiler laag (°C)"),
F(|2|"Boiler hoog (°C)"),
F(|3|"Verdamper temp (°C)"),
F(|4|"Zuiggas temp (°C)"),
F(|5|"Persgas temp (°C)"),
F(|6|"Vloeistof temp (°C)"),
F(|7|"Naar bron (°C)"),
F(|8|"Van bron (°C)"),
F(|9|"CV aanvoer (°C)"),
F(|10|"CV retour (°C)"),
F(|11|"Druksensor (Bar)"),
F(|12|"Stroomtrafo 1 (A)"),
F(|13|"Stroomtrafo 2 (A)"),
F(|14|"Drukschakelaar"),
F(|15|"Hoog / laag"),
F(|16|"Condens beveiliging"),
F(|17|"Pulsteller"),
F(|18|"Flowsensor (lt/hr)"),
F(|19|"Fase detectie"),
F(|20|"Cv pomp (%)"),
F(|21|"Bron pomp (%)"),
F(|22|"Boiler pomp (%)"),
F(|23|"Vrijkoelklep (pls)"),
F(|24|"Cv klep (pls)"),
F(|25|"Compressor"),
F(|26|"Element"),
F(|27|"Trickle heating"),
F(|28|"Fout"),
F(|29|"Vrijkoel"),
F(|30|"Expansieventiel (pls)"),
F(|31|"Kamertemp (°C)"),
F(|32|"Gevr temp (°C)"),
F(|33|"Vraag (%)"),
F(|34|"State"),
F(|35|"Sub_status"),
F(|36|"Blokkade"),
F(|37|"Berekende verdampings temp (°C)"),
F(|38|"Berekende condensatie temp (°C)"),
F(|39|"Foutcode byte 5"),
F(|40|"Foutcode byte 4"),
F(|41|"Foutcode byte 3"),
F(|42|"Foutcode byte 2"),
F(|43|"Foutcode byte 1"),
F(|44|"Foutcode byte 0"),
F(|45|"Handbediening"),
F(|46|"Logging (sec)"),
F(|47|"Compr blok (sec)"),
F(|48|"Elek blok (sec)"),
F(|49|"Cv voor / nadraai (sec)"),
F(|50|"Bron voor / nadraai (sec)"),
F(|51|"Boiler voor / nadraai (sec)"),
F(|52|"Delay elektr (sec)"),
F(|53|"Min draaitijd compr (sec)"),
F(|54|"Afpomp tijd (sec)"),
F(|55|"EV drukvereffenen (sec)"),
F(|56|"EV verstellen (sec)"),
F(|57|"Vrijkoel interval (sec)"),
F(|58|"Handbediening (sec)"),
F(|59|"Lage druk timer (sec)"),
F(|60|"Compressor start (sec)"),
F(|61|"Compr power on delay (sec)"),
F(|62|"Cv start vertraging (sec)"),
F(|63|"Cv stop vertraging (sec)"),
F(|64|"Fout hoogste prioriteit"),
F(|65|"Tijd voor fouthistorie (sec)"),
F(|66|"Max cv retour temp (°C)"),
F(|67|"StroomHardware"),
F(|68|"Fout hoogste prioriteit"),
F(|69|"Vertraging cv start (sec)"),
F(|70|"Vertraging cv stop (sec)"),
F(|71|"Bronpomp snelheid vrijkoel mode"),
F(|72|"Compressor in Cv mode"),
F(|73|"Compressor in boiler mode"),
F(|74|"Element in cv mode"),
F(|75|"Element in boiler mode"),
F(|76|"Cv mode geblokkeerd"),
F(|77|"Boiler mode geblokkeerd"),
F(|78|"Vrijkoel mode geblokkeerd"),
F(|79|"Ontlucht mode geblokkeerd"),
F(|80|"Elektr element geblokkeerd"),
F(|81|"Compressor geblokkeerd"),
F(|82|"Off mode aktief"),
F(|83|"Cv mode aktief"),
F(|84|"Boiler mode aktief"),
F(|85|"Vrijkoel mode aktief"),
F(|86|"Cv pomp voordraaien"),
F(|87|"Bron pomp voordraaien"),
F(|88|"Element vrijgegeven door gebruiker"),
F(|89|"Vrijgave extra koelen"),
F(|90|"Cv vrijgegeven"),
F(|91|"Vrijkoel vrijgegeven"),
F(|92|"Tarief laag vanuit thermostaat"),
F(|93|"Ontluchten vanuit thermostaat"),
F(|94|"Eco geselecteerd op thermostaat"),
F(|95|"Comfort geselecteerd op thermostaat"),
F(|96|"Boiler blokkade vanuit thermostaat"),
F(|97|"Boiler boost vanuit thermostaat"),
F(|98|"Fout_gevonden"),
F(|99|"Fout_retry"),
F(|100|"Taak aktief"),
F(|101|"UTC tijd"),
F(|102|"UTC tijd :"),
F(|103|"Element alleen voor DHW vrijgegeven"),
F(|104|"Spare Ingang"),
F(|105|"Elektr Element DHW geblokkeerd"),
F(|106|"Berekende verdampings temp DHW (°C)"),
F(|107|"Berekende condensatie temp DHW (°C)"),
F(|108|"Adaptief timer (sec)"),
F(|109|"Adaptief oververhitting (K)"),
F(|110|"Adaptief fifo index"),
F(|111|"Warmtevraag (%)"),
F(|112|"P fout bronflow"),
F(|113|"I fout bronflow"),
F(|114|"PI bronflow resultaat"),
F(|115|"Actuele bronklepstand (%)"),
F(|116|"Utc Tijd offset (min.)"),
F(|117|"Gateway Tijd ontvangen"),
F(|118|"OT-tijd valid"),
F(|119|"Tijd uren (uur)"),
F(|120|"Tijd minuten (min)"),
F(|121|"Tijd seconden (sec)"),
F(|122|"Vrijkoel blokkade tijd (min.)"),
F(|123|"Vrijkoelklep control percentage (%)"),
F(|124|"Luchtklep positie (%)"),
F(|125|"HRU uitblaas temp (°C)"),
F(|126|"HRU uitblaas flow (m3/h)"),
F(|127|"Regeneratie aktief"),
F(|128|"Laatst geldige brontoevoer temp. (°C)"),
F(|129|"Bronpomp flow setpoint (l/h)"),
F(|130|"Bronpomp snelheid bij luchtreg + Compr (%)"),
F(|131|"Bronpomp snelheid bij vrijkoel (%)"),
F(|132|"Vrijkoelmodus"),
F(|133|"Vrijkoel aan tijd (sec)"),
F(|134|"Positie CO-klep (%)"),
F(|135|"Reserve"),
F(|136|"E-verbuik tijdens stand-by (kWh)"),
F(|137|"E-verbuik tijdens verwarmen (kWh)"),
F(|138|"E-verbuik tijdens DHW (kWh)"),
F(|139|"E-verbuik tijdens koelen (kWh)"),
F(|140|"Minimale vrijgave tijd extern koelen (sec.)"),
F(|141|"Blokkeertijd vrijgave extern koelen (sec.)"),
F(|142|"Blokkeertijd vrijgave extern verwarmen (sec.)"),
F(|143|"Voorverwarmen tapwater"),
F(|144|"Blokkeertijd trickle low na power-up (sec.)"),
F(|145|"Blokkeertijd trickle low na CV-bedrijf (sec.)"),
F(|146|"Blokkeertijd voorverwarmen tapwater (sec.)"),
F(|147|"Bronpomp snelheid bij Compr (%)"),
F(|148|"Slow start bronpomp (sec.)"),
F(|149|"Bron retourtemperatuur te laag (sec.)"),
F(|150|"Regelperiode bronflow (sec.)"),
F(|151|"Stabilisatie wachttijd vrijkoelen (sec.)"),
F(|152|"Minimale tijd voorverwarmen tapwater (sec)"),
F(|153|"Maximale tijd voorverwarmen tapwater (sec.)"),
F(|154|"Vrijgave elektrisch element (min)"),
F(|155|"Correctie meting delta brontemperatuur (K)")

The |XXX| is added for reference only. I am not sure if this works...

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024 1

Some coding to get for each name (regardless of the version) the matching versions, not considering squashing (yet).

  1. Build an array with unique labels across all versions using name
  2. Iterate over all versions and create an array of label positions
  3. Show title + unit

RofL! This is just brilliant. This seems to be exactly the same idea as my reply minutes earlier 💯

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024 1

Thanks! The settings were just added so you couldn't have checked them earlier :)
The list is limited indeed, I've used a password level to limit the number of available settings. The total number is settings is larger than currently fits the structure and the higher password level settings are probably more dangerous and less relevant to include. Maybe at a later stage I'll include the other ones as well.

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

I've created a simple script that reads the WPU database of Itho and converts it to a C++ header file to get a head start.
It's here: https://github.com/jasperslits/ithowifi/blob/master/wpu.h

Oh that's nice work!! Saves me hours of manual work!

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

For status labels it might be a better idea to use longer names, are they available? And they need to be translated then from Dutch to English but that can be done quite easily with ie. https://www.deepl.com/translator

Also arrays that are the same could be squashed into 1, saving precious memory :)

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

I think the WPU devices are only used in NL but we have this for example:

130.0|FreeCoolingStabilizeTimer|Stabilisatie wachttijd vrijkoelen||sec.
131.0|PreHeatDHWMinOnTimer|Minimale tijd voorverwarmen tapwater||sec
132.0|PreHeatDHWMaxOnTimer|Maximale tijd voorverwarmen tapwater||sec.
133.0|RemainingTimeEelementReleased|Vrijgave elektrisch element||min

For preHeatDHWMinOnTimer we have the following labels available:

  1. Voorverwarmen tapwater minimale aan tijd
  2. Voorverwarmen tapwater is na activatie een minimale tijdsduur actief
  3. Minimale tijd voorverwarmen tapwater

I guess you want to send preHeatDHWMinOnTimer in the MQTT pay load and either one of the 3 labels on the screen?
I guess nr 3 (when translated) is more user friendly then?

And today this .h file is generated by a script so if multiple versions have the same labels, they can be squashed? I can add that logic, shouldn't be rocket science (compared to what you do here) ;)

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

I think the WPU devices are only used in NL but we have this for example:

That might be the case, but still, I'd like to keep the interface in one language

I guess nr 3 (when translated) is more user friendly then?

Yes, sure is

Interesting to see that the repo you linked seems not to map labels based on itho fw versions, not sure if I missed something but that should not deliver the correct results in all cases.

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

And today this .h file is generated by a script so if multiple versions have the same labels, they can be squashed? I can add that logic, shouldn't be rocket science (compared to what you do here) ;)

Yes, the squashed label arrays can be recognised by the start and end version number ie.:

const uint8_t itho_DemandFlowv16_17[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 164, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 230, 231, 52, 53, 165, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 100, 102, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 167, 166, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 116, 117, 118, 186, 143, 144, 145, 146, 147, 149, 152, 150, 151, 184, 185, 155, 156, 157, 158, 159, 160, 180, 181, 182, 183, 161, 162, 163, 187, 188, 255};

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

Yes, sure is

Interesting to see that the repo you linked seems not to map labels based on itho fw versions, not sure if I missed something but that should not deliver the correct results in all cases.

It does read the version from the WPU unit and then queries the database for the right labels using versiebeheer table. Each version has its own table (e.g. datalabels_v37) with some exceptions where multiple versions use the same datalabels table.

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

And today this .h file is generated by a script so if multiple versions have the same labels, they can be squashed? I can add that logic, shouldn't be rocket science (compared to what you do here) ;)

Yes, the squashed label arrays can be recognised by the start and end version number ie.:

const uint8_t itho_DemandFlowv16_17[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 164, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 230, 231, 52, 53, 165, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 100, 102, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 167, 166, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 116, 117, 118, 186, 143, 144, 145, 146, 147, 149, 152, 150, 151, 184, 185, 155, 156, 157, 158, 159, 160, 180, 181, 182, 183, 161, 162, 163, 187, 188, 255};

Ah, now it makes sense. So I can adjust the naming convention. Didn't realise it was used for that squashing then

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Yep, that saves memory, all those uint8_t values are loaded on the stack and thus consume memory during the lifetime of the program. Maybe it is better to write a file (or DB like system) to flash with all this info, not sure how though

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

I see. You don't want to put some if #defined (NON_CVE) around it? I've now a version for non-CVE and yet all other CVE values are defined and loaded?

Anyway, assume the squashed header file for settings and descriptions and Flash messages are provided. Is there anything else needed in terms of I2C output from debugging to glue to it all together?

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

I see. You don't want to put some if #defined (NON_CVE) around it? I've now a version for non-CVE and yet all other CVE values are defined and loaded?

For now yes, I know some users that wired the CVE version to a non-CVE device. If I can keep the memory usage acceptable I would like to keep the firmware versions as much the same as possible.

Anyway, assume the squashed header file for settings and descriptions and Flash messages are provided. Is there anything else needed in terms of I2C output from debugging to glue to it all together?

Nope, with that status and settings should work when linked to the main struct here:

struct ihtoDeviceType ithoDevices[] {
{ 0x01, "Air curtain", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x03, "HRU ECO-fan", ithoHRUecoFanSettingsMap, sizeof(ithoHRUecoFanSettingsMap) / sizeof(ithoHRUecoFanSettingsMap[0]), ihtoHRUecoFanSettingsDescriptions, ithoHRUecoFanStatusMap, ihtoHRUecoFanStatusLabels },
{ 0x08, "LoadBoiler", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x0A, "GGBB", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x0B, "DemandFlow", ithoDemandFlowSettingsMap, sizeof(ithoDemandFlowSettingsMap) / sizeof(ithoDemandFlowSettingsMap[0]), ihtoDemandFlowSettingsDescriptions, ithoDemandFlowStatusMap, ihtoDemandFlowStatusLabels },
{ 0x0C, "CO2 relay", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x0D, "Heatpump", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x0E, "OLB Single", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x0F, "AutoTemp", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x10, "OLB Double", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x11, "RF+", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x14, "CVE", itho14SettingsMap, sizeof(itho14SettingsMap) / sizeof(itho14SettingsMap[0]), ihtoCVESettingsDescriptions, itho14StatusMap, ihtoCVEStatusLabels },
{ 0x15, "Extended", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x16, "Extended Plus", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x1A, "AreaFlow", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x1B, "CVE-Silent", itho1BSettingsMap, sizeof(itho1BSettingsMap) / sizeof(itho1BSettingsMap[0]), ihtoCVESettingsDescriptions, itho1BStatusMap, ihtoCVEStatusLabels },
{ 0x1C, "CVE-SilentExt", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x1D, "CVE-SilentExtPlus", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x20, "RF_CO2", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x2B, "HRU 350", ithoHRU350SettingsMap, sizeof(ithoHRU350SettingsMap) / sizeof(ithoHRU350SettingsMap[0]), ihtoHRU350SettingsDescriptions, ithoHRU350StatusMap, ihtoHRU350StatusLabels }
};

All the other code should just wrap around it and work

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

Ok, new attempt of squashing:

https://github.com/jasperslits/ithowifi/blob/master/wpu.h

The Itho database is a bit weird: it has multiple versions pointing to the same datalabels. But it also has multiple versions with identical number of fields as others. Both are addressed.

Before spending time on the label translation, I'd like to get this tested first as part of an MVP / agile / whatever approach, just to see if the basics works.
I can send a PR for it, but not sure if you want to have it as wpu.h (as-is for readability / testing) or merged with IthoSystemConstant.h and to see if it's a good enough shape?

Unit test shows this since I don't have an Arduino IDE and just plain GNU G++ compiler:
me@playground:~/code$ g++ test.cpp

In file included from test.cpp:2:
wpu.h:41:7: error: ‘__FlashStringHelper’ does not name a type
   41 | const __FlashStringHelper *ithoWPUStatusLabels[] =  {
      |       ^~~~~~~~~~~~~~~~~~~
wpu.h:179:7: error: ‘__FlashStringHelper’ does not name a type
  179 | const __FlashStringHelper *ithoWPUSettingDescriptions[] = { 

me@playground:~/code$ cat test.cpp

#include <cstdint>
#include "wpu.h"

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

PR #50 is created for this

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

nrgitho-noncve-v2.3-beta4-wputest.bin.zip
Here's a compiled version, copied the code almost 1-on-1, only difference is that I use value 255 as a poor mans end indicator for the array so I've added these as last value in the array.

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Looking at this again, it seems that both the settings labels and the status labels are both status labels. It seems that the parameters are missing

basically, only test the status page, not the settings page cause changing settings will lead to undefined behaviour

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

Nice!

For pameters I have to see to translate it. There's another table called 'parameterlijst_v37' which has entries like:

sqlite> select * from parameterlijst_v37 where name = 'CO control enabled';
id|name|name_factory|min|max|def|title|description|unit
6.94683340033475e-310|CO control enabled|CO control enabled|2.12199579096527e-314|2.65249473870659e-314|2.12199579096527e-314|CO-klep regeling||

So you need just the 'name' field and not the min/max values? Or is that stored somewhere too?

It's connected now and returns 80 82 90 E0 01 07 00 01 00 0D 45 22 00 11 as device type.

Query status returns:

Result: 80 82 A4 01 01 D4 F4 48 0A A6 11 F0 07 EE 08 92 08 B2 08 B6 08 03 07 76 08 46 08 61 00 AA 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 32 00 00 00 01 00 00 00 07 CA 07 08 00 01 FF 00 07 BC 09 2B 07 BC 09 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 F4 09 00 5A 94 91 19 2D 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 05 00 00 04 26 00 00 00 C5 00 00 00 56 00 01 25 1C 00 06 63 00 00 32 00 F5 10 00 96 00 03 89 00 00 00 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 61

Status returns this but I don't know where temp, hum and ppmw are coming from as it's not applicable?:
Some values are returned as 0 which is weird.

Can I see which version is used? Maybe there's something odd with the mapping.

Label Value
temp 0
hum 0
ppmw 0
buitentemp 0
boilertemp onder 0
boilertemp boven 0
verdamper temp 0
zuiggas temp 0
persgas temp 1
vloeistof temp 0
temp naar bron 0
temp uit bron 0
CV aanvoertemp 0
CV retourtemp 5
CV-druk 1062
stroom compressor 197
stroom e-element 86
drukschakelaar 0
tarief 1
condens beveiliging 95
spare ingang 0
vrijkoelklep 0
CV/DHW of koeltemp klep 9.05
compressor 0
element 0
trickle heating 0
fout 0
vrijkoelen 255
expansieventiel 0
kamertemp 0
gevr kamertemp 0
warmtevraag thermost. 0
status 0
sub_status 0
blokkade 0
berekende verdampings temp CV 1
berekende condensatie temp CV 0
berekende verdampings temp DHW 0
berekende condensatie temp DHW 0
fout_gevonden 0
fout_retry 0
taak actief 0
handbediening 0
compr blok 19.8
Elek blok 23.47
Correctie meting delta brontemperatuur 1635
vertraging cv start 1
vertraging cv stop 0
adaptief timer 0
adaptief oververhitting 0
adaptief fifo index 0
fout hoogste prioriteit 0
blokkeertijd vrijgave extern koelen 0
flowsensor 0
fase detectie 50
cv pomp 0
bron pomp 627.36
boiler pomp 150

Edit: looks like some values shifted. "stroom compressor" is measured in amps and a more realistic value is 5. So it looks like it's shifted a bit.

I am working on a new version of the labels and include the unit type (bar, degrees celcius, kWh etc) for the status so it's easier to validate. Mind sharing your new .h file so I can use it as a reference?

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

the first three are always added in the current situation.

It's connected now and returns 80 82 90 E0 01 07 00 01 00 0D 45 22 00 11 as device type.

0D 45 22
0D = device type
22 = version (34 decimal)

Latest commit contains the info you provided, don't bother translation, let's first get the code ok, I'll translate it later again

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

the first three are always added in the current situation.

It's connected now and returns 80 82 90 E0 01 07 00 01 00 0D 45 22 00 11 as device type.

0D 45 22 0D = device type 22 = version (34 decimal)

Latest commit contains the info you provided, don't bother translation, let's first get the code ok, I'll translate it later again

Great!
So the first 3 being added displayed doesn't cause the apparent down shift?

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

No, it just this piece of code:

root["temp"] = ithoTemp;
root["hum"] = ithoHum;
auto b = 611.21 * pow(2.7183, ((18.678 - ithoTemp / 234.5) * ithoTemp) / (257.14 + ithoTemp));
auto ppmw = b / (101325 - b) * ithoHum / 100 * 0.62145 * 1000000;
root["ppmw"] = ppmw;

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Here the status message format command result is being parsed to determine the data length / type of the status message into a vector :

for (uint8_t i = 0; i < i2cbuf[5]; i++) {
ithoStatus.push_back(ithoDeviceStatus());
char fStringBuf[32];
getSatusLabel(i, ithoDeviceptr, itho_fwversion, fStringBuf);
ithoStatus.back().name.assign(fStringBuf);
ithoStatus.back().divider = 0;
if ((i2cbuf[6 + i] & 0x07) == 0) { //integer value
if ((i2cbuf[6 + i] & 0x80) == 0) { //unsigned value
ithoStatus.back().type = ithoDeviceStatus::is_uint;
}
else {
ithoStatus.back().type = ithoDeviceStatus::is_int;
}
}
else {
ithoStatus.back().type = ithoDeviceStatus::is_float;
ithoStatus.back().divider = quick_pow10((i2cbuf[6 + i] & 0x07));
}
if (((i2cbuf[6 + i] >> 3) & 0x07) == 0) {
ithoStatus.back().length = 1;
}
else {
ithoStatus.back().length = (i2cbuf[6 + i] >> 3) & 0x07;
}
//special cases
if (i2cbuf[6 + i] == 0x0C || i2cbuf[6 + i] == 0x6C) {
ithoStatus.back().type = ithoDeviceStatus::is_byte;
ithoStatus.back().length = 1;
}
if (i2cbuf[6 + i] == 0x0F) {
ithoStatus.back().type = ithoDeviceStatus::is_float;
ithoStatus.back().length = 1;
ithoStatus.back().divider = 2;
}
if (i2cbuf[6 + i] == 0x5B) {
ithoStatus.back().type = ithoDeviceStatus::is_uint;
ithoStatus.back().length = 2;
}
}

And with that info the status message itself is parsed and added to the vector created earlier:

if (!ithoStatus.empty()) {
for (auto& ithoStat : ithoStatus) {
//for (auto& ithoStat : ithoStatus) {
auto tempVal = 0;
for (int i = ithoStat.length; i > 0; i--) {
tempVal |= i2cbuf[statusPos + (ithoStat.length - i)] << ((i - 1) * 8);
}
if (ithoStat.type == ithoDeviceStatus::is_byte) {
ithoStat.value.byteval = (byte)tempVal;
}
if (ithoStat.type == ithoDeviceStatus::is_uint) {
ithoStat.value.uintval = tempVal;
}
if (ithoStat.type == ithoDeviceStatus::is_int) {
if (ithoStat.length == 4) {
tempVal = (int32_t)tempVal;
}
if (ithoStat.length == 2) {
tempVal = (int16_t)tempVal;
}
if (ithoStat.length == 1) {
tempVal = (int8_t)tempVal;
}
ithoStat.value.intval = tempVal;
}
if (ithoStat.type == ithoDeviceStatus::is_float) {
ithoStat.value.floatval = (float)tempVal / ithoStat.divider;
}

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

So if the labels are not correct / or shifted, either te mapping is faulty or some cases are not handled correctly in the parsing of the status format

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

Ok, I am struggling a bit with debugging to see where it's coming from.

The debug page is empty and download the log (/curlog) gives a 404.
So I cannot tell if that's related as /curlog is defined:
server.on("/curlog", HTTP_GET, handleCurLogDownload);

Also the list of files is still empty when using /edit so could it be solved by a filesystem format?
It was working OK before.

I also noticed this, not sure if it's telling anything:

  1. ithoWPUStatusLabels has as 20th (starting at 1) element: F("flow sensor")

However under Status I see this: "flowsensor"

So the labels there are not defined in https://github.com/arjenhiemstra/ithowifi/blob/master/software/NRG_itho_wifi/IthoSystemConsts.h

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

sorry, that has probably to do with the fact that I quickly added the translation yesterday but after the compilation.
Here is the compiled version of the exact same code as is now on github.
NRG_itho_wifi.ino.esp32.bin.zip

Also the list of files is still empty when using /edit so could it be solved by a filesystem format?

I did a format indeed and that solved it for me

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

I just realized now it's in English :)
The data is now much better it seems but seems not 100% correct.

Label Value
temp 0
hum 0
ppmw 0
AirQuality (%) out of range low
AirQbased on 72
CO2level (ppm) 1250
Indoorhumidity (%) 5
Outdoorhumidity (%) 50
Exhausttemp (°C) 11.47
SupplyTemp (°C) 19.97
IndoorTemp (°C) 26.9
OutdoorTemp (°C) 22.3
SpeedCap 1124
BypassPos (%) 3
FanInfo unknown
ExhFanSpeed (%) 4
InFanSpeed (%) 31
RemainingTime (min) 2048
PostHeat (%) 0
PreHeat (%) 86
InFlow (l sec) 0
ExhFlow (l sec) 0
outdoor temp 0
boiler temp below 0
boiler temp up 0
evaporator temp 0
suction gas temp 0
compressed gas temp 1
liquid temp 0
temp to source 0
temp from source 0
CV supply temp 0
CV return temp 5
CV pressure 1069
flow compressor 197
flow e-element 86
pressure switch 0
rate 1
condensation protection 100
spare input 0
free cooling valve 0
CV/DHW or cooling temp valve 6.85
compressor 0
element 0
trickle heating 0
fault 0
free cooling 0
expansion valve 0
room temp 0
gevr room temp 0
heat demand thermost. 0
status 0
sub_status 0
blockage 0
calculated evaporation temp CV 21.06
calculated condensation temp CV 18
calculated evaporation temp DHW 0
calculated condensation temp DHW 1
error_found 255
error_retry 0
task active 11.25
manual operation 23.42
compr block 11.25
Elek block 23.42
correction measurement delta source temperature 1635
delay cv start 1
delay cv stop 0
adaptive timer 0
adaptive overheat 0
adaptive fifo index 0
error highest priority 0
Remaining_override_timer 0
flow sensor 0
phase detection 50
cv pump 0
source pump 627.36
boiler pump 150

I managed to hack the python script itho-wpu.py from Pommi and feed it with the "Query Status Format" and "Query Format" results (turning it into a hex array did the job) so it's not relying on I2C but even there the output seems not 100% reliable as -30.0 is just wrong:

Unknown data type for label In_P_switch: 0x0C
Buitentemp (°C) (t_out): -30.0
Boilertemp Onder (°C) (t_boildwn): 12.5
Boilertemp Boven (°C) (t_boiltop): 13.67
Verdamper Temp (°C) (t_evap): 11.29
Zuiggas Temp (°C) (t_suct): 19.97
Persgas Temp (°C) (t_disc): 27.07
Vloeistof Temp (°C) (t_cond): 22.3
Temp Naar Bron (°C) (t_source_r): 10.83
Temp Uit Bron (°C) (t_source_s): 18.18
Cv Aanvoertemp (°C) (t_ch_supp): 23.75
Cv Retourtemp (°C) (t_ch_ret): 20.3
Cv-Druk (Bar) (p_sens): 1.73
Stroom Compressor (A) (i_tr1): 0.0
Stroom E-Element (A) (i_tr2): 0.0
Drukschakelaar (in_p_switch): 0

Now "Boilertemp Onder" is reported at 12.5 for the Python script which makes sense.
In add-on it's returning "boiler temp below" with 0.

"CV Pressure" is reported as 1069 but I dont see anywhere the 1.73 Bar returned in the Itho Status, so even if the label was wrong. I guess it should show up?

Edit 2: it seems that the values with type 0x92 are not showing. Could that provide a clue?

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

The status labels are somehow not mapped correctly, left is what you have posted here, right is what should be the list if you have version 34.

ie. right your kamertemp is 21.06, sounds ok. same for the "berekende verdampings temp CV" values etc.

So it seems the status format is parsed ok (at least partly), but the status labels are not mapped correctly

outdoor temp 0   0 buitentemp
boiler temp below 0   1 boilertemp onder
boiler temp up 0   2 boilertemp boven
evaporator temp 0   3 verdamper temp
suction gas temp 0   4 zuiggas temp
compressed gas temp 1   5 persgas temp
liquid temp 0   6 vloeistof temp
temp to source 0   7 temp naar bron
temp from source 0   8 temp uit bron
CV supply temp 0   9 CV aanvoertemp
CV return temp 5   10 CV retourtemp
CV pressure 1069   11 CV-druk
flow compressor 197   12 stroom compressor
flow e-element 86   13 stroom e-element
pressure switch 0   14 drukschakelaar
rate 1   15 tarief
condensation protection 100   16 condens beveiliging
spare input 0   17 spare ingang
free cooling valve 0   18 Reserve
CV/DHW or cooling temp valve 6.85   19 flowsensor
compressor 0   20 fase detectie
element 0   21 cv pomp
trickle heating 0   22 bron pomp
fault 0   23 boiler pomp
free cooling 0   24 vrijkoelklep
expansion valve 0   25 CV/DHW of koeltemp klep
room temp 0   26 compressor
gevr room temp 0   27 element
heat demand thermost. 0   28 trickle heating
status 0   29 fout
sub_status 0   30 vrijkoelen
blockage 0   31 expansieventiel
calculated evaporation temp CV 21.06   32 kamertemp
calculated condensation temp CV 18   33 gevr kamertemp
calculated evaporation temp DHW 0   34 warmtevraag thermost.
calculated condensation temp DHW 1   35 status
error_found 255   36 sub_status
error_retry 0   37 blokkade
task active 11.25   38 berekende verdampings temp CV
manual operation 23.42   39 berekende condensatie temp CV
compr block 11.25   40 berekende verdampings temp DHW
Elek block 23.42   41 berekende condensatie temp DHW
correction measurement delta source temperature 1635   42 fout_gevonden
delay cv start 1   43 fout_retry
delay cv stop 0   44 taak actief
adaptive timer 0   45 handbediening
adaptive overheat 0   46 compr blok
adaptive fifo index 0   47 Elek blok
error highest priority 0   48 cv voor / nadraai
Remaining_override_timer 0   49 bron voor / nadraai
flow sensor 0   50 boiler voor / nadraai
phase detection 50   51 delay elektr
cv pump 0   52 min draaitijd compr
source pump 627.36   53 afpomp tijd
boiler pump 150   54 EV drukvereffenen
      55 EV verstellen
      56 vrijkoel interval
      57 handbediening
      58 lage druk timer
      59 compressor start
      60 compr power on delay
      61 vertraging cv start
      62 vertraging cv stop
      63 adaptief timer
      64 adaptief oververhitting
      65 adaptief fifo index
      66 fout hoogste prioriteit
      67 UTC tijd
      68 Max cv retour temp
      69 bronpomp snelheid vrijkoel mode
      70 compressor in Cv mode
      71 compressor in boiler mode
      72 element in cv mode
      73 element in boiler mode
      74 CV mode geblokkeerd
      75 boiler mode geblokkeerd
      76 vrijkoel mode geblokkeerd
      77 ontlucht mode geblokkeerd
      78 elektr element geblokkeerd
      79 elektr element DHW geblokkeerd
      80 compressor geblokkeerd
      81 off mode actief
      82 CV mode actief
      83 boiler mode actief
      84 vrijkoel mode actief
      85 CV pomp voordraaien
      86 bron pomp voordraaien
      87 element vrijgegeven
      88 vrijgave extra koelen
      89 CV vrijgegeven
      90 vrijkoel vrijgegeven
      91 tarief laag vanuit thermostaat
      92 ontluchten vanuit thermostaat
      93 ECO geselecteerd op thermostaat
      94 comfort geselecteerd op thermostaat
      95 boiler blokkade vanuit thermostaat
      96 boiler boost vanuit thermostaat
      97 warmtevraag totaal
      98 E-verbuik tijdens stand-by
      99 E-verbuik tijdens verwarmen
      100 E-verbuik tijdens DHW
      101 E-verbuik tijdens koelen
      102 voorverwarmen tapwater
      103 element geblokkeerd tijdens retry
      104 Pi fout bronflow
      105 actuele bronklepstand
      106 utc Tijd offset
      107 vrijkoel blokkade tijd
      108 koeltemp regelklep setpoint
      109 CO-klep positie
      110 HRU uitblaas temp
      111 HRU uitblaas flow
      112 regeneratie actief
      113 laatst geldige brontoevoer temp.
      114 bronpomp flow setpoint
      115 bronpomp snelheid bij Compr
      116 bronpomp snelheid bij vrijkoel
      117 bronpomp snelheid bij luchtreg
      118 vrijkoelmodus
      119 tijd CO-klep start positie
      120 minimale vrijgave tijd extern koelen
      121 blokkeertijd vrijgave extern koelen
      122 blokkeertijd vrijgave extern verwarmen
      123 blokkeertijd trickle low na power-up
      124 blokkeertijd trickle low na CV-bedrijf
      125 blokkeertijd voorverwarmen tapwater
      126 UTC tijd :
      127 slow start bronpomp
      128 Bron retourtemperatuur te laag
      129 Regelperiode bronflow
      130 Stabilisatie wachttijd vrijkoelen
      131 Minimale tijd voorverwarmen tapwater
      132 Maximale tijd voorverwarmen tapwater
      133 Vrijgave elektrisch element

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

The 0x92 is also part of the normal CVE status format and there it is parsed correctly. I would expect the same to happen here but there might be another reason.
Could you post the status format result as well?

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

So I guess there are two problems:

  1. Labels in wrong order
  2. Missing values (e.g. reported as 0 by the add-on

Status format: 80 82 A4 00 01 86 92 92 92 92 92 92 92 92 92 92 92 92 92 92 0C 0C 0C 0C 00 10 0C 00 00 00 00 00 0C 0C 0C 0C 0C 10 92 92 00 00 00 00 92 92 92 92 00 00 10 0C 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 00 00 20 00 00 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 00 20 20 20 20 0C 00 92 00 90 10 00 00 92 10 00 92 10 00 00 00 00 10 10 10 10 10 10 10 00 10 10 10 10 10 10 10 3F

Status: 80 82 A4 01 01 D4 F4 48 16 86 16 94 08 13 09 BB 0A 53 09 EF 08 59 09 68 09 CB 09 C5 00 A9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 32 00 00 00 01 00 00 00 07 D9 07 08 00 01 FF 00 07 E1 0A 7B 07 E1 0A 7B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 F4 1F 00 72 67 5B 97 2D 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 06 00 00 04 2D 00 00 00 C7 00 00 00 56 00 01 27 10 00 FF F1 00 00 32 00 F5 10 00 96 00 03 58 00 00 00 00 00 FF 00 00 00 00 00 00 00 00 00 00 02 6B 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 64

Not sure if this helps. It's the output from the Python tool using the above. (-30.0 is apparently the 'right' value upon checking). The labels are displayed in the right order :

Data type Label Value
0x92 Buitentemp (°C) (t_out) -30.0
0x92 Boilertemp Onder (°C) (t_boildwn) 12.63
0x92 Boilertemp Boven (°C) (t_boiltop) 14.25
0x92 Verdamper Temp (°C) (t_evap) 13.52
0x92 Zuiggas Temp (°C) (t_suct) 19.88
0x92 Persgas Temp (°C) (t_disc) 24.91
0x92 Vloeistof Temp (°C) (t_cond) 22.0
0x92 Temp Naar Bron (°C) (t_source_r) 13.51
0x92 Temp Uit Bron (°C) (t_source_s) 19.02
0x92 Cv Aanvoertemp (°C) (t_ch_supp) 22.69
0x92 Cv Retourtemp (°C) (t_ch_ret) 21.54
0x92 Cv-Druk (Bar) (p_sens) 1.71
0x92 Stroom Compressor (A) (i_tr1) 0.0
0x92 Stroom E-Element (A) (i_tr2) 0.0
0xc Drukschakelaar (in_p_switch) 0
0xc Tarief (in_hl) 0
0xc Condens Beveiliging (in_cond) 0
0xc Spare Ingang (sparein) 0
0x0 Reserve (reserve) 0
0x10 Flowsensor (lt/hr) (in_flow) 0
0xc Fase Detectie (in_phase) 0
0x0 Cv Pomp (%) (out_ch) 0
0x0 Bron Pomp (%) (out_src) 0
0x0 Boiler Pomp (%) (out_dhw) 0
0x0 Vrijkoelklep (%) (out_fc_valve) 50
0x0 Cv/Dhw Of Koeltemp Klep (%) (out_ch_valve) 50
0xc Compressor (out_c1) 0
0xc Element (out_ele) 0
0xc Trickle Heating (out_trickle) 0
0xc Fout (out_fault) 1
0xc Vrijkoelen (out_fc) 0
0x10 Expansieventiel (pls) (out_ev) 0
0x92 Kamertemp (°C) (ot_room) 21.02
0x92 Gevr Kamertemp (°C sp) (ot_setp) 18.0
0x0 Warmtevraag Thermost. (%) (ot_mod) 0
0x0 Status (state) 1
0x0 Sub_Status (sub_state) 255
0x0 Blokkade (ot_vrij) 0
0x92 Berekende Verdampings Temp Cv (°C) (c_sh_evap) 13.02
0x92 Berekende Condensatie Temp Cv (°C) (c_sh_con) 23.15
0x92 Berekende Verdampings Temp Dhw (°C) (c_sh_evap_dhw) 13.02
0x92 Berekende Condensatie Temp Dhw (°C) (c_sh_con_dhw) 23.15
0x0 Fout_Gevonden (fault_reported) 0
0x0 Fout_Retry (fault_retrying) 0
0x10 Taak Actief (task_active) 0
0xc Handbediening (c_hand) 0
0x10 Compr Blok (sec) (tr_compr) 0
0x10 Elek Blok (sec) (tr_eblock) 0
0x10 Cv Voor / Nadraai (sec) (tr_cv) 0
0x10 Bron Voor / Nadraai (sec) (tr_src) 0
0x10 Boiler Voor / Nadraai (sec) (tr_dhw) 0
0x10 Delay Elektr (sec) (tr_elek) 0
0x10 Min Draaitijd Compr (sec) (tr_mincompr) 0
0x10 Afpomp Tijd (sec) (tr_press) 0
0x10 Ev Drukvereffenen (sec) (tr_ev_bal) 0
0x10 Ev Verstellen (sec) (tr_ev_verstel) 0
0x10 Vrijkoel Interval (sec) (tr_fc) 0
0x10 Handbediening (sec) (tr_hand) 0
0x10 Lage Druk Timer (sec) (tr_ld) 0
0x10 Compressor Start (sec) (tr_strtcompr) 0
0x10 Compr Power On Delay (sec) (compr_powondelay) 0
0x10 Vertraging Cv Start (sec) (delaybefstartch) 2154
0x10 Vertraging Cv Stop (sec) (delaybefstopch) 0
0x10 Adaptief Timer (sec) (tr_adaptief) 0
0x12 Adaptief Oververhitting (K) (t_adoverheating) 258.44
0x0 Adaptief Fifo Index (adfifoindex) 29
0x0 Fout Hoogste Prioriteit (hipriorfault) 0
0x20 Utc Tijd (utc_time) 1519732976
0x0 Max Cv Retour Temp (°C) (maxcvtemp) 45
0x0 Bronpomp Snelheid Vrijkoel Mode (bronpompspeed) 0
0xc Compressor In Cv Mode (comprch) 0
0xc Compressor In Boiler Mode (comprdhw) 0
0xc Element In Cv Mode (elemch) 0
0xc Element In Boiler Mode (elemdhw) 0
0xc Cv Mode Geblokkeerd (chmodeblocked) 0
0xc Boiler Mode Geblokkeerd (dhwmodeblocked) 0
0xc Vrijkoel Mode Geblokkeerd (fcmodeblocked) 0
0xc Ontlucht Mode Geblokkeerd (ventmodeblocked) 0
0xc Elektr Element Geblokkeerd (elblocked) 0
0xc Elektr Element Dhw Geblokkeerd (eldhwblocked) 0
0xc Compressor Geblokkeerd (comprblocked) 0
0xc Off Mode Actief (offmode) 1
0xc Cv Mode Actief (chmode) 0
0xc Boiler Mode Actief (dhwmode) 0
0xc Vrijkoel Mode Actief (fcmode) 0
0xc Cv Pomp Voordraaien (chpmpprerun) 0
0xc Bron Pomp Voordraaien (srcpmpprerun) 0
0xc Element Vrijgegeven (elreluser) 0
0xc Vrijgave Extra Koelen (fclowrel) 0
0xc Cv Vrijgegeven (chrel) 0
0xc Vrijkoel Vrijgegeven (fcrel) 0
0xc Tarief Laag Vanuit Thermostaat (lttherm) 0
0xc Ontluchten Vanuit Thermostaat (venttherm) 0
0xc Eco Geselecteerd Op Thermostaat (ecotherm) 1
0xc Comfort Geselecteerd Op Thermostaat (comftherm) 0
0xc Boiler Blokkade Vanuit Thermostaat (dhwthermblocked) 0
0xc Boiler Boost Vanuit Thermostaat (dhwthermboost) 0
0x0 Warmtevraag Totaal (%) (maxrmod) 0
0x20 E-Verbuik Tijdens Stand-By (kWh) (kwhstandby) 5
0x20 E-Verbuik Tijdens Verwarmen (kWh) (kwhch) 1069
0x20 E-Verbuik Tijdens Dhw (kWh) (kwhdhw) 197
0x20 E-Verbuik Tijdens Koelen (kWh) (kwhcooling) 86
0xc Voorverwarmen Tapwater (dlpreheatdhwmodeactive) 0
0x0 Element Geblokkeerd Tijdens Retry (elementalleenvoordhw) 1
0x92 Pi Fout Bronflow (pibron) 100.0
0x0 Actuele Bronklepstand (%) (kleppos) 0
0x90 Utc Tijd Offset (min.) (utcoffset) 1635
0x10 Vrijkoel Blokkade Tijd (min.) (tr_fc_block) 0
0x0 Koeltemp Regelklep Setpoint (%) (fctcontrolperc) 50
0x0 Co-Klep Positie (%) (airregvalvepos) 0
0x92 Hru Uitblaas Temp (°C) (hruexhtemp) -28.0
0x10 Hru Uitblaas Flow (m3/h) (hruexhflow) 150
0x0 Regeneratie Actief (airregactive) 0
0x92 Laatst Geldige Brontoevoer Temp. (°C) (lstvalidsrcsuptmp) 6.85
0x10 Bronpomp Flow Setpoint (l/h) (srcpumpflowsetp) 0
0x0 Bronpomp Snelheid Bij Compr (%) (srcpumpspeedcompressor) 0
0x0 Bronpomp Snelheid Bij Vrijkoel (%) (srcpumpspeedfccontrol) 0
0x0 Bronpomp Snelheid Bij Luchtreg (%) (srcpumpspeedaircontrol) 0
0x0 Vrijkoelmodus (actfcsubstate) 255
0x10 Tijd Co-Klep Start Positie (sec) (co_valve_position) 0
0x10 Minimale Vrijgave Tijd Extern Koelen (sec.) (minruntimeexterncooltimer) 0
0x10 Blokkeertijd Vrijgave Extern Koelen (sec.) (externcoolingblockingtimer) 0
0x10 Blokkeertijd Vrijgave Extern Verwarmen (sec.) (externheatingblockingtimer) 0
0x10 Blokkeertijd Trickle Low Na Power-Up (sec.) (tmtrickleheatinglowblocking) 0
0x10 Blokkeertijd Trickle Low Na Cv-Bedrijf (sec.) (tmchmodeblocking) 1296
0x10 Blokkeertijd Voorverwarmen Tapwater (sec.) (tmpreheatdhwblock) 0
0x0 Utc Tijd : (utctimevalid) 1
0x10 Slow Start Bronpomp (sec.) (srcpumprampuptimer) 0
0x10 Bron Retourtemperatuur Te Laag (sec.) (sourcereturntemptoolow) 0
0x10 Regelperiode Bronflow (sec.) (srcpumpreturncontroltimer) 0
0x10 Stabilisatie Wachttijd Vrijkoelen (sec.) (freecoolingstabilizetimer) 0
0x10 Minimale Tijd Voorverwarmen Tapwater (sec) (preheatdhwminontimer) 0
0x10 Maximale Tijd Voorverwarmen Tapwater (sec.) (preheatdhwmaxontimer) 0
0x10 Vrijgave Elektrisch Element (min) (remainingtimeeelementreleased) 0

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Thanks for the info! I cannot explain why the first values are not parsed correctly but it seems it must be a bug somewhere. I'll draft some tests and dig into it somewhere this weekend probably.

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

Thanks for the effort so far and happy to help with testing.

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

const uint8_t *ithoWPUSstatusMap[] = { nullptr, itho_WPUstatus2, itho_WPUstatus4, itho_WPUstatus5, itho_WPUstatus6, itho_WPUstatus7, itho_WPUstatus8_9, itho_WPUstatus8_9, itho_WPUstatus10, itho_WPUstatus11_17, itho_WPUstatus11_17, itho_WPUstatus11_17, itho_WPUstatus11_17, itho_WPUstatus11_17, itho_WPUstatus11_17, itho_WPUstatus18_19, itho_WPUstatus18_19, itho_WPUstatus20, itho_WPUstatus21, itho_WPUstatus22_25, itho_WPUstatus22_25, itho_WPUstatus22_25, itho_WPUstatus22_25, itho_WPUstatus27, itho_WPUstatus31, itho_WPUstatus33, itho_WPUstatus34_37, itho_WPUstatus34_37,};

This explains the status mapping issue, there are less than 37 versions mapped (I see only 28) This means that version 34 will be out of bound.

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

That's because there are fewer than 37 versions in the Itho database:

sqlite> select count(*) from versiebeheer;
27
sqlite> select count(distinct(datalabel)) from versiebeheer;
20

So if you are at version 34, you still need the array to have 35 (nullptr + 34) elements?

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

Ah, that explains! The array index = itho

does it make sense to get a new bin file with the amended array or do you want to do debugging first?

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

It probably does. In the current bin array position 34 does not exist but the code will happily return a memory address, which apparently (at least partly points) to readable strings but probably also points to junk. It is due to the resilience of the ArduinoJSON lib that this doesn't crash the program but it could definitely be the cause of the 0x92 glitches as well.

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Digging through my own code, now I'm pretty sure it could be the source of the issue. Here the status label gets added to the vector:

getSatusLabel(i, ithoDeviceptr, itho_fwversion, fStringBuf);

What happens if junk gets fed? Probably exactly what we see...
I thought I'd built in protection for versions > supported (because itho always can start selling a newer version of their device) but clearly not.

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

Thanks for digging into this. And good to keep in mind when adding AutoTemp and WPU settings support. 😉

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

NRG_itho_wifi.ino.esp32.bin.zip
Ok, home again, quick copy paste of the array and a blind compile. Maybe you could test this and see if there are differences

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

Looks much better and values / descriptions seem to match upon first glance, will do a better comparison later on.

One observation: outdoor temp is apparently -30 but shown here as 625.36
Well both are logically wrong, the -30 is also what the Python tool shows so that's I expect here as well. Its data type is 0x92

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Great! Thanks for testing!

F448 is actually an error code:

{0XF4, "out of range low"},

But nonetheless, it is handled als unsigned float incorrectly

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Thanks, I was trying to load the data via MQTT in Home Assistant but it seems there's another fix needed?

This is not relevant anymore?

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Everything else looks good OK now. Havent seen anything that looks completely off.

Some suggestions for next versions:

  1. Add unit type (I can read it from Itho dbase and add it to the label) as otherwise it's difficult to interpret the values

Yes that would be great, the reason I did not include this (yet) is that it creates another layer of values and complexity. We then would have to register for every value the unit (or error code). In an DB this is easy, but the structure I chose (because of missing DB solution for arduino) is somewhat limited on this extend. Trade off between functionality and memory usage. But probably a lot more is possible but I lack the experience to know and use a different approach to be honest.

  1. Selection of fields for MQTT?
    I guess out of all status values available, not everything is interesting for a HA system. MQTT supports the large message size all together and filtering can be done on receiving end, but sending a select number of fields feels cleaner.

Yes that is sure possible and I thought about this as well. This would put the burden on a relatively small and limited system, whereas the receiving system could quite easily parse the received info. For now I (hopefully) made the buffer large enough to accommodate all the values and there is still headroom to extend on the ESP32 platform if needed.

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

Everything else looks good OK now. Havent seen anything that looks completely off.
Some suggestions for next versions:

  1. Add unit type (I can read it from Itho dbase and add it to the label) as otherwise it's difficult to interpret the values

Yes that would be great, the reason I did not include this (yet) is that it creates another layer of values and complexity.

Clear. So shall I just send a patch which adds the unit types to the labels? E.g. description (unit type).

I looked at the code to understand the parameter / setting processing. But while in the Itho database I see the min and max values, it looks like you read it from the device output itself?
not much of a c++ coder myself, just seeing what needs to be provided to get the settings to show up.

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Clear. So shall I just send a patch which adds the unit types to the labels? E.g. description (unit type).

Ah, I misunderstood it. Adding it to the label itself is off-course easy and can be done without adding complexity.

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

My original idea was to have unit type separated from the description but after reading your comments on complexity, updating the description seems the easier way to go.

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

I've created #51 PR for the updated labels.

from ithowifi.

JoostBaltissen avatar JoostBaltissen commented on August 15, 2024

Hi, after following this issue closely I just have my WPU connected and I noticed the following:
Outdoor temp and Boiler temp below are showing 0 in status, while the Query status results returns actually plausible values.
80 82 A4 01 01 AA 04 4C 12 65 15 21 0A 20 0A 41 0B 8A 0A 7D 09 E9 0A 81 0B 1B 0A 00 00 76 00.....'
Outdoor temp: 11
Boiler temp below: 47.09

from ithowifi.

JoostBaltissen avatar JoostBaltissen commented on August 15, 2024

I might have found something.
My device returns device type 26, which is version 38 in decimal.
If I understand right that version isn't supported yet.

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

The versions are taken from the official Itho database hosted on Azure. So it should be up to date. It currently lists 37 as max.

Do you have a WPu 5g as well?

from ithowifi.

JoostBaltissen avatar JoostBaltissen commented on August 15, 2024

No a 4th generation. WPU-55I

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

That's interesting, I used the steps here: https://github.com/pommi/python-itho-wpu/tree/master and it doesn't mention that the HeatPump database is tied to 5th generation devices only.

Do you see correct labels / values for other fields?

I see this:

Itho device type: Heatpump
Itho fw version: 34

But you see this?
Itho device type: 26
Itho fw version: ???

But I think 26 is already in decimals so I guess the hex is 0x1A and it should be added here:

struct ihtoDeviceType ithoDevices[] {
{ 0x01, "Air curtain", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x03, "HRU ECO-fan", ithoHRUecoFanSettingsMap, sizeof(ithoHRUecoFanSettingsMap) / sizeof(ithoHRUecoFanSettingsMap[0]), ihtoHRUecoFanSettingsDescriptions, ithoHRUecoFanStatusMap, ihtoHRUecoFanStatusLabels },
{ 0x08, "LoadBoiler", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x0A, "GGBB", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x0B, "DemandFlow", ithoDemandFlowSettingsMap, sizeof(ithoDemandFlowSettingsMap) / sizeof(ithoDemandFlowSettingsMap[0]), ihtoDemandFlowSettingsDescriptions, ithoDemandFlowStatusMap, ihtoDemandFlowStatusLabels },
{ 0x0C, "CO2 relay", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x0D, "Heatpump", nullptr, 0, nullptr, ithoWPUSstatusMap, ithoWPUStatusLabels },
{ 0x0E, "OLB Single", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x0F, "AutoTemp", nullptr, 0, nullptr, nullptr, nullptr },
{ 0x10, "OLB Double", nullptr, 0, nullptr, nullptr, nullptr },

So perhaps the existing HeatPump entry is for 5th gen (5G) and there's a different identifier for 4G units, being the 0x1A.

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

My device returns device type 26, which is version 38 in decimal.

Where do you see this number? Could you post the output of the "Query Devicetype" command on the debug page?

from ithowifi.

JoostBaltissen avatar JoostBaltissen commented on August 15, 2024

I'm sorry, I should have posted the raw query result right away.
Query DeviceType returns
80 82 90 E0 01 07 00 01 00 0D 26 14 00 3E

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

I'm sorry, I should have posted the raw query result right away. Query DeviceType returns 80 82 90 E0 01 07 00 01 00 0D 26 14 00 3E

Thanks! So that is 0D for device type, which seems to be correctly the Heatpump. And 14 for the version number which translates to 20 in decimal. This version is also present in the code from jasper. Cannot really explain why it should not work.

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

NRG_itho_wifi.ino.esp32.bin.zip

@jasperslits (and @JoostBaltissen), I've compiled the PR you supplied and also included some code to better protect (and give error messages) when a version is not supported or out of band somehow.

from ithowifi.

JoostBaltissen avatar JoostBaltissen commented on August 15, 2024

Nice, this the new output, still some 0's on the begin and weird values at the end. See table below.
I don't see any odd messages in the log right now.

Label Value
temp 0
hum 0
ppmw 0
Outdoor temp (°C) 0
Boiler temp below (°C) 0
Boiler temp up (°C) 50.31
Evaporator temp (°C) 20.22
Suction gas temp (°C) 20.84
Compressed gas temp (°C) 23.92
Liquid temp (°C) 20.49
Temp to source (°C) 21.56
Temp from source (°C) 21.27
CV supply temp (°C) 23.04
CV return temp (°C) 22.95
CV pressure (Bar) 1.18
Flow compressor (A) 0
Flow e-element (A) 0
Pressure switch 0
Tarif high or low 0
Condensation protection 0
Spare input 0
Correction measurement delta source temperature (K) 0
Flow sensor (lt/hr) 0
Phase detection order 0
CV pump (%) 0
Source pump speed (%) 0
Boiler pump speed (%) 0
Free cooling valve (%) 725
CV/DHW or cooling temp valve (%) 725
Compressor 0
Element 0
Trickle heating 0
Fault existing 1
Free cooling 0
Expansion valve position (pls) 0
Room temp (°C) 21.49
Requested room temp (°C sp) 21
Heat demand thermost. (%) 0
Status 1
Sub status CV 255
Blockage 0
Calculated evaporation temp CV (°C) 19.22
Calculated condensation temp CV (°C) 22.52
Calculated evaporation temp DHW (°C) 19.22
Calculated condensation temp DHW (°C) 22.52
Error found 0
Error retry 0
Task active by external control 0
Manual operation 0
Compressor block (sec) 0
Elek block (sec) 0
CV before / after turn (sec) 0
Source before / after turn (sec) 0
Boiler before / after turn (sec) 0
Delay electr (sec) 0
Min run time compr (sec) 0
Pump off time (sec) 0
EV pressure offset (sec) 0
EV adjust (sec) 0
Free cooling interval (sec) 0
Manual control (sec) 0
Low pressure timer (sec) 0
Compressor start (sec) 0
Compr power on delay (sec) 0
Delay CV start (sec) 0
Delay CV stop (sec) 0
Adaptive timer (sec) 0
Adaptive overheat (K) 5
Adaptive fifo index 29
Error highest priority 0
UTC time 1637013719
Max CV return temp (°C) 45
Source pump speed free cooling mode 0
Compressor in CV mode 0
Compressor in boiler mode 0
Element in CV mode 0
Element in boiler mode 0
CV mode blocked 0
Boiler mode blocked 0
Free cooling mode blocked 0
Vented mode blocked 0
Electr element blocked 0
Electr element DHW blocked 0
Compressor blocked 0
Off mode active 1
CV mode active 0
Boiler mode active 0
Free cooling mode active 0
Heat pump prime 0
Source pump prime 0
Element enabled 0
Enable additional cooling 0
Heating enabled 0
Free cooling enabled 0
Tariff low from thermostat 0
Venting from thermostat 0
ECO selected on thermostat 0
Comfort selected from thermostat 1
Boiler block from thermostat 0
Boiler boost from thermostat 0
Heat demand total (%) 0
E-consumption during standby (kWh) 1
E-consumption during heating (kWh) 1
E-consumption during DHW (kWh) 0.44
E-consumption during cooling (kWh) 70.03313
Preheating tap hot water 70.47
Element blocked during retry 0
Pi error source flow 60
Current source valve position (%) 1104
Utc Time offset (min.) 1
Free cooling block time (min.) 23
Cooling temp control valve setpoint (%) 1
CO valve position (%) 59
HRU blowout temp (°C) 0
onStatusHighKitchenBathroom 0.0018


from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024
temp 0
hum 0
ppmw 0

These are correct (manually added)

To check the others I need the status format output and the full status output from the debug page

from ithowifi.

JoostBaltissen avatar JoostBaltissen commented on August 15, 2024

Status format:
Result: 80 82 A4 00 01 6F 92 92 92 92 92 92 92 92 92 92 92 92 92 92 0C 0C 0C 0C 10 10 0C 00 00 00 10 10 0C 0C 0C 0C 0C 10 92 92 00 00 00 00 92 92 92 92 00 00 10 0C 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 00 00 20 00 00 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 00 00 00 A2 A5 92 92 90 10 00 00 00 00 10 ED
Status:
Result: 80 82 A4 01 01 AA 02 58 0F 6B 13 A7 07 EC 08 24 09 58 08 06 08 6C 08 4F 08 F7 08 F7 00 76 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 D5 02 D5 00 00 00 01 00 00 00 08 65 08 34 00 01 FF 00 07 88 08 D2 07 88 08 D2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 F4 1D 00 61 92 D9 C1 2D 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 01 00 00 00 2C 00 6A DC B1 1B 87 00 00 00 3C 04 4C 01 17 05 35 00 00 B6

Log:
5785 N: System boot, last reset reason: POWERON_RESET
5802 N: HW rev: NON-CVE 1, FW ver.: 2.3-beta4
5937 N: wifi config saved
5966 N: Setup: Wifi config load failed
7733 N: wifi AP mode started
7754 N: Setup: AP mode active
7774 N: Setup: Virtual remote ID: 60,175,52
7801 N: Webserver: started
7822 N: mDNS: started
7842 N: Hostname: nrg-itho-af34
7863 N: Setup: done
2157 N: System boot, last reset reason: POWERON_RESET
2175 N: HW rev: NON-CVE 1, FW ver.: 2.3-beta4
2214 N: Setup: Wifi config load failed
3891 N: wifi AP mode started
3911 N: Setup: AP mode active
3929 N: Setup: Virtual remote ID: 60,175,52
3956 N: Webserver: started
3978 N: mDNS: started
4000 N: Hostname: nrg-itho-af34
4020 N: Setup: done
2158 N: System boot, last reset reason: POWERON_RESET
2176 N: HW rev: NON-CVE 1, FW ver.: 2.3-beta4
2214 N: Setup: Wifi config load failed
3892 N: wifi AP mode started
3914 N: Setup: AP mode active
3932 N: Setup: Virtual remote ID: 60,175,52
3958 N: Webserver: started
3980 N: mDNS: started
4001 N: Hostname: nrg-itho-af34
4021 N: Setup: done
222431 N: wifi config saved
238168 N: wifi config saved
259728 N: Reboot requested
2159 N: System boot, last reset reason: SDIO_RESET
2177 N: HW rev: NON-CVE 1, FW ver.: 2.3-beta4
6447 N: WiFi: connection successful
6466 N: WiFi info:
6485 N: Mode:STA
6503 N: Status:3
6522 N: IP:192.168.2.32
6541 N: Setup: Virtual remote ID: 60,175,52
6566 N: Webserver: started
6586 N: mDNS: started
6604 N: Hostname: itho-warmtepomp
6624 N: Setup: done
2021-11-13 21:06:01 N: Firmware update: NRG_itho_wifi.ino.esp32.bin
2021-11-13 21:06:17 N: Reboot requested
2021-11-13 21:06:19 N: System boot, last reset reason: SDIO_RESET
2021-11-13 21:06:19 N: HW rev: NON-CVE 1, FW ver.: 2.3-beta4-wputest
2021-11-13 21:06:23 N: WiFi: connection successful
2021-11-13 21:06:23 N: WiFi info:
2021-11-13 21:06:23 N: Mode:STA
2021-11-13 21:06:23 N: Status:3
2021-11-13 21:06:23 N: IP:192.168.2.32
2021-11-13 21:06:23 N: Setup: Virtual remote ID: 60,175,52
2021-11-13 21:06:23 N: Webserver: started
2021-11-13 21:06:23 N: mDNS: started
2021-11-13 21:06:23 N: Hostname: itho-warmtepomp
2021-11-13 21:06:23 N: Setup: done
2163 N: System boot, last reset reason: POWERON_RESET
2181 N: HW rev: NON-CVE 1, FW ver.: 2.3-beta4-wputest
6556 N: WiFi: connection successful
6574 N: WiFi info:
6592 N: Mode:STA
6610 N: Status:3
6628 N: IP:192.168.2.32
2021-11-13 21:12:09 N: Setup: Virtual remote ID: 60,175,52
2021-11-13 21:12:09 N: MQTT: connected, System config: 1
2021-11-13 21:12:09 N: Webserver: started
2021-11-13 21:12:09 N: mDNS: started
2021-11-13 21:12:09 N: Hostname: itho-warmtepomp
2021-11-13 21:12:09 N: Setup: done
2021-11-13 21:12:17 N: HA DISCOVERY: Start publishing MQTT Home Assistant Discovery...
2021-11-14 03:12:02 N: Mem free: 103744, Mem low: 75944, Mem block: 59320
2021-11-14 03:07:01 N: System boot, last reset reason: OWDT_RESET
2021-11-14 03:07:01 N: HW rev: NON-CVE 1, FW ver.: 2.3-beta4-wputest
2021-11-14 03:07:05 N: WiFi: connection successful
2021-11-14 03:07:05 N: WiFi info:
2021-11-14 03:07:05 N: Mode:STA
2021-11-14 03:07:05 N: Status:3
2021-11-14 03:07:05 N: IP:192.168.2.32
2021-11-14 03:07:05 N: Setup: Virtual remote ID: 60,175,52
2021-11-14 03:22:39 N: MQTT: connected, System config: 1
2021-11-14 03:22:39 N: Webserver: started
2021-11-14 03:22:39 N: mDNS: started
2021-11-14 03:22:39 N: Hostname: itho-warmtepomp
2021-11-14 03:22:39 N: Setup: done
2021-11-14 03:22:48 N: HA DISCOVERY: Start publishing MQTT Home Assistant Discovery...
2021-11-14 09:22:33 N: Mem free: 140736, Mem low: 97944, Mem block: 60544
43200049 N: Mem free: 133944, Mem low: 97944, Mem block: 60544
2021-11-14 20:13:19 N: HA DISCOVERY: Start publishing MQTT Home Assistant Discovery...
2021-11-14 20:33:25 N: HA DISCOVERY: Start publishing MQTT Home Assistant Discovery...
2021-11-14 21:22:33 N: Mem free: 140344, Mem low: 97944, Mem block: 60544
2021-11-15 03:22:33 N: Mem free: 131916, Mem low: 97944, Mem block: 60544
2021-11-15 09:22:33 N: Mem free: 140044, Mem low: 97944, Mem block: 60544
2021-11-15 15:22:34 N: Mem free: 138032, Mem low: 97944, Mem block: 60544
2021-11-15 15:46:19 N: HA DISCOVERY: Start publishing MQTT Home Assistant Discovery...
2021-11-15 21:22:34 N: Mem free: 140280, Mem low: 97936, Mem block: 60544
2021-11-15 21:58:56 N: Firmware update: NRG_itho_wifi.ino.esp32.bin
2021-11-15 21:59:11 N: Reboot requested
2021-11-15 22:00:36 N: System boot, last reset reason: SDIO_RESET
2021-11-15 22:00:36 N: HW rev: NON-CVE 1, FW ver.: 2.3-beta4-wputest
2021-11-15 22:00:41 N: WiFi: connection successful
2021-11-15 22:00:41 N: WiFi info:
2021-11-15 22:00:41 N: Mode:STA
2021-11-15 22:00:41 N: Status:3
2021-11-15 22:00:41 N: IP:192.168.2.32
2021-11-15 22:00:41 N: Setup: Virtual remote ID: 60,175,52
2021-11-15 22:00:41 N: MQTT: connected, System config: 1
2021-11-15 22:00:41 N: Webserver: started
2021-11-15 22:00:41 N: mDNS: started
2021-11-15 22:00:41 N: Hostname: itho-warmtepomp
2021-11-15 22:00:41 N: Setup: done
2021-11-15 21:59:28 N: HA DISCOVERY: Start publishing MQTT Home Assistant Discovery...

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

if I compare your version 20 mapping with de database jaspers' mentioning some labels are off and the length is not the same. So maybe there is an issue with the script of Jasper? @jasperslits could you maybe share the script?

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

I am a lazy coder so it's an ugly PHP script.

But Itho has per version a table, so for version 20 there are 111 elements where as version 34 (mine) has 123 labels. I assumed that the 111 elements of version 20 overlap with the first 111 of version 34.

But when I use the Python script of Pommi with the provided status format and status, it yields two errors but I guess these data types are handled in the C++ code already:
Unknown data type for label Pbron: 0xA2
Unknown data type for label Ibron: 0xA5

Data type Label value
0x92 Buitentemp (°C) (t_out) 6.0
0x92 Boilertemp Onder (°C) (t_boildwn) 39.47
0x92 Boilertemp Boven (°C) (t_boiltop) 50.31
0x92 Verdamper Temp (°C) (t_evap) 20.28
0x92 Zuiggas Temp (°C) (t_suct) 20.84
0x92 Persgas Temp (°C) (t_disc) 23.92
0x92 Vloeistof Temp (°C) (t_cond) 20.54
0x92 Temp Naar Bron (°C) (t_source_r) 21.56
0x92 Temp Uit Bron (°C) (t_source_s) 21.27
0x92 Cv Aanvoertemp (°C) (t_ch_supp) 22.95
0x92 Cv Retourtemp (°C) (t_ch_ret) 22.95
0x92 Cv-Druk (Bar) (p_sens) 1.18
0x92 Stroom Compressor (A) (i_tr1) 0.0
0x92 Stroom E-Element (A) (i_tr2) 0.0
0xc Drukschakelaar (in_p_switch) 0
0xc Tarief (in_hl) 0
0xc Condens Beveiliging (in_cond) 0
0xc Spare Ingang (sparein) 0
0x10 Pulsteller (in_count) 0
0x10 Flowsensor (lt/hr) (in_flow) 0
0xc Fase Detectie (in_phase) 0
0x0 Cv Pomp (%) (out_ch) 0
0x0 Bron Pomp (%) (out_src) 0
0x0 Boiler Pomp (%) (out_dhw) 0
0x10 Vrijkoelklep (pls) (out_fc_valve) 725
0x10 Cv/Dhw Klep (pls) (out_ch_valve) 725
0xc Compressor (out_c1) 0
0xc Element (out_ele) 0
0xc Trickle Heating (out_trickle) 0
0xc Fout (out_fault) 1
0xc Vrijkoelen (out_fc) 0
0x10 Expansieventiel (pls) (out_ev) 0
0x92 Kamertemp (°C) (ot_room) 21.49
0x92 Gevr Kamertemp (°C) (ot_setp) 21.0
0x0 Warmtevraag (%) (ot_mod) 0
0x0 Status (state) 1
0x0 Sub_Status (sub_state) 255
0x0 Blokkade (ot_vrij) 0
0x92 Berekende Verdampings Temp Cv (°C) (c_sh_evap) 19.28
0x92 Berekende Condensatie Temp Cv (°C) (c_sh_con) 22.58
0x92 Berekende Verdampings Temp Dhw (°C) (c_sh_evap_dhw) 19.28
0x92 Berekende Condensatie Temp Dhw (°C) (c_sh_con_dhw) 22.58
0x0 Fout_Gevonden (fault_reported) 0
0x0 Fout_Retry (fault_retrying) 0
0x10 Taak Aktief (task_active) 0
0xc Handbediening (c_hand) 0
0x10 Compr Blok (sec) (tr_compr) 0
0x10 Elek Blok (sec) (tr_eblock) 0
0x10 Cv Voor / Nadraai (sec) (tr_cv) 0
0x10 Bron Voor / Nadraai (sec) (tr_src) 0
0x10 Boiler Voor / Nadraai (sec) (tr_dhw) 0
0x10 Delay Elektr (sec) (tr_elek) 0
0x10 Min Draaitijd Compr (sec) (tr_press) 0
0x10 Afpomp Tijd (sec) (tr_mincompr) 0
0x10 Ev Drukvereffenen (sec) (tr_ev_bal) 0
0x10 Ev Verstellen (sec) (tr_ev_verstel) 0
0x10 Vrijkoel Interval (sec) (tr_fc) 0
0x10 Handbediening (sec) (tr_hand) 0
0x10 Lage Druk Timer (sec) (tr_ld) 0
0x10 Compressor Start (sec) (tr_strtcompr) 0
0x10 Compr Power On Delay (sec) (compr_powondelay) 0
0x10 Vertraging Cv Start (sec) (delaybefstartch) 0
0x10 Vertraging Cv Stop (sec) (delaybefstopch) 0
0x10 Adaptief Timer (sec) (tr_adaptief) 0
0x12 Adaptief Oververhitting (K) (t_adoverheating) 258.44
0x0 Adaptief Fifo Index (adfifoindex) 29
0x0 Fout Hoogste Prioriteit (hipriorfault) 0
0x20 Utc Tijd (utc_time) 1637013953
0x0 Max Cv Retour Temp (°C) (maxcvtemp) 45
0x0 Bronpomp Snelheid Vrijkoel Mode (bronpompspeed) 0
0xc Compressor In Cv Mode (comprch) 0
0xc Compressor In Boiler Mode (comprdhw) 0
0xc Element In Cv Mode (elemch) 0
0xc Element In Boiler Mode (elemdhw) 0
0xc Cv Mode Geblokkeerd (chmodeblocked) 0
0xc Boiler Mode Geblokkeerd (dhwmodeblocked) 0
0xc Vrijkoel Mode Geblokkeerd (fcmodeblocked) 0
0xc Ontlucht Mode Geblokkeerd (ventmodeblocked) 0
0xc Elektr Element Geblokkeerd (elblocked) 0
0xc Elektr Element Dhw Geblokkeerd (eldhwblocked) 0
0xc Compressor Geblokkeerd (comprblocked) 0
0xc Off Mode Aktief (offmode) 1
0xc Cv Mode Aktief (chmode) 0
0xc Boiler Mode Aktief (dhwmode) 0
0xc Vrijkoel Mode Aktief (fcmode) 0
0xc Cv Pomp Voordraaien (chpmpprerun) 0
0xc Bron Pomp Voordraaien (srcpmpprerun) 0
0xc Element Vrijgegeven Door Gebruiker (elreluser) 0
0xc Vrijgave Extra Koelen (fclowrel) 0
0xc Cv Vrijgegeven (chrel) 0
0xc Vrijkoel Vrijgegeven (fcrel) 0
0xc Tarief Laag Vanuit Thermostaat (lttherm) 0
0xc Ontluchten Vanuit Thermostaat (venttherm) 0
0xc Eco Geselecteerd Op Thermostaat (ecotherm) 0
0xc Comfort Geselecteerd Op Thermostaat (comftherm) 1
0xc Boiler Blokkade Vanuit Thermostaat (dhwthermblocked) 0
0xc Boiler Boost Vanuit Thermostaat (dhwthermboost) 0
0x0 Warmtevraag (%) (maxrmod) 0
0x0 Utc Tijd : (utctimevalid) 1
0x0 Element Alleen Voor Dhw Vrijgegeven (elementalleenvoordhw) 1
Unknown message type for datalog P Fout Bronflow (pbron): 162
0xa2 P Fout Bronflow (pbron) 1
Unknown message type for datalog I Fout Bronflow (ibron): 165
0xa5 I Fout Bronflow (ibron) 1
0x92 Pi Bronflow Resultaat (pibron) 0.0
0x92 Actuele Bronklepstand (%) (kleppos) 0.44
0x90 Utc Tijd Offset (min.) (utcoffset) 106
0x10 Gateway Tijd Ontvangen (gwtrec) 56497
0x0 Ot-Tijd Valid (totvalid) 27
0x0 Tijd Uren (uur) (thr) 135
0x0 Tijd Minuten (min) (tmin) 0
0x0 Tijd Seconden (sec) (tsec) 0
0x10 Vrijkoel Blokkade Tijd (min.) (tr_fc_block) 60

So there's something funky with the labels, will see if I can compare it against v34 later today

from ithowifi.

JoostBaltissen avatar JoostBaltissen commented on August 15, 2024

I did a query on the sqlite database and found the following:
sqlite>select in 20 but not 37, a.name, a.tooltip
from datalabel_v20 as a left join datalabel_v37 as b on a.name = b.name
where b.name is null;
in 20 but not 37|In_Count|pulsteller ingang
in 20 but not 37|Pbron|
in 20 but not 37|Ibron|
in 20 but not 37|GWtRec|tbv test
in 20 but not 37|tOTvalid|tbv test
in 20 but not 37|Thr|tbv test
in20 but not 37|Tmin|tbv test
in 20 but not 37|Tsec|tbv test

so it looks like v20 has less labels than v37, but also a few other labels.

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

So much for the theory of full overlap then....

Having a per version all labels explicitly added to the .h file will just add bloat and just adding a baseline (v37) with per versions differences only is difficult I guess.

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

I am a lazy coder so it's an ugly PHP script.

Lazy coders are the best coders ;-)

I assumed that the 111 elements of version 20 overlap with the first 111 of version 34.

Unfortunately not, all elements could change between versions (not all do but it can be the case)

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

I am a lazy coder so it's an ugly PHP script.

And still, ugly is more than fine, are you willing to share the script so that we maybe can help you or do you want to change the script yourself?

from ithowifi.

JoostBaltissen avatar JoostBaltissen commented on August 15, 2024

I almost had a conceptual solution, but i ran into double values because due to minor differences in tooltip text.
but the idea was:
get all unique labels. use union on all datalabel version tables and insert in a new table (datalabel_all).
then get the corresponding index for a version by using left join.
select b.rowid,a.rowid, b.* from datalabel_v20 as a left join datalabel_all as b on a.name = b.name order by a.rowid;

it looks a bit more messy since the union sorts the labels. And it has a problem now that it has doubles.

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Ok, my python and sql are very rusty to say the least, I'll try to convert the DB to SQlite and have a look at the code you shared. Much appreciated for sharing!
In pseudo code, could it be something like this:

create datastructure {label, description}

for each table Datalabel_V<version>
	for each row in column[Naam]
		if row.value[Naam] is not in datastructure.label
			add row.value[Naam] to datastructure.label
			add row.value[Tooltip_NL]to datastructure.description
			if row.value[Tooltip_NL] is empty
				add row.value[Tekst_NL] to datastructure.description //something like this or just the value from the Naam colomn

for each table Datalabel_V<version>
	create itho_<product>status<version> array
	for each row in column[Naam]
		for each datastructure {label}
			if row.value[Naam] is datastructure {label}
				add datastructure {label} array index number to itho_<product>status<version> array

This way you will create a unique mapping for all the versions of a product (which might need to be squashed but that is less important) and never create a label twice (and this saving the most of memory / flash possible)

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

Script:

<?php
$db = new SQLite3('wpu.db');
$q = "select datalabel from versiebeheer";
$res = $db->query($q);
$dl = [];
// All datalabel numbers in an array
while ($row = $res->fetchArray())
{
        $dl[$row['datalabel']] = [];
}

// Collect names per datalabel and the flash label text
foreach($dl as $k=>$v) {
        $q = "select * from datalabel_v".$k;
        $res = $db->query($q);
        while($row = $res->fetchArray()) {
                if (! empty($row['unit'])) {
                        $row['title'] .= " (".$row['unit'].")";
                }
                $dl[$k][$row['name']] = ucfirst($row['title']);
        }
}

// Build array of labels with their associated datalabel number
$labels = [];
foreach($dl as $k=>$v) {
        foreach($v as $label=>$id) {
                if (! isset($labels[$label]))
                {
                        $labels[$label] = [];
                }
                $labels[$label][$k] = $id;
        }
}

$nr = 0;
$f = [];

// Store label sequences
$labelsequence = [];
foreach($labels as $label => $version) {
        $keys = array_keys($version);
        $labelsequence[$label][$nr] = $keys;
        // Flash message position
        $f[$nr] = $version[$keys[0]];
        $nr++;
}

// Display the relevant labels numbers per version
foreach($dl as $labelnr=>$nameArr)
{
        $fieldseq = [];
        foreach($nameArr as $name=>$id) {
                $n = $labelsequence[$name];
                $fieldseq[] = array_keys($n)[0];
        }
        printf("const uint8_t itho_WPUstatus%d[] = { %s }\n",$labelnr,join(",",$fieldseq));
}

print("\n\n");

// Flash messages
foreach($f as $pos => $flashlabel) {
        printf("F(|%d|\"%s\"),\n",$pos,$flashlabel);
}

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Cool, it seems that using the datalabel from VersieBeheer already results in a squashed result, great! That also means there might be missing mappings in the current code so all mappings need to be recreated but that can easily be done with the script.

Here a compiled version with the above info, please test and thanks for this great work!
NRG_itho_wifi.ino.esp32.bin.zip

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

A few small changes made to the script.

<?php
$db = new SQLite3('wpu.db');
$q = 'select DataLabel from VersieBeheer';
$res = $db->query($q);
$dl = [];

// All datalabel numbers in an array
while ($row = $res->fetchArray())
{
        $dl[$row['DataLabel']] = [];
}


// Collect names per datalabel and the flash label text
foreach($dl as $k=>$v) {
        $q = "select * from Datalabel_V".$k;
        $res = $db->query($q);
        while($row = $res->fetchArray()) {
                if (! empty($row['Eenheid_NL'])) {
                        $row['Tekst_NL'] .= " (".$row['Eenheid_NL'].")";
                }
                $dl[$k][$row['Naam']] = ucfirst($row['Tekst_NL']);
        }

}

// Build array of labels with their associated datalabel number
$labels = [];
foreach($dl as $k=>$v) {
        foreach($v as $label=>$id) {
                if (! isset($labels[$label]))
                {
                        $labels[$label] = [];
                }
                $labels[$label][$k] = $id;
        }
}

$nr = 0;
$f = [];

// Store label sequences
$labelsequence = [];
foreach($labels as $label => $version) {
        $keys = array_keys($version);
        $labelsequence[$label][$nr] = $keys;
        // Flash message position
        $f[$nr] = $version[$keys[0]];
        $nr++;
}

// Display the relevant labels numbers per version
foreach($dl as $labelnr=>$nameArr)
{
        $fieldseq = [];
        foreach($nameArr as $name=>$id) {
                $n = $labelsequence[$name];
                $fieldseq[] = array_keys($n)[0];
        }
        printf("const uint8_t itho_WPUstatus%d[] { %s,255};\n",$labelnr,join(",",$fieldseq));
}

print("\n\n");

print("const __FlashStringHelper *ithoWPUStatusLabels[] =  {\n");
// Flash messages
foreach($f as $pos => $flashlabel) {
        printf("    F(\"%s\"),\n",$flashlabel);
}
print("};\n");

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

I've ran it again but had to discard the database field name changes as they didn't match with my sqlite version.

const uint8_t itho_WPUstatus2[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,255 };
const uint8_t itho_WPUstatus4[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,255 };
const uint8_t itho_WPUstatus5[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,68,255 };
const uint8_t itho_WPUstatus6[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,64,65,66,67,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,255 };
const uint8_t itho_WPUstatus7[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,64,101,66,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,102,255 };
const uint8_t itho_WPUstatus8[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,64,101,66,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,102,103,255 };
const uint8_t itho_WPUstatus10[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,102,103,255 };
const uint8_t itho_WPUstatus11[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,102,103,255 };
const uint8_t itho_WPUstatus18[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,102,103,112,113,114,115,116,117,118,119,120,121,255 };
const uint8_t itho_WPUstatus20[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,102,103,112,113,114,115,116,117,118,119,120,121,122,255 };
const uint8_t itho_WPUstatus21[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,102,103,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,255 };
const uint8_t itho_WPUstatus22[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,102,103,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,255 };
const uint8_t itho_WPUstatus23[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,102,103,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,255 };
const uint8_t itho_WPUstatus24[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,102,103,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,255 };
const uint8_t itho_WPUstatus25[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,102,103,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,255 };
const uint8_t itho_WPUstatus27[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,135,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,54,53,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,136,137,138,139,102,103,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,140,141,142,255 };
const uint8_t itho_WPUstatus31[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,135,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,54,53,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,136,137,138,139,143,103,114,115,116,122,123,124,125,126,127,128,129,130,131,132,134,140,141,142,144,145,146,102,255 };
const uint8_t itho_WPUstatus33[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,135,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,54,53,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,136,137,138,139,143,103,114,115,116,122,123,124,125,126,127,128,129,147,131,130,132,134,140,141,142,144,145,146,102,148,149,150,151,152,153,255 };
const uint8_t itho_WPUstatus34[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,135,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,54,53,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,136,137,138,139,143,103,114,115,116,122,123,124,125,126,127,128,129,147,131,130,132,134,140,141,142,144,145,146,102,148,149,150,151,152,153,154,255 };
const uint8_t itho_WPUstatus37[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,104,155,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,106,107,98,99,100,45,47,48,49,50,51,52,54,53,55,56,57,58,59,60,61,69,70,108,109,110,64,101,66,71,72,73,74,75,76,77,78,79,80,105,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,111,136,137,138,139,143,103,114,115,116,122,123,124,125,126,127,128,129,147,131,130,132,134,140,141,142,144,145,146,102,148,149,150,151,152,153,154,255 };


const __FlashStringHelper *ithoWPUStatusLabels[] =  {
    F("Buitentemp (°C)"),
    F("Boiler laag (°C)"),
    F("Boiler hoog (°C)"),
    F("Verdamper temp (°C)"),
    F("Zuiggas temp (°C)"),
    F("Persgas temp (°C)"),
    F("Vloeistof temp (°C)"),
    F("Naar bron (°C)"),
    F("Van bron (°C)"),
    F("CV aanvoer (°C)"),
    F("CV retour (°C)"),
    F("Druksensor (Bar)"),
    F("Stroomtrafo 1 (A)"),
    F("Stroomtrafo 2 (A)"),
    F("Drukschakelaar"),
    F("Hoog / laag"),
    F("Condens beveiliging"),
    F("Pulsteller"),
    F("Flowsensor (lt/hr)"),
    F("Fase detectie"),
    F("Cv pomp (%)"),
    F("Bron pomp (%)"),
    F("Boiler pomp (%)"),
    F("Vrijkoelklep (pls)"),
    F("Cv klep (pls)"),
    F("Compressor"),
    F("Element"),
    F("Trickle heating"),
    F("Fout"),
    F("Vrijkoel"),
    F("Expansieventiel (pls)"),
    F("Kamertemp (°C)"),
    F("Gevr temp (°C)"),
    F("Vraag (%)"),
    F("State"),
    F("Sub_status"),
    F("Blokkade"),
    F("Berekende verdampings temp (°C)"),
    F("Berekende condensatie temp (°C)"),
    F("Foutcode byte 5"),
    F("Foutcode byte 4"),
    F("Foutcode byte 3"),
    F("Foutcode byte 2"),
    F("Foutcode byte 1"),
    F("Foutcode byte 0"),
    F("Handbediening"),
    F("Logging (sec)"),
    F("Compr blok (sec)"),
    F("Elek blok (sec)"),
    F("Cv voor / nadraai (sec)"),
    F("Bron voor / nadraai (sec)"),
    F("Boiler voor / nadraai (sec)"),
    F("Delay elektr (sec)"),
    F("Min draaitijd compr (sec)"),
    F("Afpomp tijd (sec)"),
    F("EV drukvereffenen (sec)"),
    F("EV verstellen (sec)"),
    F("Vrijkoel interval (sec)"),
    F("Handbediening (sec)"),
    F("Lage druk timer (sec)"),
    F("Compressor start (sec)"),
    F("Compr power on delay (sec)"),
    F("Cv start vertraging (sec)"),
    F("Cv stop vertraging (sec)"),
    F("Fout hoogste prioriteit"),
    F("Tijd voor fouthistorie (sec)"),
    F("Max cv retour temp (°C)"),
    F("StroomHardware"),
    F("Fout hoogste prioriteit"),
    F("Vertraging cv start (sec)"),
    F("Vertraging cv stop (sec)"),
    F("Bronpomp snelheid vrijkoel mode"),
    F("Compressor in Cv mode"),
    F("Compressor in boiler mode"),
    F("Element in cv mode"),
    F("Element in boiler mode"),
    F("Cv mode geblokkeerd"),
    F("Boiler mode geblokkeerd"),
    F("Vrijkoel mode geblokkeerd"),
    F("Ontlucht mode geblokkeerd"),
    F("Elektr element geblokkeerd"),
    F("Compressor geblokkeerd"),
    F("Off mode aktief"),
    F("Cv mode aktief"),
    F("Boiler mode aktief"),
    F("Vrijkoel mode aktief"),
    F("Cv pomp voordraaien"),
    F("Bron pomp voordraaien"),
    F("Element vrijgegeven door gebruiker"),
    F("Vrijgave extra koelen"),
    F("Cv vrijgegeven"),
    F("Vrijkoel vrijgegeven"),
    F("Tarief laag vanuit thermostaat"),
    F("Ontluchten vanuit thermostaat"),
    F("Eco geselecteerd op thermostaat"),
    F("Comfort geselecteerd op thermostaat"),
    F("Boiler blokkade vanuit thermostaat"),
    F("Boiler boost vanuit thermostaat"),
    F("Fout_gevonden"),
    F("Fout_retry"),
    F("Taak aktief"),
    F("UTC tijd"),
    F("UTC tijd :"),
    F("Element alleen voor DHW vrijgegeven"),
    F("Spare Ingang"),
    F("Elektr Element DHW geblokkeerd"),
    F("Berekende verdampings temp DHW (°C)"),
    F("Berekende condensatie temp DHW (°C)"),
    F("Adaptief timer (sec)"),
    F("Adaptief oververhitting (K)"),
    F("Adaptief fifo index"),
    F("Warmtevraag (%)"),
    F("P fout bronflow"),
    F("I fout bronflow"),
    F("PI bronflow resultaat"),
    F("Actuele bronklepstand (%)"),
    F("Utc Tijd offset (min.)"),
    F("Gateway Tijd ontvangen"),
    F("OT-tijd valid"),
    F("Tijd uren (uur)"),
    F("Tijd minuten (min)"),
    F("Tijd seconden (sec)"),
    F("Vrijkoel blokkade tijd (min.)"),
    F("Vrijkoelklep control percentage (%)"),
    F("Luchtklep positie (%)"),
    F("HRU uitblaas temp (°C)"),
    F("HRU uitblaas flow (m3/h)"),
    F("Regeneratie aktief"),
    F("Laatst geldige brontoevoer temp. (°C)"),
    F("Bronpomp flow setpoint (l/h)"),
    F("Bronpomp snelheid bij luchtreg + Compr (%)"),
    F("Bronpomp snelheid bij vrijkoel (%)"),
    F("Vrijkoelmodus"),
    F("Vrijkoel aan tijd (sec)"),
    F("Positie CO-klep (%)"),
    F("Reserve"),
    F("E-verbuik tijdens stand-by (kWh)"),
    F("E-verbuik tijdens verwarmen (kWh)"),
    F("E-verbuik tijdens DHW (kWh)"),
    F("E-verbuik tijdens koelen (kWh)"),
    F("Minimale vrijgave tijd extern koelen (sec.)"),
    F("Blokkeertijd vrijgave extern koelen (sec.)"),
    F("Blokkeertijd vrijgave extern verwarmen (sec.)"),
    F("Voorverwarmen tapwater"),
    F("Blokkeertijd trickle low na power-up (sec.)"),
    F("Blokkeertijd trickle low na CV-bedrijf (sec.)"),
    F("Blokkeertijd voorverwarmen tapwater (sec.)"),
    F("Bronpomp snelheid bij Compr (%)"),
    F("Slow start bronpomp (sec.)"),
    F("Bron retourtemperatuur te laag (sec.)"),
    F("Regelperiode bronflow (sec.)"),
    F("Stabilisatie wachttijd vrijkoelen (sec.)"),
    F("Minimale tijd voorverwarmen tapwater (sec)"),
    F("Maximale tijd voorverwarmen tapwater (sec.)"),
    F("Vrijgave elektrisch element (min)"),
    F("Correctie meting delta brontemperatuur (K)"),
};

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Were you able to test the binary?

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

The 4G doesn't have a built-in kWh meter?

The "Gateway tijd ontvangen" implies there's a connection with internet?

from ithowifi.

JoostBaltissen avatar JoostBaltissen commented on August 15, 2024

Unfortunately the 4g doesn't have a built in kWh meter. They installed an external kWh meter which transmits the values to somewhere.
The unit has an add-on, RFP-I2C_U1 which is, for what i assume, a 8-900 Mhz transceiver. The unit receives the time and outside temperature from a gateway. For what I know from the Itho website they have some sort of mesh network. Couple of years ago they were also experimenting with a portal to see all the data we are also trying to get. But as far as i know the portal didn't go further than beta for me at least.
I just see that the offer it as a service or something. https://www.ithodaalderop.nl/monitoring

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

Thanks, the 5G has a built-in kWh meter per activity (heat, standy) so that's what I am using to calculate the daily usage. So I am still not sure if the reported numbers are correct, so benchmarking it against other users was something I was looking for.

I do have some antennas on my 5G but I thought it was for communicating with the thermostat. But this seem to have some more info: https://ithodaalderop.compano.com/Data/Environments/000001/Attachment/Bijlage/A02_Warmtepompen/A02_80_Accessoires/A02_80_01_Grond/A02_80_01_04_Monitoring/B01_04_PRT/TED%20052%20productblad%20Monitoring.pdf

But with Arjen's tool I can get all the status values and visualise it locally with Home Assistant, Influx/Grafana.

More on topic: so what's left is to translate the labels again to English and give the parameters a try?

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Adaptation of the script to also include settings

<?php

$lang	 = 'NL';
//$lang	 = 'EN';
$product = 'WPU';
$dbname  = 'wpu.db';
$pwlevel = 23;



$db = new SQLite3($dbname);
$q = 'select ParameterLijst from VersieBeheer';
$res = $db->query($q);
$dl = [];


// All datalabel numbers in an array
while ($row = $res->fetchArray())
{
        $dl[$row['ParameterLijst']] = [];
}

if($lang == 'NL') {
	$col_unit = 'Eenheid_NL';
	$col_title = 'Tekst_NL';
	$col_name = 'Naam';
}
else {
	$col_unit = 'unit';
	$col_title = 'title';
	$col_name = 'name';
}

// Collect names per datalabel and the flash label text
foreach($dl as $k=>$v) {

        $q = "select * from Parameterlijst_V$k where Paswoordnivo<$pwlevel";
        
        $res = $db->query($q);
        while($row = $res->fetchArray()) {
                if (! empty($row[$col_unit])) {
                        $row[$col_title] .= " (".$row[$col_unit].")";
                }
                $dl[$k][$row[$col_name]] = ucfirst($row[$col_title]);
        }

}

// Build array of labels with their associated datalabel number
$labels = [];
foreach($dl as $k=>$v) {
        foreach($v as $label=>$id) {
                if (! isset($labels[$label]))
                {
                        $labels[$label] = [];
                }
                $labels[$label][$k] = $id;
        }
}

$nr = 0;
$f = [];

// Store label sequences
$labelsequence = [];
foreach($labels as $label => $version) {
        $keys = array_keys($version);
        $labelsequence[$label][$nr] = $keys;
        // Flash message position
        $f[$nr] = $version[$keys[0]];
        $nr++;
}

// Display the relevant labels numbers per version
foreach($dl as $labelnr=>$nameArr)
{
        $fieldseq = [];
        foreach($nameArr as $name=>$id) {
                $n = $labelsequence[$name];
                $fieldseq[] = array_keys($n)[0];
        }
        printf("const uint16_t itho_%ssetting%d[] { %s,255};\n",$product,$labelnr,join(",",$fieldseq));
}

print("\n\n");

print("const __FlashStringHelper *itho{$product}SettingsLabels[] =  {\n");
// Flash messages
foreach($f as $pos => $flashlabel) {
        printf("    F(\"%s\"),\n",$flashlabel);
}
print("};\n");

$q = 'select DataLabel from VersieBeheer';
$res = $db->query($q);
$dl = [];


// All datalabel numbers in an array
while ($row = $res->fetchArray())
{
        $dl[$row['DataLabel']] = [];
}

if($lang == 'NL') {
	$col_unit = 'Eenheid_NL';
	$col_title = 'Tekst_NL';
	$col_name = 'Naam';
}
else {
	$col_unit = 'unit';
	$col_title = 'title';
	$col_name = 'name';
}

// Collect names per datalabel and the flash label text
foreach($dl as $k=>$v) {
        $q = "select * from Datalabel_V".$k;
        
        $res = $db->query($q);
        while($row = $res->fetchArray()) {
                if (! empty($row[$col_unit])) {
                        $row[$col_title] .= " (".$row[$col_unit].")";
                }
                $dl[$k][$row[$col_name]] = ucfirst($row[$col_title]);
        }

}

// Build array of labels with their associated datalabel number
$labels = [];
foreach($dl as $k=>$v) {
        foreach($v as $label=>$id) {
                if (! isset($labels[$label]))
                {
                        $labels[$label] = [];
                }
                $labels[$label][$k] = $id;
        }
}

$nr = 0;
$f = [];

// Store label sequences
$labelsequence = [];
foreach($labels as $label => $version) {
        $keys = array_keys($version);
        $labelsequence[$label][$nr] = $keys;
        // Flash message position
        $f[$nr] = $version[$keys[0]];
        $nr++;
}

// Display the relevant labels numbers per version
foreach($dl as $labelnr=>$nameArr)
{
        $fieldseq = [];
        foreach($nameArr as $name=>$id) {
                $n = $labelsequence[$name];
                $fieldseq[] = array_keys($n)[0];
        }
        printf("const uint8_t itho_%sstatus%d[] { %s,255};\n",$product,$labelnr,join(",",$fieldseq));
}

print("\n\n");

print("const __FlashStringHelper *itho{$product}StatusLabels[] =  {\n");
// Flash messages
foreach($f as $pos => $flashlabel) {
        printf("    F(\"%s\"),\n",$flashlabel);
}
print("};\n");



from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

NRG_itho_wifi.ino.esp32.bin.zip

And again a binary to test (this includes the result from the above script). If this works the labels can be translated to english and I will update the other products' settings and labels as well.

from ithowifi.

JoostBaltissen avatar JoostBaltissen commented on August 15, 2024

The labels are in the wrong order now.

Label Value
temp 0
hum 0
ppmw 0
Adaptief fifo index 7
Bronpomp snelheid vrijkoel mode 54.91
Handbediening 55.44
Berekende condensatie temp (°C) 27.58
Berekende condensatie temp DHW (°C) 28.25
Berekende verdampings temp (°C) 36.53
Berekende verdampings temp DHW (°C) 28.97
Cv mode aktief 18.31
Cv mode geblokkeerd 31.69
Cv pomp voordraaien 37.35
Cv vrijgegeven 28.08
Comfort geselecteerd op thermostaat 1.18
Compr power on delay (sec) 0
Compressor geblokkeerd 0
Compressor in Cv mode 0
Compressor in boiler mode 0
Vertraging cv start (sec) 0
Vertraging cv stop (sec) 0
Boiler mode aktief 0
Boiler mode geblokkeerd 0
Boiler blokkade vanuit thermostaat 0
Boiler boost vanuit thermostaat 0
Eco geselecteerd op thermostaat 0
Elektr element geblokkeerd 0
Elektr Element DHW geblokkeerd 725
Element in cv mode 725
Element in boiler mode 0
Element alleen voor DHW vrijgegeven 0
Element vrijgegeven door gebruiker 0
Fout_gevonden 1
Fout_retry 0
Vrijgave extra koelen 0
Vrijkoel mode aktief 21.21
Vrijkoel mode geblokkeerd 21
Vrijkoel vrijgegeven 0
Gateway Tijd ontvangen 1
Fout hoogste prioriteit 255
Stroomtrafo 1 (A) 0
Stroomtrafo 2 (A) 26.58
I fout bronflow 31.64
Condens beveiliging 26.58
Pulsteller 31.64
Flowsensor (lt/hr) 0
Hoog / laag 0
Drukschakelaar 0
Fase detectie 0
Actuele bronklepstand (%) 0
Tarief laag vanuit thermostaat 0
Max cv retour temp (°C) 0
Warmtevraag (%) 0
Off mode aktief 0
Vraag (%) 0
Kamertemp (°C) 0
Gevr temp (°C) 0
Blokkade 0
Compressor 0
Cv pomp (%) 0
Cv klep (pls) 0
Boiler pomp (%) 0
Element 0
Expansieventiel (pls) 0
Fout 0
Vrijkoel 0
Vrijkoelklep (pls) 0
Bron pomp (%) 5
Trickle heating 0
Druksensor (Bar) 0
P fout bronflow 1637145433
PI bronflow resultaat 45
Spare Ingang 0
Bron pomp voordraaien 0
State 0
Sub_status 0
Adaptief oververhitting (K) 0
Boiler laag (°C) 0
Boiler hoog (°C) 0
CV retour (°C) 0
CV aanvoer (°C) 0
Vloeistof temp (°C) 0
Persgas temp (°C) 0
Verdamper temp (°C) 0
Buitentemp (°C) 1
Naar bron (°C) 0
Van bron (°C) 0
Zuiggas temp (°C) 0
Taak aktief 0
Tijd uren (uur) 0
Tijd minuten (min) 0
OT-tijd valid 0
Adaptief timer (sec) 1
Compr blok (sec) 0
Cv voor / nadraai (sec) 0
Boiler voor / nadraai (sec) 0
Elek blok (sec) 0
Delay elektr (sec) 1
EV drukvereffenen (sec) 0
EV verstellen (sec) 0
Vrijkoel interval (sec) 0
Vrijkoel blokkade tijd (min.) 1
Handbediening (sec) 1
Lage druk timer (sec) -0.44
Afpomp tijd (sec) 70.57305
Min draaitijd compr (sec) 70.13
Bron voor / nadraai (sec) 0
Compressor start (sec) 60
Tijd seconden (sec) 833
UTC tijd 1
Utc Tijd offset (min.) 11
UTC tijd : 37
Ontlucht mode geblokkeerd 13
Ontluchten vanuit thermostaat 0

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Hmm, in the DB apparently not all data info is sorted the same way...
Another try
NRG_itho_wifi.ino.esp32.bin.zip

from ithowifi.

JoostBaltissen avatar JoostBaltissen commented on August 15, 2024

This one looks correct again.

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

This one looks correct again.

Cool, thanks! Do the settings show up as well?

from ithowifi.

JoostBaltissen avatar JoostBaltissen commented on August 15, 2024

Settings seems to look correct also. I had not checked that before. List looks pretty limited in comparison with the demandflow.

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

Will give it a try tomorrow too when I am back in NL. But it's looking great already!

I've created https://github.com/arjenhiemstra/ithowifi/wiki/Itho-WPU-Heat-pump-support , but I guess we only got prelim test results from a 5G (me) and 4G (Joost) devices, so that's version 20 and 34. I am not sure if the lower numbers relate to 3G or 4G variants.

I / we can post something on Gathering of Tweakers forum and ask for more volunteers?

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

I've posted beta5, also on the Tweakers forum. Let's see how it works for the rest of the users. Thanks for al of your help on this!

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

I also saw the restructured headers with a per device .h file. Looks nice.

I have auto temp on all 3 floors, do you know if anyone tested that already? Otherwise I’ll be the first tomorrow 😉I saw auto temp labels etc are already in English
so I take you extracted params and labels from Itho service tool?

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

I also saw the restructured headers with a per device .h file. Looks nice.

yeah, it was getting kinda messy... :)

I have auto temp on all 3 floors, do you know if anyone tested that already? Otherwise I’ll be the first tomorrow 😉I saw auto temp labels etc are already in English

No, nobody tested it, I just knew someone would be interested in this 😉
Very interested what the result will be!

so I take you extracted params and labels from Itho service tool?

I adapted your script further and ran it against available databases and when needed translated the labels

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

Ok, auto temp confirmed to work for both status & settings with latest firmware (pulled).
Biggest challenge is to interpret the values. E.g. I see 7 rooms but how do they translate to rooms in the house. But definitely useful.

For the WPU there are I think a few settings I'd like to control via API / MQTT:

  1. Change requested temperature for thermostat
  2. Change mode for boiler (Eco, Comfort, Off, something else)
    So basically the same functionality one controls today via the thermostat of Itho (Spider).

Are you open to support that (via new feature)? I guess you need to have the CC1101 linked to the Spider module to see which I2C messages you need to send?

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Are you open to support that (via new feature)? I guess you need to have the CC1101 linked to the Spider module to see which I2C messages you need to send?

The firmware now transitioned from a PWM 2 I2C controller to something far more complex kind of itho multitool.
Probably we would need an interface per device instead of the page with slider and a few buttons and also adapt the API at the same time.
Possible? sure Would it be the proper direction for this project? I guess it would!
It will probably need some serious time and also understanding what interface is needed for what device.

I guess you need to have the CC1101 linked to the Spider module to see which I2C messages you need to send?

Specially on this, I'm not sure what the spider sends but it can be received by the CC1101 module for sure.

from ithowifi.

jasperslits avatar jasperslits commented on August 15, 2024

Ok, so I gave it a try with api.html?debug=level3 and see quite a bit of chatter until the page refreshes and the device seems to reboot (Connecting... spinner) which then clears the RF log console. No ideas if it overflows a buffer but after some more rounds of level3 debugging it just locks up (unknown connection state) and restart is needed.

But it makes it difficult to capture so the different scenarios (increase temp, decrease temp etc). I guess it's too much of an ask to send the RF log entries via MQTT so it's easier to process / inspect elsewhere?

Any other suggestions?

I think the 31DA/31D9 might be coming from the Spider when I increased room temp from 20.5 to 21.0 and everything else seems just RF chatter. But it's - as expected - noisy.

22-11-2021 20:58:51: W --- 0B,AE,64 54,9B,41 --,--,-- 22C9 8:04,08,66,7F,FF,01,01,03 (cmd:unknown)
22-11-2021 20:58:51: I --- 54,9B,41 0B,AE,64 --,--,-- 22C9 6:04,08,66,08,CA,01 (cmd:unknown)
22-11-2021 20:58:50: W --- 94,A1,C4 --,--,-- 94,A1,C4 1298 3:00,02,63 (cmd:unknown)
22-11-2021 20:58:46: RP --- 52,EB,C3 54,9B,41 --,--,-- 31DA 30:00,C8,00,03,12,EF,EF,02,02,05,F5,05,F5,02,02,28,08,00,18,01,2C,00,00,EF,EF,7F,FF,7F,FF,00 (cmd:unknown)
22-11-2021 20:58:46: RQ --- 54,9B,41 52,EB,C3 --,--,-- 31DA 1:00 (cmd:unknown)
22-11-2021 20:58:45: RP 123 52,EB,C3 54,9B,41 --,--,-- 31D9 17:00,0A,01,00,20,20,20,20,20,20,20,20,20,20,20,20,00 (cmd:unknown)
22-11-2021 20:58:45: W --- 0B,AE,64 54,9B,41 --,--,-- 22C9 8:04,08,34,7F,FF,01,01,03 (cmd:unknown)
22-11-2021 20:58:45: I --- 54,9B,41 0B,AE,64 --,--,-- 22C9 6:04,08,34,08,98,01 (cmd:unknown)
22-11-2021 20:58:39: W --- 0B,B2,63 0B,AE,84 --,--,-- 4E02 34:00,07,6C,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,04,07,D0,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF (cmd:unknown)
22-11-2021 20:58:37: W --- 0B,B2,73 0B,AE,84 --,--,-- 4E02 34:00,07,6C,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,04,07,D0,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF (cmd:unknown)
22-11-2021 20:58:36: W --- 0B,B2,73 0B,AE,84 --,--,-- 4E01 18:00,07,CF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,00 (cmd:unknown)

Is this useful to begin with?

from ithowifi.

JoostBaltissen avatar JoostBaltissen commented on August 15, 2024

This looks pretty similar to RAMES-II Rf protocol (from honeywell?) As described here: https://github.com/zxdavb/ramses_protocol

from ithowifi.

arjenhiemstra avatar arjenhiemstra commented on August 15, 2024

Ok, so I gave it a try with api.html?debug=level3 and see quite a bit of chatter until the page refreshes and the device seems to reboot (Connecting... spinner) which then clears the RF log console. No ideas if it overflows a buffer but after some more rounds of level3 debugging it just locks up (unknown connection state) and restart is needed.

But it makes it difficult to capture so the different scenarios (increase temp, decrease temp etc). I guess it's too much of an ask to send the RF log entries via MQTT so it's easier to process / inspect elsewhere?

Any other suggestions?

I think the 31DA/31D9 might be coming from the Spider when I increased room temp from 20.5 to 21.0 and everything else seems just RF chatter. But it's - as expected - noisy.

22-11-2021 20:58:51: W --- 0B,AE,64 54,9B,41 --,--,-- 22C9 8:04,08,66,7F,FF,01,01,03 (cmd:unknown)
22-11-2021 20:58:51: I --- 54,9B,41 0B,AE,64 --,--,-- 22C9 6:04,08,66,08,CA,01 (cmd:unknown)
22-11-2021 20:58:50: W --- 94,A1,C4 --,--,-- 94,A1,C4 1298 3:00,02,63 (cmd:unknown)
22-11-2021 20:58:46: RP --- 52,EB,C3 54,9B,41 --,--,-- 31DA 30:00,C8,00,03,12,EF,EF,02,02,05,F5,05,F5,02,02,28,08,00,18,01,2C,00,00,EF,EF,7F,FF,7F,FF,00 (cmd:unknown)
22-11-2021 20:58:46: RQ --- 54,9B,41 52,EB,C3 --,--,-- 31DA 1:00 (cmd:unknown)
22-11-2021 20:58:45: RP 123 52,EB,C3 54,9B,41 --,--,-- 31D9 17:00,0A,01,00,20,20,20,20,20,20,20,20,20,20,20,20,00 (cmd:unknown)
22-11-2021 20:58:45: W --- 0B,AE,64 54,9B,41 --,--,-- 22C9 8:04,08,34,7F,FF,01,01,03 (cmd:unknown)
22-11-2021 20:58:45: I --- 54,9B,41 0B,AE,64 --,--,-- 22C9 6:04,08,34,08,98,01 (cmd:unknown)
22-11-2021 20:58:39: W --- 0B,B2,63 0B,AE,84 --,--,-- 4E02 34:00,07,6C,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,04,07,D0,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF (cmd:unknown)
22-11-2021 20:58:37: W --- 0B,B2,73 0B,AE,84 --,--,-- 4E02 34:00,07,6C,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,04,07,D0,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF (cmd:unknown)
22-11-2021 20:58:36: W --- 0B,B2,73 0B,AE,84 --,--,-- 4E01 18:00,07,CF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,7F,FF,00 (cmd:unknown)

Is this useful to begin with?

Hmm, lockups are strange, should not happen. Everything you see is logical data btw. It adheres to the RF standard (most noise is filtered out by the CC1101 chip using a sync word)

It is the ramses-ii protocol
I got my logging format inspiration from that repo.
This repo is also very interesting:
https://github.com/ghoti57/evofw3/wiki

from ithowifi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.