Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Hardware
  4. Lay-Z-Spa Wifi Control

NEWS

  • Monatsrückblick Januar/Februar 2026 ist online!
    BluefoxB
    Bluefox
    13
    1
    146

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    17
    1
    4.3k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.3k

Lay-Z-Spa Wifi Control

Scheduled Pinned Locked Moved Hardware
211 Posts 76 Posters 56.4k Views 72 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K kukoratsch

    @kukoratsch sagte in Lay-Z-Spa Wifi Control:

    @timowald
    Hast du auch im Script MQTTINSTANCE angepasst
    Screenshot 2024-07-09 134601.png
    bei dir ist das 2

    Hast du das auch gemacht

    T Online
    T Online
    TimoWald
    wrote on last edited by
    #144

    @kukoratsch hast du noch einen Tip für mich?

    K 1 Reply Last reply
    0
    • E emblitz

      Hallo,

      ich habe ebenfalls heute meinem Santorini smart gemacht. Super Projekt.
      In IOBroker bekomme ich über MQTT zwar die Datenpunkte aber keine Werte.
      Kann mir jemand verraten, was ich nun machen muss um die Werte angezeigt zu bekommen?
      Wenn ich das o.g. Skript verwenden muss, ist mir nicht klar wie.
      In den Objekten sieht es dann so aus:
      2022-05-10-Image 001.jpg
      LG
      emblitz.

      T Online
      T Online
      TimoWald
      wrote on last edited by
      #145

      @emblitz Hallo hast du die Werte jetzt in Userdata? Ich habe auch den Santorini aber bekomme sie nicht in Userdata.
      MQTTINSTANCE ist angepasst auf instant 2. Was mache ich noch falsch?

      1 Reply Last reply
      0
      • T TimoWald

        @kukoratsch hast du noch einen Tip für mich?

        K Offline
        K Offline
        kukoratsch
        wrote on last edited by
        #146

        @timowald
        Zeig mal die drei screenshot von dir
        Screenshot 2024-07-15 103551.png
        Screenshot 2024-07-15 103642.png
        Screenshot 2024-07-15 103823.png

        T 1 Reply Last reply
        0
        • K kukoratsch

          @timowald
          Zeig mal die drei screenshot von dir
          Screenshot 2024-07-15 103551.png
          Screenshot 2024-07-15 103642.png
          Screenshot 2024-07-15 103823.png

          T Online
          T Online
          TimoWald
          wrote on last edited by
          #147

          @kukoratsch Hallo hier die gewünschten Screenshots

          f8ff55ce-1639-4e5a-b5f5-dcdc560f03db-grafik.png
          40a62c18-9651-4b25-9109-9d8c01520094-grafik.png
          1b9c9e5f-68f6-4535-93f5-f46fcafd66d4-grafik.png

          K 1 Reply Last reply
          0
          • T TimoWald

            @kukoratsch Hallo hier die gewünschten Screenshots

            f8ff55ce-1639-4e5a-b5f5-dcdc560f03db-grafik.png
            40a62c18-9651-4b25-9109-9d8c01520094-grafik.png
            1b9c9e5f-68f6-4535-93f5-f46fcafd66d4-grafik.png

            K Offline
            K Offline
            kukoratsch
            wrote on last edited by kukoratsch
            #148

            @timowald und Screenshots vom MQTT Adapter
            192.168.9.254 ist die IP ioBroker?

            T 1 Reply Last reply
            0
            • K kukoratsch

              @timowald und Screenshots vom MQTT Adapter
              192.168.9.254 ist die IP ioBroker?

              T Online
              T Online
              TimoWald
              wrote on last edited by
              #149

              @kukoratsch ja genau.

              K 1 Reply Last reply
              0
              • T TimoWald

                @kukoratsch ja genau.

                K Offline
                K Offline
                kukoratsch
                wrote on last edited by
                #150

                @timowald Screenshot 2024-07-15 103823.png
                und Screenshots vom MQTT Objekten?

                T 1 Reply Last reply
                0
                • K kukoratsch

                  @timowald Screenshot 2024-07-15 103823.png
                  und Screenshots vom MQTT Objekten?

                  T Online
                  T Online
                  TimoWald
                  wrote on last edited by
                  #151

                  @kukoratsch ach ne sorry. Das sind die angelegten von user.data

                  T 1 Reply Last reply
                  0
                  • T TimoWald

                    @kukoratsch ach ne sorry. Das sind die angelegten von user.data

                    T Online
                    T Online
                    TimoWald
                    wrote on last edited by TimoWald
                    #152

                    @timowald das sind die von MQTT
                    IMG_2186.jpeg

                    T 1 Reply Last reply
                    0
                    • T TimoWald

                      @timowald das sind die von MQTT
                      IMG_2186.jpeg

                      T Online
                      T Online
                      TimoWald
                      wrote on last edited by TimoWald
                      #153

                      @timowald
                      IMG_2186.jpeg

                      Bin mit Handy online. Deswegen das schlechte Bild.

                      K 1 Reply Last reply
                      0
                      • T TimoWald

                        @timowald
                        IMG_2186.jpeg

                        Bin mit Handy online. Deswegen das schlechte Bild.

                        K Offline
                        K Offline
                        kukoratsch
                        wrote on last edited by
                        #154

                        @timowald Hast du auch wirklich 3 MQTT Instanzen?

                        T 1 Reply Last reply
                        0
                        • K kukoratsch

                          @timowald Hast du auch wirklich 3 MQTT Instanzen?

                          T Online
                          T Online
                          TimoWald
                          wrote on last edited by
                          #155

                          @kukoratsch ja habe ich. 2x Fronius und layzspa

                          K 1 Reply Last reply
                          0
                          • T TimoWald

                            @kukoratsch ja habe ich. 2x Fronius und layzspa

                            K Offline
                            K Offline
                            kukoratsch
                            wrote on last edited by kukoratsch
                            #156

                            @timowald Die daten von Wifi Control kommen an
                            Versuch es mal skript vom 54 Post

                            T 1 Reply Last reply
                            0
                            • K kukoratsch

                              @timowald Die daten von Wifi Control kommen an
                              Versuch es mal skript vom 54 Post

                              T Online
                              T Online
                              TimoWald
                              wrote on last edited by
                              #157

                              @kukoratsch hatte ich auch schon. Keine Änderung.

                              K 1 Reply Last reply
                              0
                              • T TimoWald

                                @kukoratsch hatte ich auch schon. Keine Änderung.

                                K Offline
                                K Offline
                                kukoratsch
                                wrote on last edited by kukoratsch
                                #158

                                @timowald Screenshot 2024-07-15 154831.png
                                bei command kommt nichts an
                                mach einfach wie bei mirScreenshot 2024-07-15 103551.png
                                und nimm mal skript vom 54 Post
                                und instanz nicht vergessen zu ändern im Script

                                T 1 Reply Last reply
                                0
                                • K kukoratsch

                                  @timowald Screenshot 2024-07-15 154831.png
                                  bei command kommt nichts an
                                  mach einfach wie bei mirScreenshot 2024-07-15 103551.png
                                  und nimm mal skript vom 54 Post
                                  und instanz nicht vergessen zu ändern im Script

                                  T Online
                                  T Online
                                  TimoWald
                                  wrote on last edited by
                                  #159

                                  @kukoratsch Habe ich gemacht aber ohne das Skript aus 54 und jetzt geht es. Aber woran soll es nun gelegen haben?

                                  K 1 Reply Last reply
                                  0
                                  • T TimoWald

                                    @kukoratsch Habe ich gemacht aber ohne das Skript aus 54 und jetzt geht es. Aber woran soll es nun gelegen haben?

                                    K Offline
                                    K Offline
                                    kukoratsch
                                    wrote on last edited by
                                    #160

                                    @timowald Screenshot 2024-07-15 163912.png

                                    T 1 Reply Last reply
                                    0
                                    • K kukoratsch

                                      @timowald Screenshot 2024-07-15 163912.png

                                      T Online
                                      T Online
                                      TimoWald
                                      wrote on last edited by
                                      #161

                                      @kukoratsch Hmm, verstehe trotzdem nicht.

                                      T 1 Reply Last reply
                                      0
                                      • T TimoWald

                                        @kukoratsch Hmm, verstehe trotzdem nicht.

                                        T Online
                                        T Online
                                        TimoWald
                                        wrote on last edited by
                                        #162

                                        Habe im Log solche Meldungen. Sind die normal?

                                        2024-07-16 19:12:18.587 - info: javascript.0 (211416) script.js.common.Pool_Zeiten: Lazyspa reached message! {"val":"{\"CONTENT\":\"STATES\",\"TIME\":1721149938,\"LCK\":0,\"PWR\":1,\"UNT\":1,\"AIR\":0,\"GRN\":0,\"RED\":0,\"FLT\":0,\"CH1\":32,\"CH2\":50,\"CH3\":57,\"HJT\":0,\"BRT\":8,\"ERR\":0,\"GOD\":0,\"TGT\":31,\"TMP\":29,\"VTMC\":30.0177021,\"VTMF\":86.03186035,\"AMBC\":22,\"AMBF\":72,\"AMB\":22,\"VTM\":30.0177021,\"TGTC\":31,\"TMPC\":29,\"TGTF\":88,\"TMPF\":84}","ts":1721149938563,"ack":true,"lc":1721149938563,"from":"system.adapter.mqtt.2","q":0,"user":"system.user.admin"}
                                        2024-07-16 19:12:18.627 - warn: hass.0 (209534) State "hass.0.entities.device_tracker.b72dc917_f709_d720_4de0_4ec21b5e808a.ssid" has no existing object, this might lead to an error in future versions
                                        2024-07-16 19:12:18.833 - info: javascript.0 (211416) script.js.common.Pool_Zeiten: Lazyspa reached message! {"val":"{\"CONTENT\":\"STATES\",\"TIME\":1721149938,\"LCK\":0,\"PWR\":1,\"UNT\":1,\"AIR\":0,\"GRN\":0,\"RED\":0,\"FLT\":1,\"CH1\":32,\"CH2\":50,\"CH3\":57,\"HJT\":0,\"BRT\":8,\"ERR\":0,\"GOD\":0,\"TGT\":31,\"TMP\":29,\"VTMC\":30.01764679,\"VTMF\":86.03176117,\"AMBC\":22,\"AMBF\":72,\"AMB\":22,\"VTM\":30.01764679,\"TGTC\":31,\"TMPC\":29,\"TGTF\":88,\"TMPF\":84}","ts":1721149938825,"ack":true,"lc":1721149938825,"from":"system.adapter.mqtt.2","q":0,"user":"system.user.admin"}
                                        2024-07-16 19:12:22.720 - info: javascript.0 (211416) script.js.common.Pool_Zeiten: Lazyspa reached message! {"val":"{\"CONTENT\":\"STATES\",\"TIME\":1721149942,\"LCK\":0,\"PWR\":1,\"UNT\":1,\"AIR\":0,\"GRN\":0,\"RED\":0,\"FLT\":1,\"CH1\":32,\"CH2\":51,\"CH3\":48,\"HJT\":0,\"BRT\":8,\"ERR\":0,\"GOD\":0,\"TGT\":31,\"TMP\":30,\"VTMC\":30.01674652,\"VTMF\":86.03014374,\"AMBC\":22,\"AMBF\":72,\"AMB\":22,\"VTM\":30.01674652,\"TGTC\":31,\"TMPC\":30,\"TGTF\":88,\"TMPF\":86}","ts":1721149942719,"ack":true,"lc":1721149942719,"from":"system.adapter.mqtt.2","q":0,"user":"system.user.admin"}
                                        2024-07-16 19:12:25.464 - info: javascript.0 (211416) script.js.common.Pool_Zeiten: Lazyspa reached message! {"val":"{\"CONTENT\":\"STATES\",\"TIME\":1721149945,\"LCK\":0,\"PWR\":1,\"UNT\":1,\"AIR\":0,\"GRN\":0,\"RED\":0,\"FLT\":1,\"CH1\":32,\"CH2\":51,\"CH3\":49,\"HJT\":0,\"BRT\":8,\"ERR\":0,\"GOD\":0,\"TGT\":31,\"TMP\":31,\"VTMC\":30.01612854,\"VTMF\":86.02902985,\"AMBC\":22,\"AMBF\":72,\"AMB\":22,\"VTM\":30.01612854,\"TGTC\":31,\"TMPC\":31,\"TGTF\":88,\"TMPF\":88}","ts":1721149945463,"ack":true,"lc":1721149945463,"from":"system.adapter.mqtt.2","q":0,"user":"system.user.admin"}
                                        2024-07-16 19:12:33.512 - info: javascript.0 (211416) script.js.common.Pool_Zeiten: change state! {"id":"0_userdata.0.Layz-Santorini.HJT","newState":{"val":true,"ts":1721149953510,"ack":false,"lc":1721149953510,"from":"system.adapter.admin.0","q":0,"user":"system.user.admin"},"oldState":{"val":false,"ts":1721149945481,"ack":true,"lc":1721143303698,"from":"system.adapter.javascript.0","q":0,"c":"script.js.common.Pool_Zeiten","user":"system.user.admin"},"state":{"val":true,"ts":1721149953510,"ack":false,"lc":1721149953510,"from":"system.adapter.admin.0","q":0,"user":"system.user.admin"}}
                                        2024-07-16 19:12:33.512 - info: javascript.0 (211416) script.js.common.Pool_Zeiten: change UnitHJT
                                        2024-07-16 19:12:33.512 - info: javascript.0 (211416) script.js.common.Pool_Zeiten: set Hydrojets to 1
                                        2024-07-16 19:12:34.059 - info: javascript.0 (211416) script.js.common.Pool_Zeiten: Lazyspa reached message! {"val":"{\"CONTENT\":\"STATES\",\"TIME\":1721149953,\"LCK\":0,\"PWR\":1,\"UNT\":1,\"AIR\":0,\"GRN\":0,\"RED\":0,\"FLT\":0,\"CH1\":32,\"CH2\":51,\"CH3\":49,\"HJT\":1,\"BRT\":8,\"ERR\":0,\"GOD\":0,\"TGT\":31,\"TMP\":31,\"VTMC\":30.01421165,\"VTMF\":86.02558136,\"AMBC\":22,\"AMBF\":72,\"AMB\":22,\"VTM\":30.01421165,\"TGTC\":31,\"TMPC\":31,\"TGTF\":88,\"TMPF\":88}","ts":1721149954058,"ack":true,"lc":1721149954058,"from":"system.adapter.mqtt.2","q":0,"user":"system.user.admin"}
                                        2024-07-16 19:12:35.413 - warn: roborock.0 (COMPACT) MQTT connection close.
                                        2024-07-16 19:12:36.414 - warn: roborock.0 (COMPACT) MQTT connection reconnect.
                                        2024-07-16 19:12:43.232 - info: javascript.0 (211416) script.js.common.Pool_Zeiten: change state! {"id":"0_userdata.0.Layz-Santorini.HJT","newState":{"val":false,"ts":1721149963231,"ack":false,"lc":1721149963231,"from":"system.adapter.admin.0","q":0,"user":"system.user.admin"},"oldState":{"val":true,"ts":1721149954077,"ack":true,"lc":1721149953510,"from":"system.adapter.javascript.0","q":0,"c":"script.js.common.Pool_Zeiten","user":"system.user.admin"},"state":{"val":false,"ts":1721149963231,"ack":false,"lc":1721149963231,"from":"system.adapter.admin.0","q":0,"user":"system.user.admin"}}
                                        2024-07-16 19:12:43.233 - info: javascript.0 (211416) script.js.common.Pool_Zeiten: change UnitHJT
                                        2024-07-16 19:12:43.233 - info: javascript.0 (211416) script.js.common.Pool_Zeiten: set Hydrojets to 0
                                        2024-07-16 19:12:43.457 - info: javascript.0 (211416) script.js.common.Pool_Zeiten: Lazyspa reached message! {"val":"{\"CONTENT\":\"STATES\",\"TIME\":1721149963,\"LCK\":0,\"PWR\":1,\"UNT\":1,\"AIR\":0,\"GRN\":0,\"RED\":0,\"FLT\":0,\"CH1\":32,\"CH2\":51,\"CH3\":49,\"HJT\":0,\"BRT\":8,\"ERR\":0,\"GOD\":0,\"TGT\":31,\"TMP\":31,\"VTMC\":30.01207161,\"VTMF\":86.02172852,\"AMBC\":22,\"AMBF\":72,\"AMB\":22,\"VTM\":30.01207161,\"TGTC\":31,\"TMPC\":31,\"TGTF\":88,\"TMPF\":88}","ts":1721149963456,"ack":true,"lc":1721149963456,"from":"system.adapter.mqtt.2","q":0,"user":"system.user.admin"}
                                        2024-07-16 19:12:43.880 - info: javascript.0 (211416) script.js.common.Pool_Zeiten: Lazyspa reached message! {"val":"{\"CONTENT\":\"STATES\",\"TIME\":1721149963,\"LCK\":0,\"PWR\":1,\"UNT\":1,\"AIR\":0,\"GRN\":0,\"RED\":0,\"FLT\":0,\"CH1\":32,\"CH2\":51,\"CH3\":49,\"HJT\":0,\"BRT\":8,\"ERR\":0,\"GOD\":0,\"TGT\":31,\"TMP\":31,\"VTMC\":30.01197624,\"VTMF\":86.02156067,\"AMBC\":22,\"AMBF\":72,\"AMB\":22,\"VTM\":30.01197624,\"TGTC\":31,\"TMPC\":31,\"TGTF\":88,\"TMPF\":88}","ts":1721149963879,"ack":true,"lc":1721149963879,"from":"system.adapter.mqtt.2","q":0,"user":"system.user.admin"}
                                        
                                        1 Reply Last reply
                                        0
                                        • Agria4800A Agria4800

                                          @agria4800 : Anbei das Script für die Leute mit dem Layz Hawaii oder Maldives (mit den Hydrojet Düsen) ;-)

                                          // https://forum.iobroker.net/topic/51603/lay-z-spa-wifi-control?_=1655490942180&lang=de
                                          
                                          /*Notes for me
                                          
                                          Last filter change was 0.00 day(s) ago.  RESET Button gedrückt!
                                          {"CMD":10,"VALUE":0,"XTIME":1658859596,"INTERVAL":0}
                                          
                                          
                                          Last chlorine add was 0.00 day(s) ago.
                                          {"CMD":9,"VALUE":0,"XTIME":1658859652,"INTERVAL":0}
                                          */
                                          
                                          const Messages =  
                                          {
                                           "CONTENT": "STATES",
                                           "LCK": 0,
                                           "PWR": 0,
                                           "UNT": 1,
                                           "AIR": 0,
                                           "GRN": 0,
                                           "RED": 0,
                                           "FLT": 0,
                                           "TGT": 22,
                                           "TMP": 13,
                                           "CH1": 32,
                                           "CH2": 49,
                                           "CH3": 51,
                                           "HJT": 0,
                                           "BRT": 7
                                          }
                                          const ID = '0_userdata.0.Layz-Hydro';
                                          const MQTTINSTANCE = 0;
                                          const debug = true;
                                          /*
                                          {
                                           "CONTENT": "TIMES",
                                           "TIME": 1650746370,
                                           "CLTIME": 1644734714,
                                           "FTIME": 1644734719,
                                           "UPTIME": 41660,
                                           "PUMPTIME": 50,
                                           "HEATINGTIME": 24,
                                           "AIRTIME": 512,
                                           "JETTIME": 4294966,
                                           "COST": 0,
                                           "FINT": 4294967295,
                                           "CLINT": 4294967295,
                                           "KWH": null,
                                           "TTTT": -74677
                                          }
                                          */
                                          const STATES=[
                                             {
                                                 _id: 'LCK',
                                                 type: 'state',
                                                 common: {
                                                     name: 'lock',
                                                     type: 'boolean',
                                                     role: 'switch',
                                                     read: true,
                                                     write: false,
                                                     desc: 'Lazy spa lock'
                                                 },
                                                 native: {}
                                             },
                                             {
                                                 _id: 'PWR',
                                                 type: 'state',
                                                 common: {
                                                     name: 'power',
                                                     type: 'boolean',
                                                     role: 'switch.power',
                                                     read: true,
                                                     write: true,
                                                     desc: 'Lazy spa power'
                                                 },
                                                 native: {}
                                             },
                                             {
                                             _id: 'UNT',
                                             type: 'state',
                                             common: {
                                                 name: 'unit',
                                                 type: 'number',
                                                 role: 'value',
                                                 read: true,
                                                 write: true,
                                                 max: 1,
                                                 desc: 'Lazy spa unit',
                                                 states: {
                                             			0: 'Farenheit',
                                             			1: 'Celsius'
                                             		}
                                             },
                                                native: {}
                                             },
                                             {
                                             _id: 'HJT',
                                             type: 'state',
                                             common: {
                                                 name: 'Hydrojet',
                                                 type: 'boolean',
                                                 role: 'switch',
                                                 read: true,
                                                 write: true,
                                                 desc: 'Lazy spa Hydrojets state'
                                             },
                                                native: {}
                                             },
                                             {
                                             _id: 'AIR',
                                             type: 'state',
                                             common: {
                                                 name: 'bubbles',
                                                 type: 'boolean',
                                                 role: 'switch',
                                                 read: true,
                                                 write: true,
                                                 desc: 'Lazy spa bubbles state'
                                             },
                                             native: {}
                                             },
                                             {
                                             _id: 'GRN',
                                             type: 'state',
                                             common: {
                                                 name: 'Heating green',
                                                 type: 'boolean',
                                                 role: 'switch',
                                                 read: true,
                                                 write: false,
                                                 desc: 'reached target temp.'
                                             },
                                             native: {}
                                             },
                                             {
                                             _id: 'RED',
                                             type: 'state',
                                             common: {
                                                 name: 'Heating red',
                                                 type: 'boolean',
                                                 role: 'switch',
                                                 read: true,
                                                 write: false,
                                                 desc: 'not reached target temp.'
                                             },
                                             native: {}
                                             },
                                             {
                                             _id: 'FLT',
                                             type: 'state',
                                             common: {
                                                 name: 'pump',
                                                 type: 'boolean',
                                                 role: 'switch',
                                                 read: true,
                                                 write: true,
                                                 desc: 'pump state'
                                             },    native: {}
                                             },
                                             {
                                             _id: 'HEATER',
                                             type: 'state',
                                             common: {
                                                 name: 'heater',
                                                 type: 'boolean',
                                                 role: 'switch',
                                                 read: true,
                                                 write: true,
                                                 desc: 'heater state'
                                             },
                                             native: {}
                                             },
                                             {
                                             _id: 'TGT',
                                             type: 'state',
                                             common: {
                                                 name: 'target temp',
                                                 type: 'number',
                                                 role: 'level.temperature',
                                                 min: 20,
                                                 max: 40,
                                                 steps: 1,
                                                 read: true,
                                                 write: true,
                                                 desc: 'taget temp.'
                                             },
                                             native: {}
                                             },
                                             {
                                             _id: 'TMP',
                                             type: 'state',
                                             common: {
                                                 name: 'temp',
                                                 type: 'number',
                                                 role: 'value.temperature',
                                                 read: true,
                                                 write: false,
                                                 unit: '°C',
                                                 desc: 'temp.'
                                             },
                                             native: {}
                                             },
                                          ]
                                          
                                          
                                          init();
                                          async function stateChange(obj){
                                             let id = obj.id
                                             let state = id.split('.').pop()
                                             let value = obj.state.val
                                             log('change Unit' + state)
                                             switch (state) {
                                                 case 'UNT':
                                                     setStateAsync('mqtt.'+ MQTTINSTANCE+'.layzspa.command','{"CMD":1,"VALUE":'+ value +',"XTIME":0,"INTERVAL":0}')
                                                     log('change Unit')
                                                 break;
                                                 case 'TGT':
                                                     setStateAsync('mqtt.'+ MQTTINSTANCE+'.layzspa.command','{"CMD":0,"VALUE":'+ value +',"XTIME":0,"INTERVAL":0}')
                                                     log('change target temp. to '+ value);
                                                 break;
                                                 case 'AIR':
                                                     value = value ? 1: 0 ;
                                                     setStateAsync('mqtt.'+ MQTTINSTANCE+'.layzspa.command','{"CMD":2,"VALUE":'+ value +',"XTIME":0,"INTERVAL":0}')
                                                     log('set bubbles to '+ value);
                                                 break;
                                                  case 'HJT':
                                                     value = value ? 1: 0 ;
                                                     setStateAsync('mqtt.'+ MQTTINSTANCE+'.layzspa.command','{"CMD":11,"VALUE":'+ value +',"XTIME":0,"INTERVAL":0}')
                                                     log('set Hydrojets to '+ value);
                                                 break;
                                                 case 'HEATER':
                                                     value = value ? 1: 0 ;
                                                     setStateAsync('mqtt.'+ MQTTINSTANCE+'.layzspa.command','{"CMD":3,"VALUE":'+ value +',"XTIME":0,"INTERVAL":0}')
                                                     log('set Heater to '+ value);
                                                 break;
                                                 case 'FLT':
                                                     value = value ? 1: 0 ;
                                                     setStateAsync('mqtt.'+ MQTTINSTANCE+'.layzspa.command','{"CMD":4,"VALUE":'+ value +',"XTIME":0,"INTERVAL":0}')
                                                     log('set pump to '+ value);
                                                 break;
                                              
                                          
                                          
                                           default:
                                             // Anweisungen werden ausgeführt,
                                             // falls keine der case-Klauseln mit expression übereinstimmt
                                             break;
                                          }
                                          
                                          
                                          
                                          }
                                          async function init(){
                                             await asyncForEach(STATES, async (obj, index) => {
                                                 let id = ID +'.'+ obj._id
                                                 if (!existsState(id)) {
                                                     log('create state '+ id)
                                                     await createStateAsync(id, obj.common)
                                                 }
                                                 else {
                                                     log('skip state '+ id)
                                                 }
                                                 //set subscription
                                                 if(obj.common.write){
                                                     on({id: id, change:"any"} , function(obj) {
                                                         if(!obj.state.ack){
                                                             log('change state! '+ JSON.stringify(obj))
                                                             stateChange(obj)
                                                         }
                                                     });
                                                 }       
                                             });
                                             log('init done!')
                                          }
                                          async function setLazyStates(obj){
                                             try{
                                                     let states = JSON.parse(obj)
                                                     for (const [key, value] of Object.entries(states)) {
                                                         let statevalue = value
                                                         const found = STATES.find(state => state._id === key);
                                                         if(found){                 
                                                             if (found.common.type === 'boolean'){
                                                                 statevalue = value === 1
                                                             }
                                                             await setStateAsync(ID +'.'+ key,statevalue,true)
                                                         }
                                                     }
                                                     //set heater state
                                                     await setStateAsync(ID +'.HEATER',(states.GRN || states.RED) === 1,true)    
                                             }
                                             catch(e){
                                                 console.log('Error in setting State '+ e)
                                             }
                                          
                                          }
                                          
                                          async function asyncForEach(array, callback) {
                                             for (let index = 0; index < array.length; index++) {
                                             	await callback(array[index], index, array);
                                             }
                                          }
                                          function log (msg){
                                             if(debug) console.log (msg)
                                          }
                                          
                                          on({id:'mqtt.'+ MQTTINSTANCE+'.layzspa.message', change:"ne"} , function(obj) {
                                             log('Lazyspa reached message! '+ JSON.stringify(obj.state))
                                             setLazyStates(obj.state.val)
                                          });
                                          
                                          

                                          Und so siehts dann aus...Bildschirmfoto 2022-08-12 um 21.17.52.png

                                          Grüße

                                          K Offline
                                          K Offline
                                          kukoratsch
                                          wrote on last edited by kukoratsch
                                          #163

                                          @agria4800 DANKE
                                          Screenshot 2024-07-17 210146.png

                                          T 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate

                                          554

                                          Online

                                          32.7k

                                          Users

                                          82.4k

                                          Topics

                                          1.3m

                                          Posts
                                          Community
                                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                                          ioBroker Community 2014-2025
                                          logo
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Home
                                          • Recent
                                          • Tags
                                          • Unread 0
                                          • Categories
                                          • Unreplied
                                          • Popular
                                          • GitHub
                                          • Docu
                                          • Hilfe