Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Intex SJB-HS #13

Closed
Monsardi opened this issue Jun 6, 2022 · 60 comments
Closed

Support for Intex SJB-HS #13

Monsardi opened this issue Jun 6, 2022 · 60 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Monsardi
Copy link

Monsardi commented Jun 6, 2022

Hello,
I have a intex sjb hs with salt electrolyse + jet streams.
Do you think it is possible to add this functionality?

all the best Peter

@jnsbyr
Copy link
Owner

jnsbyr commented Jun 11, 2022

@Monsardi
The display of the SJB-HS looks different than that of the SBH-20, e.g. it has additional buttons. Without getting my hands on the hardware and spending some time with it it is impossible to say for sure.

Please have a look at the project DIYSCIP because it claims to support SSP-xxx and SJB-xxx models.

@jnsbyr jnsbyr changed the title question Support for Intex SJB-HS Jun 11, 2022
@jnsbyr jnsbyr added enhancement New feature or request help wanted Extra attention is needed labels Jun 11, 2022
@mabeca96
Copy link

Hello
I also have an Intex SJB.
I connected the esp8266-intexsbh20 project to the pool.
I just have the problem that I can't turn the filter on and off.
When I turn on the filter via ESP, the bubble turns on.
The info what on/off is correct.
Also the temperature is displayed correctly

@jnsbyr
Copy link
Owner

jnsbyr commented Jul 10, 2022

@mabeca96: That is very interesting. I did not expect that it would work at all.

On the assumption that the control principle of my project also works with the SJB model, some changes are required to address the different mapping of the control function like the bubbles. The approach would be:

  • add a new config option to select the Intex model (SBH, SJB)
  • support different control bit mappings for each supported model

Because I do not have a SJB I would prefer is someone changes the code, makes tests and submits a merge request. Otherwise I would have to dry code and you could test. My current lack of spare time will not allow me to do the latter, at least not before the summer is over.

Luckily there is another option: you could hard code the changes yourself. That way we will quickly know if it really works. Open SBH20IO.cpp and change the values in the enum FRAME_BUTTON. Look into the project DIYSCIP to get the correct values or just try out different values. You already know that the current value of the filter is your value for the bubbles.

Let me know if you can make it work this way and if yes, post the details of the changes you made.

@mabeca96
Copy link

I will try it with hard code.
Can you help me see the value of DIYSCIP?
Example
You: const uint16 POWER = 0x0400
DIYSCIP: BUTTON_POWER U5 | COMMAND_ADDRESS_S2
BUTTON_POWER COMMAND_ADDRESS_S0
#define U5 0x80
#define COMMAND_ADDRESS_S4 0x04

@Monsardi
Copy link
Author

Thanks for jumping in the conversation. I can confirm that I have the same buttons/functions that work and the same that fail.
Pushing the bubble function triggers the jetstreams and the filter is triggered by the bubble button.
Of course there's also nothing that triggers the salt electrolyse.
I'm curious whether the hard code road will work!

@jnsbyr
Copy link
Owner

jnsbyr commented Jul 13, 2022

When I look into the DIYSCP code I don't see a definition for a bubble or a jet button and there seems to be no additional documentation other than the code and the schematic. So I don't have anything to compare or recommend.

Please assign an otherwise unused 4digit hex value that sets only 1 bit (1, 2, 4, 8) to one or more of the functions of FRAME_BUTTON (e.g. 0x0010) which do not work for you, build and try these functions. Should be around 16 possibilities - so this should not take too long. You can probably skip all values matching FRAME_TYPE::CUE (0x0100), FRAME_TYPE::LED (0x4000) and FRAME_DIGIT::POS_1 ... POS_4) if the display works for you. Either one of the remaining codes helps or it doesn't.

Beware that this way you might be able to send a code that triggers a function reserved by the manufacturer that cannot be triggered by the real panel.

Regarding functions the SBH model does not support like the electrolyse - if you can find the button code and it works consistently for you than let me know.

@mabeca96
Copy link

I found out the following code

const uint16 POWER = 0x0400;
const uint16 FILTER = 0x0080;
const uint16 HEATER = 0x8000;
const uint16 DESIFECT = 0x0001;
const uint16 TEMP_UP = 0x1000;
const uint16 TEMP_DOWN = 0x2000;
const uint16 TEMP_UNIT = 0x2000;
// const uint16 JetDuesen = 0x0008;
// const uint16 JetBubble = 0x0002;
// const uint16 F-C = 0x2000;
// const uint16 JetBubble = 0x0002;

what I am still missing is the display whether the disinfection is on or not.
Can someone explain to me where I have to set additional entries to control them from the MQTT (e.g. disinfection)

@Monsardi
Copy link
Author

Monsardi commented Aug 5, 2022

have you found out the missing entries?
Unfortunately I have no knowledge at all about coding so I can't be of any help.

@jnsbyr
Copy link
Owner

