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

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    18
    1
    545

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    9.0k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    2.3k

Lay-Z-Spa Wifi Control

Scheduled Pinned Locked Moved Hardware
211 Posts 76 Posters 51.7k 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.
  • Agria4800A Agria4800

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

    edit: so ein kleines script habe ich auch dafür:

    Würdest du evtl. das Script noch für die Hydrojet Düsen erweitern? :grin:

    Bildschirmfoto 2022-06-26 um 18.49.52.png

    Würdest du evtl. noch das Script erweitern auf die Werte aus dem Script und diese auch noch in DB schreiben? :-)
    Bildschirmfoto 2022-06-26 um 19.05.30.png

    Agria4800A Offline
    Agria4800A Offline
    Agria4800
    wrote on last edited by Agria4800
    #56

    @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

    Agria4800A S M B T 6 Replies Last reply
    1
    • 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

      Agria4800A Offline
      Agria4800A Offline
      Agria4800
      wrote on last edited by
      #57

      @agria4800
      Hiermit bekommt man die Zeiten ausgelesen:

      var Souce_other, Source, RSSI, Times, Chlortime, Filtertime, Uptime, Pumptime, Heating, Airtime, Hydrojet_Time, Costs, Verbrauch;
      
      
      on({id: [].concat(['mqtt.0.layzspa.other']), change: "ne"}, async function (obj) {
       var value = obj.state.val;
       var oldValue = obj.oldState.val;
       Souce_other = getState("mqtt.0.layzspa.other").val;
       await wait(100);
       RSSI = getAttr(Souce_other, 'RSSI');
       setState("0_userdata.0.LazySpa.RSSI-Wifi"/*RSSI-Wifi*/, parseFloat(RSSI), true);
      });
      on({id: [].concat(['mqtt.0.layzspa.times']), change: "ne"}, async function (obj) {
       var value = obj.state.val;
       var oldValue = obj.oldState.val;
       Source = getState("mqtt.0.layzspa.times").val;
       await wait(100);
       Times = getAttr(Source, 'TIME');
       setState("0_userdata.0.LazySpa.Times.Time"/*Time*/, parseFloat(Times), true);
       Chlortime = getAttr(Source, 'CLTIME');
       setState("0_userdata.0.LazySpa.Times.Chlor_Time"/*Chlor_Time*/, Chlortime, true);
       Filtertime = getAttr(Source, 'FTIME');
       setState("0_userdata.0.LazySpa.Times.Filter_Time"/*Filter_Time*/, parseFloat(Filtertime), true);
       Uptime = getAttr(Source, 'UPTIME');
       setState("0_userdata.0.LazySpa.Times.Up_Time"/*Up_Time*/, parseFloat(Uptime), true);
       Pumptime = getAttr(Source, 'PUMPTIME');
       setState("0_userdata.0.LazySpa.Times.Pump_Time"/*Pump_Time*/, parseFloat(Pumptime), true);
       Heating = getAttr(Source, 'HEATINGTIME');
       setState("0_userdata.0.LazySpa.Times.Heating_Time"/*Heating Time*/, parseFloat(Heating), true);
       Airtime = getAttr(Source, 'AIRTIME');
       setState("0_userdata.0.LazySpa.Times.Air_Time"/*Air_Time*/, parseFloat(Airtime), true);
       Hydrojet_Time = getAttr(Source, 'JETTIME');
       setState("0_userdata.0.LazySpa.Times.Hydrojet_Time"/*Hydrojet_Time*/, parseFloat(Hydrojet_Time), true);
       Costs = getAttr(Source, 'COST');
       setState("0_userdata.0.LazySpa.Times.Cost"/*Cost*/, parseFloat(Costs), true);
       Verbrauch = getAttr(Source, 'KWH');
       setState("0_userdata.0.LazySpa.Times.Verbrauch"/*Verbrauch*/, parseFloat(Verbrauch), true);
      });
      
      
      

      und hiermit werden sie umgeschrieben analog !Bildschirmfoto 2022-08-12 um 21.15.48.png

      var Dauer, tage, std, min, sec;
      
      
      // https://forum.iobroker.net/topic/13488/vorlage-blockly-umrechnung-von-sekunden-in-stunden-minuten-und-sekunden/11
      
      on({id: "0_userdata.0.LazySpa.Times.Up_Time"/*Up_Time*/, change: "ne"}, async function (obj) {
       var value = obj.state.val;
       var oldValue = obj.oldState.val;
       Dauer = getState("0_userdata.0.LazySpa.Times.Up_Time").val;
       tage = Math.floor(parseFloat(Dauer) / 86400);
       Dauer = parseFloat(Dauer) - parseFloat(tage) * 86400;
       std = Math.floor(parseFloat(Dauer) / 3600);
       Dauer = parseFloat(Dauer) - parseFloat(std) * 3600;
       min = Math.floor(parseFloat(Dauer) / 60);
       Dauer = parseFloat(Dauer) - parseFloat(min) * 60;
       sec = Math.floor(parseFloat(Dauer) / 1);
       setState("0_userdata.0.LazySpa.Times.Format-Up-Time"/*Format-Up-Time*/, ([tage,'D -  ',std,'h:',min,'min:',sec,'sec'].join('')));
      });
      on({id: "0_userdata.0.LazySpa.Times.Air_Time"/*Air_Time*/, change: "ne"}, async function (obj) {
       var value = obj.state.val;
       var oldValue = obj.oldState.val;
       Dauer = getState("0_userdata.0.LazySpa.Times.Air_Time").val;
       tage = Math.floor(parseFloat(Dauer) / 86400);
       Dauer = parseFloat(Dauer) - parseFloat(tage) * 86400;
       std = Math.floor(parseFloat(Dauer) / 3600);
       Dauer = parseFloat(Dauer) - parseFloat(std) * 3600;
       min = Math.floor(parseFloat(Dauer) / 60);
       Dauer = parseFloat(Dauer) - parseFloat(min) * 60;
       sec = Math.floor(parseFloat(Dauer) / 1);
       setState("0_userdata.0.LazySpa.Times.Format-Air-Time"/*Format-Air-Time*/, ([tage,'D -  ',std,'h:',min,'min:',sec,'sec'].join('')));
      });
      on({id: "0_userdata.0.LazySpa.Times.Heating_Time"/*Heating Time*/, change: "ne"}, async function (obj) {
       var value = obj.state.val;
       var oldValue = obj.oldState.val;
       Dauer = getState("0_userdata.0.LazySpa.Times.Heating_Time").val;
       tage = Math.floor(parseFloat(Dauer) / 86400);
       Dauer = parseFloat(Dauer) - parseFloat(tage) * 86400;
       std = Math.floor(parseFloat(Dauer) / 3600);
       Dauer = parseFloat(Dauer) - parseFloat(std) * 3600;
       min = Math.floor(parseFloat(Dauer) / 60);
       Dauer = parseFloat(Dauer) - parseFloat(min) * 60;
       sec = Math.floor(parseFloat(Dauer) / 1);
       setState("0_userdata.0.LazySpa.Times.Format-Heating-Time"/*Format-Heating-Time*/, ([tage,'D -  ',std,'h:',min,'min:',sec,'sec'].join('')));
      });
      on({id: "0_userdata.0.LazySpa.Times.Pump_Time"/*Pump_Time*/, change: "ne"}, async function (obj) {
       var value = obj.state.val;
       var oldValue = obj.oldState.val;
       Dauer = getState("0_userdata.0.LazySpa.Times.Pump_Time").val;
       tage = Math.floor(parseFloat(Dauer) / 86400);
       Dauer = parseFloat(Dauer) - parseFloat(tage) * 86400;
       std = Math.floor(parseFloat(Dauer) / 3600);
       Dauer = parseFloat(Dauer) - parseFloat(std) * 3600;
       min = Math.floor(parseFloat(Dauer) / 60);
       Dauer = parseFloat(Dauer) - parseFloat(min) * 60;
       sec = Math.floor(parseFloat(Dauer) / 1);
       setState("0_userdata.0.LazySpa.Times.Format-Pump-Time"/*Format-Pump-Time*/, ([tage,'D -  ',std,'h:',min,'min:',sec,'sec'].join('')));
      });
      
      on({id: "0_userdata.0.LazySpa.Times.Hydrojet_Time"/*Hydrojet_Time*/, change: "ne"}, async function (obj) {
       var value = obj.state.val;
       var oldValue = obj.oldState.val;
       Dauer = getState("0_userdata.0.LazySpa.Times.Hydrojet_Time").val;
       tage = Math.floor(parseFloat(Dauer) / 86400);
       Dauer = parseFloat(Dauer) - parseFloat(tage) * 86400;
       std = Math.floor(parseFloat(Dauer) / 3600);
       Dauer = parseFloat(Dauer) - parseFloat(std) * 3600;
       min = Math.floor(parseFloat(Dauer) / 60);
       Dauer = parseFloat(Dauer) - parseFloat(min) * 60;
       sec = Math.floor(parseFloat(Dauer) / 1);
       setState("0_userdata.0.LazySpa.Times.Format-Hydrojet-Time"/*Format-Hydrojet-Time*/, ([tage,'D -  ',std,'h:',min,'min:',sec,'sec'].join('')));
      });
      

      Z 1 Reply Last reply
      1
      • A Offline
        A Offline
        anderl
        wrote on last edited by
        #58

        Hallo zusammen, hat irgendjemand noch eine Platine abzugeben? Leider unbedarft, trotzdem neue Herausforderung gesucht 😀 Danke und Grüße Andy

        R 1 Reply Last reply
        0
        • Bjoern WeissB Offline
          Bjoern WeissB Offline
          Bjoern Weiss
          wrote on last edited by
          #59

          Hallo zusammen,
          ich habe ein kleines Problem. Hat jemand eine Idee, warum mir in dem Anzeigefeld keine Temperatur angezeigt wird?
          Wenn es einen Fehler wie beispielsweise E02 etc gibt, wird dieser dort aber angezeigt.
          Lazy.jpg

          Ist ein Vegas (54112), allerdings mit 4-adrigen Verkabelung statt wie angegeben 6 Adern.

          Hab übrigends noch Platinen übrig wenn jemand noch eine benötigt.

          1 Reply Last reply
          0
          • A anderl

            Hallo zusammen, hat irgendjemand noch eine Platine abzugeben? Leider unbedarft, trotzdem neue Herausforderung gesucht 😀 Danke und Grüße Andy

            R Offline
            R Offline
            Rickman
            wrote on last edited by
            #60

            @anderl
            Ich habe gestern die PCB v2 bestellt. Wollte für den Winter auch schon mal was zum basteln haben.
            Sobald die da sind, kann ich Dir Bescheid geben.

            Falls noch jemand welche benötigt - habe dann immer noch 3 übrig. ;-)

            Gruß,
            Richy

            allesautomatischA 1 Reply Last reply
            0
            • R Rickman

              @anderl
              Ich habe gestern die PCB v2 bestellt. Wollte für den Winter auch schon mal was zum basteln haben.
              Sobald die da sind, kann ich Dir Bescheid geben.

              Falls noch jemand welche benötigt - habe dann immer noch 3 übrig. ;-)

              Gruß,
              Richy

              allesautomatischA Offline
              allesautomatischA Offline
              allesautomatisch
              wrote on last edited by
              #61

              @rickman
              Ich würde Dir ein v2 PCB abnehmen.

              Vielen Dank und Gruß,
              Michael

              R 1 Reply Last reply
              0
              • allesautomatischA allesautomatisch

                @rickman
                Ich würde Dir ein v2 PCB abnehmen.

                Vielen Dank und Gruß,
                Michael

                R Offline
                R Offline
                Rickman
                wrote on last edited by
                #62

                @allesautomatisch
                Hast ne Chatnachricht... :)

                1 Reply Last reply
                0
                • Chris685C Offline
                  Chris685C Offline
                  Chris685
                  wrote on last edited by
                  #63

                  Ich habe noch 4 Platinen V1 da und einen Satz mit 6 poligen JST-SM. Wenn Interesse besteht bitte PN.

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    Rickman
                    wrote on last edited by Rickman
                    #64

                    Also... Ich hätte dann noch 2 fertige Boards für das Model S100101, St. Lucia/Rio.
                    Im Moment drucke ich noch die passenden Gehäuse dafür, die wunderbar in die zwei freien Bohrungen neben der Heizung passen.

                    20220921_183757.jpg

                    20220923_074047.jpg

                    20220923_074111.jpg

                    Bei eBay werden die für 83,- Euro vertickt, hier für 35,- plus Versand.
                    Falls es nicht klappen sollte, weil doch wieder was anders in der Elektronik der Pumpe ist, nehme ich den selbstverständlich wieder zurück. Bei Interesse gerne eine PN an mich.

                    EDIT:
                    Keiner mehr da...

                    Gruß,
                    Richy

                    J 1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      MezzoDO
                      wrote on last edited by
                      #65

                      Guten Abend zusammen!
                      Gibt's hier fachkundige Leute zu diesem Projekt, die mir bei meinem Problem helfen könnten?

                      Ich hab die PCB V1 Platine und wollte einen BAHAMAS mit der Pumpe S100101 mit dem Modul ausstatten.
                      Zusammengebaut mit dem blauen Level Converter, der laut Instructions bestätigt funktionieren soll. Zudem habe ich in meiner Verzweiflung auch versucht die 560 Ohm Widerstände an die Datenleitungen 3,4 & 5 zum Display zu löten.

                      Laut GitProject soll das Modell MIAMI2021 gewählt werden, was ich auch eingestellt und hochgeladen habe (PlatformIO Upload, Build Filesystem und Upload Filesystem).

                      Die WebUI lässt sich soweit auch aufrufen und konfigurieren, allerdings bleibt das Display der Pumpe dunkel und Bedienung ist weder Am Display noch per WebUI möglich.
                      Alles was ich sehe ist die (vermeintlich korrekte) Temperatur per WebUI.

                      Habe alles gemäß Anleitung mehr als fünf mal gecheckt. Vielleicht findet sich jemand, der mir helfen kann :(

                      R tvtotalT R 3 Replies Last reply
                      0
                      • M MezzoDO

                        Guten Abend zusammen!
                        Gibt's hier fachkundige Leute zu diesem Projekt, die mir bei meinem Problem helfen könnten?

                        Ich hab die PCB V1 Platine und wollte einen BAHAMAS mit der Pumpe S100101 mit dem Modul ausstatten.
                        Zusammengebaut mit dem blauen Level Converter, der laut Instructions bestätigt funktionieren soll. Zudem habe ich in meiner Verzweiflung auch versucht die 560 Ohm Widerstände an die Datenleitungen 3,4 & 5 zum Display zu löten.

                        Laut GitProject soll das Modell MIAMI2021 gewählt werden, was ich auch eingestellt und hochgeladen habe (PlatformIO Upload, Build Filesystem und Upload Filesystem).

                        Die WebUI lässt sich soweit auch aufrufen und konfigurieren, allerdings bleibt das Display der Pumpe dunkel und Bedienung ist weder Am Display noch per WebUI möglich.
                        Alles was ich sehe ist die (vermeintlich korrekte) Temperatur per WebUI.

                        Habe alles gemäß Anleitung mehr als fünf mal gecheckt. Vielleicht findet sich jemand, der mir helfen kann :(

                        R Offline
                        R Offline
                        Rickman
                        wrote on last edited by
                        #66

                        @mezzodo
                        Schau Dir mal die Bilder bei mir an. Hast Du die Kabel so verlötet? Also in der Reihenfolge am Ein- und Ausgang?
                        Du hast zwar eine V1- Platine, aber das selbe Pumpenmodell... Vielleicht klappts ja.

                        Bei mir hat die Standardbelegung nämlich auch nicht funktioniert. :wink:

                        M 1 Reply Last reply
                        0
                        • R Rickman

                          @mezzodo
                          Schau Dir mal die Bilder bei mir an. Hast Du die Kabel so verlötet? Also in der Reihenfolge am Ein- und Ausgang?
                          Du hast zwar eine V1- Platine, aber das selbe Pumpenmodell... Vielleicht klappts ja.

                          Bei mir hat die Standardbelegung nämlich auch nicht funktioniert. :wink:

                          M Offline
                          M Offline
                          MezzoDO
                          wrote on last edited by
                          #67

                          @rickman
                          Danke für den Tipp, die Belegung hab ich tatsächlich schonmal gesehen aber nicht berücksichtigt. Ich teste das mal.

                          LG

                          M 1 Reply Last reply
                          0
                          • M MezzoDO

                            @rickman
                            Danke für den Tipp, die Belegung hab ich tatsächlich schonmal gesehen aber nicht berücksichtigt. Ich teste das mal.

                            LG

                            M Offline
                            M Offline
                            MezzoDO
                            wrote on last edited by
                            #68

                            @mezzodo said in Lay-Z-Spa Wifi Control:

                            @rickman
                            Danke für den Tipp, die Belegung hab ich tatsächlich schonmal gesehen aber nicht berücksichtigt. Ich teste das mal.

                            LG

                            Umverdrahtet, selber Effekt...

                            Allerdings habe ich aus Gründen mal einen neuen Level Converter bestellt und jetzt spielt zumindest die Melodie beim starten, dennoch wie vorher bleibt das Display tot. Ich denke ich werde es nun nochmal mit der 1:1 Verdrahtung versuchen und melde mich erneut #justupdating

                            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

                              S Offline
                              S Offline
                              Smokey
                              wrote on last edited by
                              #69

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

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

                              :( ich hab den ganzen Threat jetzt x mal gelesen, raffe aber einfach nicht, wie ich per VIS die entsprechenden Kommandos absetzen kann, wie es oben im Bild zu sehen ist. Das sind doch keine direkten Datenpunkte, die einen Wert oder ein true/false erwarten. Ich sehe im Objekt-Baum hinter den Datenpunkten nur JASON files oder scripts. Was hab ich denn übersehen?

                              B 1 Reply Last reply
                              0
                              • Lord ByronL Offline
                                Lord ByronL Offline
                                Lord Byron
                                wrote on last edited by Lord Byron
                                #70

                                Sehr geiles Projekt. Genau das was mir noch fehlt für meinen Maldives Pool. Ich habe fünf v2 PCB bestellt. Falls sich hier auch Schweizer tummeln, die noch eines bräuchten, gerne PM an mich ;-)

                                Edit:
                                Hab bereits alles Material bekommen und soweit mal installiert und konfiguriert. Ich benutze zwar kein ioBroker, sondern Mosquitto in HA, aber vielleicht kann mir ja trotzdem jemand hier einen Tip geben. Ich haben den Maldives mit Hydrojet, Verbindung zu Mosquitto steht und wird auch alles wunderbar in HA angezeigt... ...ausser die Hydrojet Düsen. Meiner Meinung nach müsste dies doch im neusten Release mit integriert sein?

                                1 Reply Last reply
                                0
                                • Agria4800A Agria4800

                                  @agria4800 Hab´s grad irgendwie hinbekommen..:blush: naja, hier mal meine Einstellungen, falls jemand hier die gleichen Probleme habe...
                                  Bildschirmfoto 2022-06-26 um 08.37.33.png Bildschirmfoto 2022-06-26 um 08.36.20.png

                                  Script wird auch gefüllt, danke fürs teilen ;-)

                                  M Offline
                                  M Offline
                                  MiPl
                                  wrote on last edited by
                                  #71

                                  @agria4800
                                  Hallo, danke für die Screenshots zur Einrichtung von mqtt - Es klappt bei mir aber trotzdem nicht. Derzeit benutze ich den mqtt-Adapter 4.07. Habe die Einstellungen exakt so gemacht wie von Dir dargegestellt und unzählige Male versucht. Geht nicht. Auch ein Reset der Poolsteuerung und des ioBroker brachten keinen Erfolg. Beim Log bekomme ich auch keine Hilfe.

                                  Log-MQTT.jpg

                                  Ich habe in einem anderen Thread gelesen, dass der Adapter so lange auf Gelb bleibt, bis sich ein Device anmeldet/einwählt. Aber wie kann ich die Poolsteuerung sich aktiv einwählen lassen?

                                  Ich checks nicht.

                                  Danke für jede Hilfe.

                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    MiPl
                                    wrote on last edited by
                                    #72

                                    @mipl
                                    ich habe zu meiner Frage einen neuen Beitrag aufgemacht: Keine Verbindung zu mqtt-Server/Broker

                                    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

                                      M Offline
                                      M Offline
                                      MiPl
                                      wrote on last edited by
                                      #73

                                      @agria4800
                                      Hallo Agria4800,

                                      ich habe das Script erfolgreich in Betrieb nehmen können (vielen Dank an die Ersteller). Ich bekomme derzeit alle ca. 4 Sekunden einen Eintrag im Log und eine entsprechende Aktualisierung der Daten, da sich z. B. die (virtuelle) Temperatur minimal ändert. Könnte man hier nicht auf Zentel-Grad Genauigkeit reduzieren, um die Rechnerlast ein wenig runterzufahren? Ich habe von Java Null Check, daher kann ich es nicht machen. Habe mir übergangsweise so geholfen und den Logeintrag auskommentiert. Aber das ist ja nicht Sinn der Sache.

                                      Danke im Voraus.

                                      1 Reply Last reply
                                      0
                                      • MeistertrM Meistertr

                                        Hallo Leute ich arbeite gerade daran meinen Lay-Z-Spa Smarthome kompatibel zu machen. bin da auf ein tolles Projekt gestoßen mit einem Esp8266 Wollte hierfür die Platinen bestellen hat noch jemand zufällig Interesse? Eine Platine alleine ist ein bisschen zu teuer... würde zwischen 6 und 11 Euro liegen die platine je nachdem wieviele es werden...

                                        Platine : https://easyeda.com/editor#id=a1b94bf9fc01407591a9e0fec6a813b3
                                        Projekt: https://github.com/visualapproach/WiFi-remote-for-Bestway-Lay-Z-SPA

                                        Wollte am Wochenende mal ein Testaufbau machen... und werde berichten...

                                        PS: ich selbst habe einen Palm-Springspcb.jpg

                                        edit: so ein kleines script habe ich auch dafür:

                                        
                                        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.LazySpa';
                                        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: '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 '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)
                                        });
                                        
                                        J Offline
                                        J Offline
                                        johobo
                                        wrote on last edited by
                                        #74

                                        Hi, Ich habe gerade Platinen bestellt. falls also jemand interesse hat gerne melden.

                                        M J 2 Replies Last reply
                                        0
                                        • R Rickman

                                          Also... Ich hätte dann noch 2 fertige Boards für das Model S100101, St. Lucia/Rio.
                                          Im Moment drucke ich noch die passenden Gehäuse dafür, die wunderbar in die zwei freien Bohrungen neben der Heizung passen.

                                          20220921_183757.jpg

                                          20220923_074047.jpg

                                          20220923_074111.jpg

                                          Bei eBay werden die für 83,- Euro vertickt, hier für 35,- plus Versand.
                                          Falls es nicht klappen sollte, weil doch wieder was anders in der Elektronik der Pumpe ist, nehme ich den selbstverständlich wieder zurück. Bei Interesse gerne eine PN an mich.

                                          EDIT:
                                          Keiner mehr da...

                                          Gruß,
                                          Richy

                                          J Offline
                                          J Offline
                                          johobo
                                          wrote on last edited by
                                          #75

                                          @rickman
                                          Hi,

                                          würdest du die Dateien für das Gehäuse zur Verfügung stellen? Oder kann ich sie irgendwie auf Thingiverse finden? Danke & Viele Grüße! JoHo

                                          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

                                          933

                                          Online

                                          32.5k

                                          Users

                                          81.6k

                                          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