jnsbyr commented Sep 5, 2022

I found out the following code

Did you try the setting you posted by changing FRAME_BUTTON in SBH20IO.cpp?

If yes, please elaborate your results a little bit. Your current listing has some contradicting lines e.g. TEMP_DOWN and TEMP_UNIT are both 0x2000. Can it be that you do not have a TEMP_UNIT function? On the other hand you added some extra values. I assume these are the extra function of the SJB. What is "F-C"?

As soon as I have the hole picture I can add a variant for the SJB model and the necessary command support via MQTT.

@Monsardi
Copy link
Author

Monsardi commented Sep 8, 2022

F-C switches the display from fahrenheit to Celsius

@jnsbyr
Copy link
Owner

jnsbyr commented Sep 17, 2022

@Monsardi
Thanks for your reply. So "F-C" is the same as "TEMP_UNIT" of the SBH - no big surprise here. That leaves the contradiction that your "TEMP_DOWN" has the same value.

Could you please answer all questions from my last comment in some detail? I do not have a SJB - so without you input I cannot make the required changes.

@Monsardi
Copy link
Author

Hi, i'm afraid I can't answer your other questions, as it is maceba96 who found out the rest of the code.

@jnsbyr
Copy link
Owner

jnsbyr commented Sep 17, 2022

@Monsardi
Thanks for the quick feedback. Sorry I mixed up who had posted the codes originally. I still hope that @mabeca96 will add a comment.

@FireSale14
Copy link

Gibt es schon etwas neues? Habe auch ein Intex SJB und würde diesen gern ansteuern. Für das DIYSCIP Projekt müsste man ja erstmal ein Platinenlayout Datei erstellen.

Grüße
Michael

@jnsbyr
Copy link
Owner

jnsbyr commented Mar 3, 2023

@FireSale14

@mabeca96 has reported several codes that work with the SJB (see #13 (comment)). So the hardware and the software of this project seem to be compatible. Now someone with an SJB needs to continue the code analysis, either with a logic analyser or by testing individual codes (see #13 (comment)). 3rd alternative is to try reverse engineering the DIYSCIP code.

Once this analysis is complete the support for the SJB can be added with a new configuration option. The coding could be done by me or can be provided as a merge request.

Please note that I am still unsure if finding the right codes is all it needs. With a working SJB and a logic analyser finding out is not that hard except for the wiring if you don't want to cut the display cable.

@FireSale14
Copy link

@jnsbyr

Can you please help me? What hardware do I need? This? https://amzn.eu/d/cYtB7Zk? Which wires of the display should I connect it to? What should I press so that you can do something with it?
Thank you very much.

@jnsbyr
Copy link
Owner

jnsbyr commented May 9, 2023

I will be happy to include anything you can find out. Maybe you need no logic analyser for this.

First look at comment #13. It already contains more than half of the solution. Use it as a starting point and confirm what @mabeca96 has documented.

For the implementation of a new model it should first be verified that the communication principle of the SB-H20 works at all, by getting any positive reaction to commands and a feedback of a status change using the current firmware.

If this is the case, the definitions of FRAME_XXXXX constants in SBH20IO.cpp need to be adjusted, maybe also DIGIT and ERROR. If possible FRAME_BUTTON and FRAME_LED should be completed first.

As the SJB-HS has more functions than the SB-H20 you will probably need to select one of the button function to test for the missing commands by changing the values and do something similar with the LED inputs. Typically only 1 bit needs to be set in a command, so there are not that may test that need to be done.

In a second step one would add the additional code needed to support the extra functions and add a config entry to make the model selectable. For this seconds step no hardware is needed, so I could cover this or assist.

You may also have look at the documentation at the top of SBH20IO.h, to get some background, what this is good for.

Please consider that it might not work. Then you may have learnt something but you have also permanently modified the pool and you need to find other uses for the ESP8266 module. Be sure you have a little experience with DIY electronics. Otherwise the pool controller might need replacement, too.

If you don't want to build the ES8266 module first or if the tests described above do net get any useful results the logic analyser comes into play. Here is another option. Look at the logic analyser plot and the schematic - the name of the pins to connect to are on the left side of the plot. Having a little experience with this topic is recommended - otherwise you will have a steep learning curve ahead of you. The task it to make recordings of the various operations and extract the interesting sections from the tons of data you will get. Will probably take several days to set it up and get it done.

@algermi
Copy link

algermi commented May 24, 2023

Hello all,

I have today also thanks Thomas my ESP8266 connected to my SJB-HS-20. Can someone tell me if I operate the control via HomeKit, then it works for me only with the Subscribed Topics.
If I understand correctly, I stand with the Subscribed Topics the Whirlpool and with the Published Topics I query the current values? Right?
I am a newbie with MQTT.

Has now already someone managed to find out the values for SJB-HS-20 for only "filtering" and "salt water treatment".
Maybe someone from Germany is on the road here and has the same challenges and would like to exchange ideas with me.
I would be very happy about a reply.

@jnsbyr
Copy link
Owner

jnsbyr commented May 24, 2023

@algermi

Can't help you much with HomeKit, but you basic understanding of MQTT seems to be right. If a node "publishes" something, that's the output to the MQTT server. And "subscribing" is the other direction where a node defines the topics it is interested in.

From you other comment I take that the project basically works with the SJB-HS-20. Please don't wait for someone to improve it but try it yourself, because there are not that many users who have your setup. Use my previous comment as a starting point, select any entry of FRAME_BUTTON, e.g. "HEATER", modify the current code value to a previously unused value and test it by modifying "HEATER" via MQTT. Use codes where only 1 bit is set - there are not that many. This is the easiest way to find the missing mappings.

The SBH20 has 7 buttons, the SJB-HS has 9, with the extra functions JET and DISINFECTION. @mabeca96 has mentioned above that FILTER is 0x0080 and DISINFECTION is 0x0001, so it looks like only JET is missing. But some other mappings are not unique and need to be clarified. This is the current state of the mapping:

CODE FUNCTION
0x0001 DISINFECTION
0x0002 FILTER ?
0x0004
0x0008 BUBBLE ?
0x0010
0x0020
0x0040
0x0080 FILTER / TEMP_DOWN ?
0x0100
0x0200
0x0400 POWER
0x0800
0x1000 TEMP_UP / TEMP_UNIT ?
0x2000 TEMP_UNIT ?
0x4000
0x8000 HEATER
0x???? JET

Please give it a try and publish your test results.

@algermi
Copy link

algermi commented May 25, 2023

Hi Jens,

ca we speek in German. If you want we can also communicate by mail or whatsapp's. of course we share the obtained results here in english.

Where the adjustments have to be made. I think that if we put a little more energy into this together, we will get a final functional result.

@jnsbyr
Copy link
Owner

jnsbyr commented May 25, 2023

@algermi

Deutsch ist kein Problem, aber wir sollten auf GitHub bleiben.

Öffne die Datei SBH20IO.cpp mit deiner IDE (z.B. Arduino). Ab Zeile 86 findest du das Button-Mapping namespace FRAME_BUTTON. Ändere den Wert von HEATER auf einen der Werte, die in der Mapping-Liste oben noch nicht zugeordnet sind, erstelle die Firmware neu und ändere über MQTT pool/command/heater zwischen on und off und beobachte, ob etwas passiert und wenn ja, was. Das Ganze so lange wiederholen, bis du die fehlenden Mappings gefunden hast. Vorher solltest du alle MQTT-Kommandos ohne Änderung der Firmware einmal ausprobiert haben, damit du weißt, welche Mappings überhaupt schon richtig sind. Auch die MQTT-Ausgabewerte müssen überprüft werden - sie sollten mit den LEDs und Ziffern auf dem Display übereinstimmen. Setzt voraus, dass du zuerst einmal deine HomeKit-Anbindung zu laufen bekommst, und da kann ich dir nur wenig helfen.

Wenn es dir gelingt, das Mapping aller 9 Buttons des JSB-HS zu ermitteln, kann ich mit deinen Angaben das Programm so anpassen, dass es auch eigene MQTT-Kommandos für die beiden zusätzlichen Funktionen JET und DESINFECTION unterstützt.

Bitte berücksichtige, dass es bis jetzt nur Hinweise gibt, dass es funktionieren könnte. Das Ergebnis könnte auch sein, dass es nicht ausreicht, nur die Definition von FRAME_BUTTON anzupassen. Dann geht es wahrscheinlich ohne Logic-Analyser, Beharrlichkeit (Analysen, Programmieren, Testen) und eine Portion Glück nicht weiter.

@FireSale14
Copy link

Super,
sobald es hier mal bissel besseres Wetter ist werde ich den Pool aufbauen und dann durch testen.

@RianFlow
Copy link

RianFlow commented May 26, 2023

Hi. Sry wenn ich so dazwischen grätsche, aber hat einer von euch vielleicht eine genau Anleitung welche Dateien ich wo genau hin installieren muss auf den ESP? Und wie es mit ESPHome genau abläuft? Ich würde gerne zum steuern Home Assistant nutzen. Warscheinlich habe auch nur irgendwo was überlesen.
Meine Platine habe ich sonst soweit fertig, wäre der letzte schritt der mir noch fehlt!
Schon mal danke im Vorraus

@algermi
Copy link

algermi commented May 26, 2023

Servus zusammen,

also ich hab jetzt mal etwas rum probiert und das Ergebnis sieht folgendermaßen aus.

folgende Werte sind für die Steuerung relevant:

0x0001 DISINFECTION ##getestet

0x0002 BUBBLE ##getestet

0x0004

0x0008 JET ##getestet

0x0010

0x0020

0x0040

0x0080 FILTER ##getestet
0x0100

0x0200

0x0400 POWER ##getestet

0x0800

0x1000 TEMP_UP / TEMP_UNIT ?

0x2000 TEMP_UNIT ?

0x4000

0x8000 HEATER ##getestet

Die Funktionen wurden alle von mir erfolgreich getestet.
Was aktuelle eben noch nicht geht ist die Einstellung der Temperatur.
Die Abfrage der aktuellen Temperatur funktioniert auch.
was ich nicht hinbekomme ist die Steuerung über HomeKit als Thermostat um damit die Temperatur rauf oder runter zu stellen.

Kann mir jemand sagen, wie ich manuell also z.B. per Commandzeile MQTT Befehle absetzen kann. Vielleicht stimmt ja meine HomeKit Konfiguration für das Thermostat noch nicht.

english:

Hello all,

I have now tried something and the result looks like this.

The following values are relevant for the control:

0x0001 DISINFECTION ##tested

0x0002 BUBBLE ##tested

0x0004

0x0008 JET ##tested

0x0010

0x0020

0x0040

0x0080 FILTER ##tested
0x0100

0x0200

0x0400 POWER ##tested

0x0800

0x1000 TEMP_UP / TEMP_UNIT ?

0x2000 TEMP_UNIT ?

0x4000

0x8000 HEATER ##tested

The functions have all been tested successfully by me.
What is currently not working is the setting of the temperature.
The query of the current temperature also works.
What I can't manage is the control via HomeKit as a thermostat to set the temperature up or down.

Can anyone tell me how I can send MQTT commands manually, e.g. via command line. Perhaps my HomeKit configuration for the thermostat is not yet correct.

@algermi
Copy link

algermi commented May 26, 2023

@jnsbyr
Servus Jens, ich hoffe Du kannst mit den Info's etwas anfangen.
Meinst Du könntest bitte die neuen Funktionen mit aufnehmen.

Hi Jens, I hope you can do something with the information.
Do you think you could please include the new functions?

@algermi
Copy link

algermi commented May 26, 2023

Im ioBroker stehe ich alle Werte, auch die eingestellte und aktuelle Pooltemperatur

Bildschirmfoto 2023-05-26 um 11 06 10

@Elektroarzt
Copy link
Collaborator

Can anyone tell me how I can send MQTT commands manually, e.g. via command line. Perhaps my HomeKit configuration for the thermostat is not yet correct.

You can use the app MQTT Analyzer for iOS Devices for example or MQTT Explorer for MacOS. Both really suitable tools. Just add your Broker and subscribe to your pool topics and you're ready to rock'n roll

@algermi
Copy link

algermi commented May 28, 2023

Jetzt hätte ich nochmal eine Frage an die HomeKit Leute. Der Heizzustand ist ja on/off/standby.

So kann ich es auch im IOBROKER sehen. Jemand eine Idee wie man das im HomeKit visualisieren kann.

Standardmäßig wenn ich die Funktion als Switch einbaue, dann hab ich ja nur die Möglichkeit ON/OFF

en:

Now I have another question for the HomeKit people. The heating status is on/off/standby.

I can also see it in the IOBROKER. Does anyone have an idea how to visualise this in HomeKit?

By default, when I install the function as a switch, I only have the option ON/OFF.

@jnsbyr
Copy link
Owner

jnsbyr commented May 28, 2023

@algermi

Magst Du mir mal den Wert für TEMP_DOWN zukommen lassen, den DU herausgefunden hast.

Sehr gern, wäre toll wenn du da noch mal einen Blick 'drauf werfen könntest, bevor ich eine Firmware fertig mache:

namespace FRAME_BUTTON
{
  const uint16 DISINFECTION = 0x0001;
  const uint16 BUBBLE       = 0x0002;
  const uint16 JET          = 0x0008;
  const uint16 FILTER       = 0x0080;
  const uint16 POWER        = 0x0400;
  const uint16 TEMP_UP      = 0x1000;
  const uint16 TEMP_DOWN    = 0x0200;
  const uint16 TEMP_UNIT    = 0x2000;
  const uint16 HEATER       = 0x8000;
}

namespace FRAME_LED
{
  const uint16 POWER          = 0x0001;
  const uint16 BUBBLE         = 0x0002;  // max. 30 min
  const uint16 HEATER_ON      = 0x0080;  // max. 72 h, will start filter, will not stop filter
  const uint16 NO_BEEP        = 0x0100;
  const uint16 HEATER_STANDBY = 0x0200;
  const uint16 JET            = 0x0400;
  const uint16 FILTER         = 0x1000;  // max. 24 h
  const uint16 DISINFECTION   = 0x2000;  // max. 8 h
}

@algermi
Copy link

algermi commented May 28, 2023

@jnsbyr

servus, klar ich teste das mal durch. ich werde aber erst morgen dazukommen.

@algermi
Copy link

algermi commented May 28, 2023

@jnsbyr

Ich konnte es doch nicht lassen, also TEMP_DOWN 0x0200 ist korrekt und funktioniert nun auch.

en:

I couldn't leave it alone after all, so TEMP_DOWN 0x0200 is correct and now also works.

@jnsbyr
Copy link
Owner

jnsbyr commented May 28, 2023

@algermi
Vielen Dank für die Unterstützung. Dafür gibt es nun eine Firmware-Version zu testen, wo alle Funktionen gleichzeitig untersützt werden.

Experimental support for the Intex PureSpa SJB-HS has been added to the project and the new version 1.0.3.0 is available in the development branch for testing, see commit c185f1f, download here.

Changes:

  • no default PureSpa model, comment in the desired model variant at the top of common.h before building the firmware
  • class SBH20IO renamed to PureSpaIO

Notes:

  • reading and writing the disinfection time is not implemented (yet)
  • the hardware and firmware will probably support the Intex PureSpa SSP-H models with minor modifications

@algermi
Copy link

algermi commented May 30, 2023

Moin Jens,

ich hab jetzt mal die neue Firmware drauf. Vorher die Datei common.h

wie folgt angepasst:

Auszug aus der common.h

#ifndef COMMON_H
#define COMMON_H

#include
#include <../d1_mini/pins_arduino.h>

// select Intex PureSpa model by commenting in the desired variant
//#define MODEL_SB_H20
#define MODEL_SJB_HS

//#define SERIAL_DEBUG

Auch die Config.JSON hochgeladen.

Fehlermeldung im Serialmonitoring:

rf[112] : 0⸮unsupported Intex PureSpa model MQTT WiFi
Controller 1.0.3.0
build with Arduino Core for ESP8266 3.1.2
based on Espressif NONOS SDK 2.2.2-dev(38a443e)
config file loaded successfully (has 8 entries)
trying to connect to MQTT server ...
--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Exception (3):
epc1=0x4021f312 epc2=0x00000000 epc3=0x00000000 excvaddr=0x40251bf4 depc=0x00000000

stack>>>

ctx: cont
sp: 3ffffd60 end: 3fffffd0 offset: 0150
3ffffeb0: 514d0400 3f045454 3ffeef00 00000030
3ffffec0: 00000000 40251bf4 00000000 00000001
3ffffed0: 00000001 00000100 00000020 4010146c
3ffffee0: 3fff0bf4 00000010 3fff0978 3ffeef00
3ffffef0: 00000000 3ffef008 3ffeeb50 4020a8f0
3fffff00: 00000001 3ffe8952 00000001 3ffeef00
3fffff10: 00000000 3ffef008 3ffeeb50 40206731
3fffff20: 00000001 3ffe8952 3fff0978 40210a15
3fffff30: 00001148 00000229 3ffe8630 401010ea
3fffff40: 00000000 00000f86 87ef9db2 0011f38d
3fffff50: 00000000 3ffeeb50 3ffeeb50 3ffeef00
3fffff60: 3ffeeb18 3ffeeb50 3ffeeb50 4020693a
3fffff70: 3fffdad0 00000000 3ffeec38 40208791
3fffff80: 00000000 000c000f 00000000 40107924
3fffff90: 2404a8c0 feefeffe feefeffe 3ffef194
3fffffa0: 3fffdad0 00000000 3ffef168 3ffef194
3fffffb0: 3fffdad0 00000000 3ffef168 40211e48
3fffffc0: feefeffe feefeffe 3fffdab0 40101711
<<<stack<<<

rf[112] : 0⸮unsupported Intex PureSpa model MQTT WiFi Controller 1.0.3.0
build with Arduino Core for ESP8266 3.1.2
based on Espressif NONOS SDK 2.2.2-dev(38a443e)
config file loaded successfully (has 8 entries)
trying to connect to MQTT server ...
--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Exception (3):
epc1=0x4021f312 epc2=0x00000000 epc3=0x00000000 excvaddr=0x40251bf4 depc=0x00000000

stack>>>

ctx: cont
sp: 3ffffd60 end: 3fffffd0 offset: 0150
3ffffeb0: 514d0400 3f045454 3ffeef00 00000030
3ffffec0: 00000000 40251bf4 00000000 00000001
3ffffed0: 00000001 00000100 00000020 4010146c
3ffffee0: 3fff0bf4 00000010 3fff0978 3ffeef00
3ffffef0: 00000000 3ffef008 3ffeeb50 4020a8f0
3fffff00: 00000001 3ffe8952 00000001 3ffeef00
3fffff10: 00000000 3ffef008 3ffeeb50 40206731
3fffff20: 00000001 3ffe8952 3fff0978 40210a15
3fffff30: 00001148 00000229 3ffe8630 401010ea
3fffff40: 00000000 00000f86 87ef9db2 0011f38d
3fffff50: 00000000 3ffeeb50 3ffeeb50 3ffeef00
3fffff60: 3ffeeb18 3ffeeb50 3ffeeb50 4020693a
3fffff70: 3fffdad0 00000000 3ffeec38 40208791
3fffff80: 00000000 000c000f 00000000 40107924
3fffff90: 2404a8c0 feefeffe feefeffe 3ffef194
3fffffa0: 3fffdad0 00000000 3ffef168 3ffef194
3fffffb0: 3fffdad0 00000000 3ffef168 40211e48
3fffffc0: feefeffe feefeffe 3fffdab0 40101711
<<<stack<<<

@jnsbyr
Copy link
Owner

jnsbyr commented May 30, 2023

@algermi

Danke für's testen. Hatte gehofft, ohne Hardware-Test auszukommen, aber es sollte nicht sein.

Konnte aber ein passendens ESP8266 Board finden und damit die Exception nachvollziehen. Der Fehler war erwartungsgemäß nicht offensichtlich, aber nach genauerer Betrachtung nachvollziehbar: Der Modellname ist mit der neuen Version variabel geworden. Der in PureSpaIO::getModelName() mit PSTR geladene Text ist vom Datentyp ein const char*, aber nicht wirklich "const", so dass es beim Zugriff durch den MQTTClient zu einem Fehler kam.

Bitte probiers noch mal mit der neuen Version 1.0.3.1 aus dem develop-Branch.

@algermi
Copy link

algermi commented May 30, 2023

Servus Jens,

also erster Funktionstest abgeschlossen. Danke für's nachbessern des Scripts.

Model wird richtig erkannt. Intex PureSpa SJB-HS

pool/command/jet geht nur on, off geht nicht. 2. mal on senden, dann geht der Jet wieder aus, bei Bubble geht on/off.

pool/command/disinfection on, dann schaltet er auf 3 Stunden Desinfektion. Mehrmals "on" senden bringt keine Veränderung. Also aktuell keine Auswahl 3/5/8 Stunden.

Heater On/Off geht.

Filter On/Off geht

Mega Job, Geiler Schei... .

Mit Dir kann man arbeiten. :-)

@algermi
Copy link

algermi commented May 30, 2023

@jnsbyr

was ich gerade noch bemerkt habe, bei Filter=on, da schickt er anscheinend gleich wieder ein "off" hinterher.
Filter bleibt zwar an, aber im MQTT Server sehe ich folgenden Eintrag.
Weiss jetzt nicht ob das von Dir kommt, ich sehe auch im HomeKit, wenn ich den Schalter anschalte nur kurz on, dann springt der auf off.

Wie bereits erwähnt, bei den Bubbles klappt alles wunderbar, meine HomeKit Settings sind bis auf die "Steuergeräte" identisch konfiguriert.

Auch wenn ich den Heater anschalte, dann geht ja automatisch der Filter mit an, das kann ich auch nicht erkennen im MQTT Client, da bleibt Filter auf Off.

Log:
May 30 15:59:25 raspberrypi homebridge[596]: [30.5.2023, 15:59:25] [Filter] Received MQTT: pool/filter = on
May 30 15:59:25 raspberrypi homebridge[596]: [30.5.2023, 15:59:25] [Filter] Received MQTT: pool/filter = off

@jnsbyr
Copy link
Owner

jnsbyr commented May 30, 2023

@algermi

Mit Dir kann man arbeiten.

Dito. Da ich kein SJB-HS habe und mir wohl auch keiner seins für die Entwicklung vorbeibringt, geht so zusammen trotzdem :-)

... bei Filter=on, da schickt er anscheinend gleich wieder ein "off" hinterher.

Habe noch einen Copy&Past-Bug gefunden, wo der Zustand der Desinfektion als Filterzustand gemeldet wurde. Neue Version 1.0.3.2 verfügbar. Wahrscheinlich ist das der Grund.

Auch wenn ich den Heater anschalte, dann geht ja automatisch der Filter mit an ...

Das macht die Intex-Steuerung.

... das kann ich auch nicht erkennen im MQTT Client, da bleibt Filter auf Off.

Sollte eigentlich nicht so sein. Nimm die neue Version, schalte manuell am Display den Filter ein- und aus und beobachte, ob das per MQTT gemeldet wird.

pool/command/jet geht nur on, off geht nicht. 2. mal on senden, dann geht der Jet wieder aus

Das kann ich leider nicht seblst nachvollziehen. Das erfolgreiche Umschalten hängt u.a. von der LED-Zuordnung ab. Schalte noch mal manuell am Display den Jet ein- und aus und beobachte, ob jede Änderung per MQTT gemeldet wird.

pool/command/disinfection on, dann schaltet er auf 3 Stunden Desinfektion. Mehrmals "on" senden bringt keine Veränderung. Also aktuell keine Auswahl 3/5/8 Stunden.

Habe inzwischen einen möglichen Lösungsansatz, aber der ist relativ aufwendig. Würde gern erst die anderen Punkte oben alle abgefrühstückt haben. Du solltest die Zeit manuell am Display einstellen können. Bitte Info, ob sich die Intex-Steuerung beim Neustart der Desinfektion den zuletzt verwendeten Wert merkt oder z.B. immer 3 h vorschlägt.

@algermi
Copy link

algermi commented May 30, 2023

@jnsbyr

Servus,
ich werd morgen mal die neue Firmware testen, wie bereits erwähnt steht Dir mein SJB-HS gerne Remote zur Verfügung. Denke aber wir bekommen das final noch gelöst. Schönen Abend noch.

Lg Alex

@algermi
Copy link

algermi commented May 31, 2023

@jnsbyr

Moin Jens, also das mit dem Filter-Thema ist nun gefixt.

JET-Thema ist noch offen. Wenn ich per Display JET ON/OFF schalte, wir im MQTT sauber mit protokolliert. (pool/jet = on oder off)

wenn ich

pool/command/jet On/Off senden, da greift das Kommando (command) aber scheinbar wird der Topic Pool/JET nicht aktualisiert.

Zu diesem Thema:
(Bitte Info, ob sich die Intex-Steuerung beim Neustart der Desinfektion den zuletzt verwendeten Wert merkt oder z.B. immer 3 h vorschlägt.)

Beim drücken des Buttons Desinfektion wird immer als erstes der Wert 3 h vorgeschlagen, erneutes drücken des Buttons ändert dann auf 5 h und nochmaliges drücken auf 8 h.

@jnsbyr
Copy link
Owner

jnsbyr commented May 31, 2023

@algermi

Danke für die Rückmeldungen. Es gibt mal wieder eine neue Version (1.0.3.3, 403366e), die möglicherweise das Problem mit dem Jet löst.

Zur Desinfektion: Ich gehe davon aus, dass du mit "erneutes drücken des Buttons" den Desinfektions-Button meinst. Hier werden also nicht die hoch/runter-Buttons verwendet, oder doch? Mir wäre dann unklar, wie man die Desinfektion ein- und ausschaltet. Muss man dann 4x drücken?

@algermi
Copy link

algermi commented Jun 1, 2023

@jnsbyr

Moin, genau richtig, die Hoch/Runter-Buttons spielen für die Desinfektion keine Rolle.

Wenn der Desinfektionsbutton 4 mal hintereinander gedrückt wird ist die Desinfektion "wieder deaktiviert" d.h. das Desinfektionsprogramm startet nicht. Wenn das Desinfektionsprogramm z.B. 3 Stunden läuft und man es abschalten will, so muss man 4 mal drücken, läuft das Desinfektionsprogramm für 5 Stunden und soll beendet werden, dann muss man 3 mal drücken usw.

Die neue Version werde ich mir gleich mal testen und gebe dir wieder bescheid.

@algermi
Copy link

algermi commented Jun 1, 2023

@jnsbyr

Moin nochmal. Das Thema Jet ist Erld. on/off command funktioniert.

@jnsbyr
Copy link
Owner

jnsbyr commented Jun 1, 2023

Super, danke fürs testen. 👍 Werde die aktuelle Version als "stabil" freigeben,

Mit deinen Rückmeldungen zur Bedienung der Desinfektion werde ich mir eine Lösung überlegen. Diese Erweiterung erfordert allerdings größere Umbaumaßnahmen an einer anderen Stelle, deshalb werde ich mir dafür ein paar Wochen Zeit nehmen.

@algermi
Copy link

algermi commented Jun 2, 2023

@jnsbyr
Moin Jens, denke das mit der Desinfektion ist nicht zeitkritisch, wichtig ist, das sie überhaupt läuft. Danke Dir für Deine Bemühungen

@mabeca96
Copy link

mabeca96 commented Jun 4, 2023 via email

@jnsbyr
Copy link
Owner

jnsbyr commented Jun 4, 2023

@mabeca96

Bitte folge den im README unter Firmware beschriebenen Hinweisen.

Zusätzlich brauchst du vielleicht einen USB/Seriell-Adapter, wenn du kein Wemos D1 board verwendest. Wie man den an den ESP8266 anschließt, ist schon sehr oft an anderer Stelle in verschiedenen Sprachen beschrieben worden, nimm einfach deine Lieblings-Suchmaschine.

Wenn die Verkabelung steht und die Firmware mit der Arduino IDE erfolgreich kompiliert wurde, gib es da auch noch einen "Hochladen" Button.

Wenn das nicht reichen sollte, dann versuche etwas genauer zu beschreiben, womit du Schwierigkeiten hast und öffne dafür ein neues Issue.

@jnsbyr jnsbyr mentioned this issue Jun 10, 2023
@FireSale14
Copy link

Hi,
erstmal viele lieben dank für eure Mühen. Wirklich tolle Arbeit.
Ich habe meinen SJB nun auch endlich in Betrieb (hat ein loch).
Funktioniert auch eigentlich alles. Der ESP verbindet sich mit dem WLAN und dem MQTT Server. Leider verbindet er sich ca. alle 5 Sekunden neu mit dem MQTT Server. Ich habe auch schon einen neuen ESP probiert und einen Hardware defekt auszuschließen. So lang der ESP nicht mit dem Pool verbunden ist funktioniert auch "alles". Er verbindet sich ganz normal. Verbindet man die Datenleitungen beginnt es das er sich alle paar Sekunden mit dem Server neu verbindet.
Hat jemand eine Idee?

Vielen dank

@jnsbyr
Copy link
Owner

jnsbyr commented Jun 11, 2023

@FireSale14
Even if its not easy, try English, you will probably reach more people who could help.

First make sure you use the version 1.0.3.3 form the main branch.

From your description it might be possible that the MQTT server immediately tries to change the temperature when connecting and that fails somehow. You should know that the firmware always needs to disconnects for this, but typically this happens only once.

You might get more infos if you enable the debug output by commenting in the define at the top of common.h. Have a look for yourself and if it does not tell you anything, post the most interesting part, preferably as a new issue.

@jnsbyr
Copy link
Owner

jnsbyr commented Jun 18, 2023

@algermi & all other SJB-HS users

There is a new firmware version 1.0.5.1 in branch develop, commit 8500722, that supports reading the disinfection time (see updated README).

Before I will make this an official release I would prefer to get your feedback if it is working as expected, because I do not have a SJB-HS to test it myself.

@SpaWnOL68
Copy link

@jnsbyr
I tried the firmware version 1.0.5.1 and i can have now the disinfection time. The switch seems to work in HA but the state is UNKNOWN for pool/command/disinfection

@jnsbyr
Copy link
Owner

jnsbyr commented Jun 21, 2023

@SpaWnOL68
Thanks for your feedback.

Reading the disinfection time and writing the disinfection command are separate things. The new firmware "only" improves on the reading to find out, if it works at all.

With your test result I will be able to make a modification for the disinfection command. It currently supports the values on/off but will actually toggle through the available time settings, right? The next version will probably be able to set a specific disinfection time.

@SpaWnOL68
Copy link

SpaWnOL68 commented Jun 21, 2023

@jnsbyr

It currently supports the values on/off but will actually toggle through the available time settings, right?

Yes, exactly. 0 = Off and 3/5/8 = On
Great improvement, thanks !
Tell me when the new version is available

@jnsbyr
Copy link
Owner

jnsbyr commented Jun 23, 2023

There is a new firmware version 1.0.5.2 in branch develop, commit ebe17e5, that supports setting the disinfection time (see updated README).

The MQTT disinfection command now requires hours (0,3,5,8) instead of on/off.

Please test and report what happens when you use this new feature.

@SpaWnOL68
Copy link

SpaWnOL68 commented Jul 8, 2023

There is a new firmware version 1.0.5.2 in branch develop, commit ebe17e5, that supports setting the disinfection time (see updated README).

The MQTT disinfection command now requires hours (0,3,5,8) instead of on/off.

Please test and report what happens when you use this new feature.

Hello,

I tried with the new firmware.
I added a selector in my config :

Intex Desinfection Time Input Select

  • unique_id: mqtt_intex_desinfection
    command_topic: pool/command/disinfection
    state_topic: pool/disinfection
    name: intex_desinfection
    options:
    - "0"
    - "3"
    - "5"
    - "8"
    -
    And everything seems to work well for 1 week
    Thanks !

@jnsbyr
Copy link
Owner

jnsbyr commented Aug 4, 2023

Thank for testing and reporting back.

FYI: There is a new release that includes the features that @SpaWnOL68 has tested and additionally avoids disconnecting the MQTT connection while changing the desired water temperature. The new method, though a little slower than the previous approach, mimics the human behaviour when operating the buttons on the physical Intex panel by "listening" to the buzzer and continuously "reading" the new setpoint value from the display. It may still happen temporarily that the setpoint is changed by more than 1 degree in one step, but if this happens when the desired value has been exceeded the new code will simply reverse the direction so that the desired value is still set and saved.

Background: In issue #15 RealByron suggested an alternative approach to set the desired water temperature by extending the length of the reply pulse until the falling edge of the latch signal. I tried this variant but had to abandon it, because:

  1. extending the pulse length significantly over 2 µs breaks the specification of the Intex original
  2. an edge interrupt might be executed with significant delay while the ESP8266 handles WiFi causing undefined extension of the reply pulse length so that the data line is still blocked by the ESP8266 when the Intex PureSpa is already talking again
  3. the code build with ESP SDK 2.7.4 ran into exceptions - the stack trace looked similar to a stack overflow where the newly introduced ISR was called again and again

@jnsbyr jnsbyr closed this as completed Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

8 participants