Resultados 1 al 8 de 8
- 26/10/2023, 16:55 #1Forero
- Fecha de ingreso
- dic 2015
- Ubicación
- zaragoza
- Mensajes
- 145
axpert max 2 8kw y USR TCP232
Hola,intento sacar datos del inversor a traves de node red y home assistant OS,pero al no poder instalar programas en la raspberry por tener e HA OS no puedo configurarlo,no pongo el home assistant docker porque tengo muchos problemas con los ESP32 Q tengo,alguna guia de como hacerlo funcionar??
-
- 27/10/2023, 17:39 #2Forero
- Fecha de ingreso
- dic 2015
- Ubicación
- zaragoza
- Mensajes
- 145
Re: axpert max 2 8kw y USR TCP232
nadie???
- 05/11/2023, 23:47 #3Forero
- Fecha de ingreso
- feb 2012
- Ubicación
- Un pueblecito de Granada
- Mensajes
- 196
Re: axpert max 2 8kw y USR TCP232
Hola toni, por HA no se, pero por NodeRed si. Has instalado NodeRed?
- 06/11/2023, 16:29 #4Forero
- Fecha de ingreso
- dic 2015
- Ubicación
- zaragoza
- Mensajes
- 145
Re: axpert max 2 8kw y USR TCP232
por node red,cuando sigo las instrucciones de TEJOTA, si al USR le pongo bit rate de 2400, y en la raspberry le pongo
sudo socat PTY,link=/dev/Voltronic,mode=777,echo=0,ignoreeof,b115200,raw TCP:192.168.1.145:26,con la ip que tengo configurada,la raspberry se queda como congelada y no vuelve ninguna respuesta en la raspberry,luego este codigo sudo socat PTY,link=/dev/Voltronic,mode=777,echo=0,ignoreeof,b115200,raw TCP:192.168.1.145:26 que habria q poner "ignoreeof,b2400,raw,de todos modos lo he puesto de las 2 formas y se congela,escribir puedo pero no devuelve informacion
- 06/11/2023, 17:33 #5Forero
- Fecha de ingreso
- feb 2012
- Ubicación
- Un pueblecito de Granada
- Mensajes
- 196
Re: axpert max 2 8kw y USR TCP232
Tejota es brillante y muchas veces eso le juega en su contra.
En este caso se complicó sin necesidad. Lo que hace ahí es crear un puerto serie virtual para empalmarlo como si fuese un serie físico de la RPI. Mi recomendación es que después del nodo función CRCTJ en vez de conectarlo al nodo puerto serie, lo conectes a un nodo "TCP request" y a ese nodo le pongas la IPuerto que has configurado en el USR; luego en el USR es donde deberás configurar los baudios, etc del voltronic. Entiendo que debería funcionar, yo así es como lo hago, pero para mis convertidores Modbus EE-11 y Ew-11
- 06/11/2023, 18:38 #6Forero
- Fecha de ingreso
- dic 2015
- Ubicación
- zaragoza
- Mensajes
- 145
Re: axpert max 2 8kw y USR TCP232
Un poco verde estoy en esto,podrías ponerme un ejemplo del código??,luego también la conexión de red del Usr la tengo directamente a un switch y la rpi tb va a ese switch con salida de internet
- 22/11/2023, 21:21 #7Forero
- Fecha de ingreso
- dic 2015
- Ubicación
- zaragoza
- Mensajes
- 145
Re: axpert max 2 8kw y USR TCP232
al hacerlo con tcp resquet no me funciona nada de ese flow y me sale esto msg.payload : Object
{ mododetrabajo: undefined
- 27/12/2023, 09:47 #8Forero
- Fecha de ingreso
- dic 2015
- Ubicación
- zaragoza
- Mensajes
- 145
Re: axpert max 2 8kw y USR TCP232
he provado este flow de tejota,cambie la conexion de usb por tcp,lo que en este flow no puedo ver la generacion de placas de fv2 ni la generacion total de placas juntando fv1 y fv2e intentado instalar el qpigs2 pero no funciona,los otros flows que tiene no me funciona ninguno,estoy ya un poco extresado viendo que no funciona
Código HTML:[{"id":"2c0cfdc.c46c602","type":"tab","label":"Voltronic MKS por USB","disabled":false,"info":""},{"id":"6c0a3edc.a82de","type":"inject","z":"2c0cfdc.c46c602","name":"QPIRI Configuracion","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"7","crontab":"","once":false,"onceDelay":0.1,"topic":"Configuracion","payload":"QPIRI","payloadType":"str","x":140,"y":700,"wires":[["ac2a49dd.512438"]]},{"id":"b8681580.f6b638","type":"inject","z":"2c0cfdc.c46c602","name":"QFLAG Miscelanea","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"7","crontab":"","once":false,"onceDelay":0.1,"topic":"Miscelanea","payload":"QFLAG","payloadType":"str","x":140,"y":660,"wires":[["ac2a49dd.512438"]]},{"id":"c315c02f.2bed1","type":"inject","z":"2c0cfdc.c46c602","d":true,"name":"QBEQI Ecualizacion Bateria","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"Ecualizacion Bateria","payload":"QBEQI","payloadType":"str","x":170,"y":740,"wires":[["ac2a49dd.512438"]]},{"id":"47b7567a.4dc558","type":"inject","z":"2c0cfdc.c46c602","name":"QPIWS Informacion Warnings","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"5","crontab":"","once":false,"onceDelay":0.1,"topic":"Informacion Warnings","payload":"QPIWS","payloadType":"str","x":170,"y":780,"wires":[["ac2a49dd.512438"]]},{"id":"8d340413.a06bf8","type":"inject","z":"2c0cfdc.c46c602","name":"QPIGS Estado General","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"4","crontab":"","once":false,"onceDelay":0.1,"topic":"Estado General","payload":"QPIGS","payloadType":"str","x":150,"y":540,"wires":[["ac2a49dd.512438"]]},{"id":"2cd7dbcd.7d01a4","type":"inject","z":"2c0cfdc.c46c602","name":"QID Numero de Serie","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"Numero de Serie","payload":"QID","payloadType":"str","x":140,"y":500,"wires":[["ac2a49dd.512438"]]},{"id":"fb0c9d3a.bd42f","type":"function","z":"2c0cfdc.c46c602","name":"CRCTJ","func":" // Algoritmo para lanzar los comandos hacia Voltronics por puerto serie con CRC propietario\n // Algoritmo realizado por Tejota [email protected]\n var topic = (msg.payload) + (\" \") + (msg.topic); // Topic con el comando string y posible descripcion\n var comandobuffer = Buffer.from(msg.payload); // pasando a buffer el string del comando \n var crc = 0x0000; // inicio del crc\n for (tj = 0; tj < comandobuffer.length; tj++) // scaneo del buffer\n {\n const byte = comandobuffer[tj]; // analizando el byte para aplicarle el crc16xmodem\n tejota = (crc >>> 8) & 0xff;\n tejota ^= byte & 0xff;\n tejota ^= tejota >>> 4;\n crc = (crc << 8) & 0xffff; // Algoritmo\n crc ^= tejota; // crc16 xmodem \n tejota = (tejota << 5) & 0xffff; // sin tabla estatica\n crc ^= tejota;\n tejota = (tejota << 7) & 0xffff;\n crc ^= tejota;\n } // resultante crc numerico \n var crchexastring = crc.toString(16).padStart(4,'0'); // crc numerico a string hexa añadiendo ceros a izquierda si es preciso\n var crchexabuffer = Buffer.from(crchexastring, \"hex\"); // buffer del crchexa\n for (mdk=0; mdk < crchexabuffer.length; mdk++) // scaneo del buffer\n {\n if (crchexabuffer[mdk]==10 || crchexabuffer[mdk]==13 || crchexabuffer[mdk]==40) // Exceptuando estos bytes mdk \n {\n crchexabuffer[mdk]++; // se pone el byte siguiente si es alguno de las excepciones mdk\n }\n } \n const retornodecarro = Buffer.from(\"\\r\");\n var crctotalbuffer = [comandobuffer, crchexabuffer, retornodecarro]; // construyendo el buffer final hacia el hibrido\n msg.payload = Buffer.concat(crctotalbuffer);\n msg.topic = topic;\n return msg;","outputs":1,"timeout":"","noerr":22,"initialize":"","finalize":"","libs":[],"x":300,"y":20,"wires":[[]]},{"id":"89c0f835.c54ab8","type":"delay","z":"2c0cfdc.c46c602","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"0.8","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":430,"y":160,"wires":[["f37f99b4.47fcd8","2927bbeda6465fb5"]]},{"id":"6196de4d.452f","type":"join","z":"2c0cfdc.c46c602","name":"String final","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":810,"y":100,"wires":[["88f539c9.d84ee8"]]},{"id":"280e455d.250e1a","type":"debug","z":"2c0cfdc.c46c602","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1190,"y":580,"wires":[]},{"id":"765057a0.9c7028","type":"function","z":"2c0cfdc.c46c602","name":"Completo en 13 (\\r)","func":"var payload = msg.payload;\nfor (tj = 0; tj < payload.length; tj++) {\nif (payload[tj] == 13) {\n msg.complete = true;\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":830,"y":160,"wires":[["6196de4d.452f"]]},{"id":"f37f99b4.47fcd8","type":"change","z":"2c0cfdc.c46c602","name":"Delete payload","rules":[{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":100,"wires":[["6196de4d.452f"]]},{"id":"68985b5e.c2a8f4","type":"inject","z":"2c0cfdc.c46c602","name":"QVFW Firmware CPU1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"Version CPU1","payload":"QVFW","payloadType":"str","x":150,"y":580,"wires":[["ac2a49dd.512438"]]},{"id":"bd3d203f.623d9","type":"inject","z":"2c0cfdc.c46c602","name":"QVFW2 Firmware CPU2","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"Firmware CPU2","payload":"QVFW2","payloadType":"str","x":150,"y":620,"wires":[["ac2a49dd.512438"]]},{"id":"ac2a49dd.512438","type":"link out","z":"2c0cfdc.c46c602","name":"ParaCRCTJ","mode":"link","links":["13b953a1.2ef79c"],"x":410,"y":660,"wires":[],"l":true},{"id":"45507b31.ce6ee4","type":"comment","z":"2c0cfdc.c46c602","name":"Comandos de monitorizacion","info":"Comandos de Monitorizacion","x":140,"y":460,"wires":[]},{"id":"13b953a1.2ef79c","type":"link in","z":"2c0cfdc.c46c602","name":"CRCTJWelcome","links":["ac2a49dd.512438"],"x":120,"y":160,"wires":[["6d1208c899ad6e7c"]],"l":true},{"id":"3bc02c65.358c14","type":"comment","z":"2c0cfdc.c46c602","name":"Rate Limit a 1 msg cada 0,8s","info":"","x":360,"y":120,"wires":[]},{"id":"3d67e40a.721a8c","type":"comment","z":"2c0cfdc.c46c602","name":"Generando cadena de salida con descripcion en topic","info":"","x":720,"y":60,"wires":[]},{"id":"754880f1.ee725","type":"comment","z":"2c0cfdc.c46c602","name":"Juntando payloads hasta completar string","info":"","x":1140,"y":160,"wires":[]},{"id":"88f539c9.d84ee8","type":"link out","z":"2c0cfdc.c46c602","name":"ParaExtractores","links":["175dfd79.d26a83"],"x":1030,"y":100,"wires":[],"l":true},{"id":"c8d39d7e.6c58","type":"switch","z":"2c0cfdc.c46c602","name":"Repartidor Datos Lecturas","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"QID","vt":"str"},{"t":"cont","v":"QPIGS","vt":"str"},{"t":"cont","v":"CPU1","vt":"str"},{"t":"cont","v":"QVFW2","vt":"str"},{"t":"cont","v":"QFLAG","vt":"str"},{"t":"cont","v":"QPIRI","vt":"str"},{"t":"cont","v":"QPIGS2","vt":"str"},{"t":"cont","v":"QPIWS","vt":"str"},{"t":"cont","v":"QMOD","vt":"str"}],"checkall":"true","repair":false,"outputs":9,"x":370,"y":360,"wires":[["208b6136.748a4e"],["16809939.52bd57"],["848b4d62.aae62"],["f68d0ca2.3e3b"],["268069a2.5ee866"],["231c7627.1620fa"],["fcd12eb.29738d"],["c7108bd6.a898e8"],["1c62fbc2.20db04"]]},{"id":"175dfd79.d26a83","type":"link in","z":"2c0cfdc.c46c602","name":"ExtractoresWelcome","links":["88f539c9.d84ee8"],"x":130,"y":360,"wires":[["c8d39d7e.6c58"]],"l":true},{"id":"5aa9fcfa.2fbbd4","type":"comment","z":"2c0cfdc.c46c602","name":"Repartiendo por topic","info":"","x":360,"y":260,"wires":[]},{"id":"268069a2.5ee866","type":"function","z":"2c0cfdc.c46c602","name":"QFLAGExtraccion","func":"var output = msg.payload.substr(1, 11);\nvar E = output.indexOf(\"E\")+1;\nvar D = output.indexOf(\"D\");\nvar enables = output.substr(E, (D-E));\nvar disables = output.substr(D+1);\nswitch (enables.includes(\"a\")){\n case true:\n buzzer = 1;\n break;\n case false: \n buzzer = 0;\n} \nswitch (enables.includes(\"b\")){\n case true:\n bypassoverload = 1;\n break;\n case false:\n bypassoverload = 0;\n break;\n} \nswitch (enables.includes(\"k\")){\n case true:\n guardapantallalcd = 1;\n break;\n case false: \n guardapantallalcd = 0;\n} \nswitch (enables.includes(\"j\")){\n case true:\n powersaving = 1;\n break;\n case false:\n powersaving = 0;\n break;\n} \nswitch (enables.includes(\"u\")){\n case true:\n overloadrestart = 1;\n break;\n case false: \n overloadrestart = 0;\n} \nswitch (enables.includes(\"v\")){\n case true:\n overtemperaturerestart = 1;\n break;\n case false:\n overtemperaturerestart = 0;\n break;\n}\nswitch (enables.includes(\"x\")){\n case true:\n luzlcd = 1;\n break;\n case false:\n luzlcd = 0;\n break;\n} \nswitch (enables.includes(\"y\")){\n case true:\n pitidosifuenteprimariafalla = 1;\n break;\n case false:\n pitidosifuenteprimariafalla = 0;\n break;\n} \nswitch (enables.includes(\"z\")){\n case true:\n grabarerrores = 1;\n break;\n case false:\n grabarerrores = 0;\n break;\n} \nreturn [\n {\n payload: {\n buzzer: buzzer,\n bypassoverload: bypassoverload,\n guardapantallalcd: guardapantallalcd,\n powersaving: powersaving,\n overloadrestart: overloadrestart,\n overtemperaturerestart: overtemperaturerestart,\n luzlcd: luzlcd,\n pitidosifuenteprimariafalla: pitidosifuenteprimariafalla,\n grabarerrores: grabarerrores,\n }\n }\n]\n","outputs":1,"noerr":0,"x":630,"y":420,"wires":[["4c1a593c.2808d8"]]},{"id":"16809939.52bd57","type":"function","z":"2c0cfdc.c46c602","name":"QPIGSExtraccion","func":"var output = msg.payload.split(\" \");\nlet voltajered = parseFloat(output[0].slice(1, 5));\nlet frecuenciared = parseFloat(output[1]);\nlet voltajesalida = parseFloat(output[2]);\nlet frecuenciasalida = parseFloat(output[3]);\nlet potenciaparentesalida = parseInt(output[4]);\nlet potenciaactivasalida = parseInt(output[5]);\nlet porcentajecargasalida = parseInt(output[6]);\nlet voltajebusalta = parseInt(output[7]);\nlet voltajebateria = parseFloat(output[8]);\nlet amperioscargabat = parseInt(output[9]);\nlet capacidadbateria = parseInt(output[10])\nlet temperaturainversor = parseInt(output[11]);\nlet amperiosenplaca = parseInt(output[12]);\nlet voltajeenplaca = parseInt(output[13]);\nlet voltajescc = parseFloat(output[14]);\nlet amperiosdescargabat = parseInt(output[15]);\nlet prioridadSBU = parseInt(output[16].slice(0,1));\nlet estadoconf = parseInt(output[16].slice(1,2));\nlet estadoscc = parseInt(output[16].slice(2,3));\nlet cargasconectadas = parseInt(output[16].slice(3,4));\nlet voltajeconstantemientrascarga = parseInt(output[16].slice(4,5));\nlet estadodecargageneral = parseInt(output[16].slice(5,6));\nlet estadodecargasolar = parseInt(output[16].slice(6,7));\nlet estadodecargared = parseInt(output[16].slice(7,9));\nlet potenciaenplaca = parseInt(output[19]);\nlet estadodelmppt = parseInt(output[20].slice(0,1));\nlet estadodelswitch = parseInt(output[20].slice(1,2));\n/*var numerodeserie = flow.get(numerodeserie);*/\nreturn [\n {\n payload: {\n voltajered: voltajered,\n frecuenciared: frecuenciared,\n voltajesalida: voltajesalida,\n frecuenciasalida: frecuenciasalida,\n potenciaparentesalida: potenciaparentesalida,\n potenciaactivasalida: potenciaactivasalida,\n porcentajecargasalida: porcentajecargasalida,\n voltajebateria: voltajebateria,\n amperiosdescargabat: amperiosdescargabat,\n amperioscargabat: amperioscargabat,\n temperaturainversor: temperaturainversor,\n potenciaenplaca: potenciaenplaca,\n voltajeenplaca: voltajeenplaca,\n estadodelmppt: estadodelmppt,\n cargasconectadas: cargasconectadas,\n voltajebusalta: voltajebusalta,\n capacidadbateria: capacidadbateria,\n amperiosenplaca: amperiosenplaca, \n voltajescc: voltajescc,\n prioridadSBU: prioridadSBU,\n estadoconf: estadoconf,\n estadoscc: estadoscc,\n voltajeconstantemientrascarga: voltajeconstantemientrascarga,\n estadodecargageneral: estadodecargageneral,\n estadodecargasolar: estadodecargasolar,\n estadodecargared: estadodecargared,\n estadodelswitch: estadodelswitch\n } ,\n/* topic: {numerodeserie: numerodeserie}*/\n }\n];","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":630,"y":300,"wires":[["4c1a593c.2808d8"]]},{"id":"231c7627.1620fa","type":"function","z":"2c0cfdc.c46c602","name":"QPIRIExtraccion","func":"var output = msg.payload.split(\" \");\nlet voltajeredconf = parseFloat((output[0].slice(1, 5)));\nlet amperiosredmaxconf = parseFloat(output[1]);\nlet voltajesalidaconf = parseFloat(output[2]);\nlet frecuenciasalidaconf = parseFloat(output[3]);\nlet amperiossalidaconf = parseFloat(output[4]);\nlet potenciaaparentesalidaconf = parseFloat(output[5]);\nlet potenciaactivasalidaconf = parseFloat(output[6]);\nlet voltajebateriaconf = parseInt(output[7]);\nlet voltajelimitedescargabatconf = parseFloat(output[8]);\nlet voltajelimiterecargabatconf = parseFloat(output[22]);\nlet voltajeminimoparacorteconf = parseFloat(output[9]);\nlet voltajeabsorcionconf = parseFloat(output[10]);\nlet voltajeflotacionconf = parseFloat(output[11]);\nlet tipodebateriaconf = parseInt(output[12]);\nlet amperiosmaxcargadorbatconf = parseInt(output[13]);\nlet amperiosmaxtotalesabatconf = parseInt(output[14]);\nlet rangovoltajedentradaconf = parseInt(output[15]);\nlet prioridadfuentesalidaconf = parseInt(output[16]);\nlet prioridadcargadorbatconf = parseInt(output[17]);\nlet maximonumeroparalelosconf = parseInt(output[18]);\nlet tipodemaquina = parseInt(output[19]);\nlet tipodehibridoconf = parseInt(output[20]);\nlet tipodesalidaparaleloconf = parseInt(output[21]);\nlet potenciasolarparaleloconf = parseInt(output[23]);\nlet potenciasolarbalanceconf = parseInt(output[24]);\nreturn [\n {\n payload: {\n voltajeredconf: voltajeredconf,\n amperiosredmaxconf: amperiosredmaxconf,\n voltajesalidaconf: voltajesalidaconf,\n frecuenciasalidaconf: frecuenciasalidaconf,\n amperiossalidaconf: amperiossalidaconf,\n potenciaaparentesalidaconf: potenciaaparentesalidaconf,\n potenciaactivasalidaconf: potenciaactivasalidaconf,\n voltajebateriaconf: voltajebateriaconf,\n voltajelimiterecargabatconf: voltajelimiterecargabatconf,\n voltajelimitedescargabatconf: voltajelimitedescargabatconf,\n voltajeminimoparacorteconf: voltajeminimoparacorteconf,\n voltajeabsorcionconf: voltajeabsorcionconf,\n voltajeflotacionconf: voltajeflotacionconf,\n tipodebateriaconf: tipodebateriaconf,\n amperiosmaxcargadorbatconf: amperiosmaxcargadorbatconf,\n amperiosmaxtotalesabatconf: amperiosmaxtotalesabatconf,\n rangovoltajedentradaconf: rangovoltajedentradaconf,\n prioridadfuentesalidaconf: prioridadfuentesalidaconf,\n prioridadcargadorbatconf: prioridadcargadorbatconf,\n maximonumeroparalelosconf: maximonumeroparalelosconf,\n tipodemaquina: tipodemaquina,\n tipodehibridoconf: tipodehibridoconf,\n tipodesalidaparaleloconf: tipodesalidaparaleloconf,\n potenciasolarparaleloconf: potenciasolarparaleloconf,\n potenciasolarbalanceconf: potenciasolarbalanceconf\n }\n }\n]","outputs":1,"noerr":0,"x":620,"y":460,"wires":[["4c1a593c.2808d8"]]},{"id":"848b4d62.aae62","type":"function","z":"2c0cfdc.c46c602","name":"QVFW Extraccion U1","func":"var output = msg.payload;\nlet Firmware = (output.slice(10, 15));\nreturn [\n {\n payload: {\n Firmware: Firmware\n }\n }\n]","outputs":1,"noerr":0,"x":640,"y":340,"wires":[["4c1a593c.2808d8"]]},{"id":"f68d0ca2.3e3b","type":"function","z":"2c0cfdc.c46c602","name":"QVFW2 Firmware U2","func":"var output = msg.payload;\nlet Firmware2 = (output.slice(11, 16));\nreturn [\n {\n payload: {\n Firmware2: Firmware2\n }\n }\n]","outputs":1,"noerr":0,"x":640,"y":380,"wires":[["4c1a593c.2808d8"]]},{"id":"4cccba7e.48b844","type":"function","z":"2c0cfdc.c46c602","d":true,"name":"QBEQI Ecu Extrac","func":"var output = msg.payload.split(\" \");\nlet activacionecualizacion = parseInt(output[0].slice(1, 2));\nlet tiempoecualizacion = parseInt(output[1]);\nlet diasentreecualizaciones = parseInt(output[2]);\nlet maxamperiosparaecualizar = parseInt(output[3]);\nlet diasquefaltanparaecualizar = parseInt(output[4]);\nlet voltajedeecualizacion = parseFloat(output[5]);\nlet tiempodeabsorcion = parseInt(output[6]);\nlet timeoutecualizacion = parseInt(output[7]);\nreturn [\n {\n payload: {\n activacionecualizacion: activacionecualizacion,\n tiempoecualizacion: tiempoecualizacion,\n diasentreecualizaciones: diasentreecualizaciones,\n maxamperiosparaecualizar: maxamperiosparaecualizar,\n diasquefaltanparaecualizar: diasquefaltanparaecualizar,\n voltajedeecualizacion: voltajedeecualizacion,\n tiempodeabsorcion: tiempodeabsorcion,\n timeoutecualizacion: timeoutecualizacion\n }\n }\n]","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":630,"y":740,"wires":[["4c1a593c.2808d8"]]},{"id":"208b6136.748a4e","type":"function","z":"2c0cfdc.c46c602","name":"QID Nº Serie Extrac","func":"var numerodeserie = msg.payload.slice(1, 15);\nflow.set('numerodeserie', numerodeserie);\nreturn [\n {\n payload: {\n numerodeserie: numerodeserie\n }\n }\n];\n// Numero de Serie va a flow o incluso podria ir a global para identificar en paralelos ","outputs":1,"noerr":0,"initialize":"","finalize":"","x":640,"y":260,"wires":[["4c1a593c.2808d8"]]},{"id":"76b888ca.efad58","type":"comment","z":"2c0cfdc.c46c602","name":"Extractores","info":"","x":650,"y":220,"wires":[]},{"id":"c7108bd6.a898e8","type":"function","z":"2c0cfdc.c46c602","name":"QPIWS Warnings Extrac","func":"var output = msg.payload;\nlet reservado = parseInt(output.slice(1, 2));\nlet falloinversor = parseInt(output.slice(2, 3));\nlet fallo08voltajebusalto = parseInt(output.slice(3, 4));\nlet fallo52voltajebusbajo = parseInt(output.slice(4, 5));\nlet fallo09softwarebus = parseInt(output.slice(5, 6));\nlet peligronoacinput = parseFloat(output.slice(6, 7));\nlet peligrocortopv = parseInt(output.slice(7, 8));\nlet fallo58voltajeinversorbajo = parseInt(output.slice(8, 9));\nlet fallo06voltajeinversoralto = parseInt(output.slice(9, 10));\nlet peligro02sobretemperatura = parseInt(output.slice(10, 11));\nlet peligro01ventilador = parseInt(output.slice(11, 12));\nlet peligro03altovoltajebateria = parseInt(output.slice(12, 13));\nlet peligro04bajovoltajebateria = parseInt(output.slice(13, 14));\nlet peligro07sobrecargar = parseInt(output.slice(14, 15));\nlet peligrobateriashutdown = parseInt(output.slice(15, 16));\nlet peligro10bateriaderating = parseInt(output.slice(16, 17));\nlet peligroeeprom = parseInt(output.slice(17, 18));\nlet fallo51sobrecorriente = parseInt(output.slice(18, 19));\nlet fallosoftwareinversor = parseInt(output.slice(19, 20));\nlet falloautotest = parseInt(output.slice(20, 21));\nlet fallo55continuaenac = parseInt(output.slice(21, 22));\nlet fallo56bateriaabierta = parseInt(output.slice(22, 23));\nlet fallo57sensorcorriente = parseInt(output.slice(23, 24));\nlet fallocortobateria = parseInt(output.slice(24, 25));\nlet peligrolimitepotencia = parseInt(output.slice(25, 26));\nlet peligro13altovoltajeplaca = parseInt(output.slice(26, 27));\nlet fallompptsobrecarga = parseInt(output.slice(27, 28));\nlet peligro14mpptsobrecarga = parseInt(output.slice(28, 29));\nlet peligro12bateriabajaparamppt = parseInt(output.slice(29, 30));\nreturn [\n {\n payload: {\n falloinversor: falloinversor,\n fallo08voltajebusalto: fallo08voltajebusalto,\n fallo52voltajebusbajo: fallo52voltajebusbajo,\n fallo09softwarebus: fallo09softwarebus,\n peligronoacinput: peligronoacinput,\n peligrocortopv: peligrocortopv,\n fallo06voltajeinversoralto: fallo06voltajeinversoralto,\n peligro02sobretemperatura: peligro02sobretemperatura,\n peligro01ventilador: peligro01ventilador,\n peligro03altovoltajebateria: peligro03altovoltajebateria,\n peligro04bajovoltajebateria: peligro04bajovoltajebateria,\n peligro07sobrecargar: peligro07sobrecargar,\n peligrobateriashutdown: peligrobateriashutdown,\n peligro10bateriaderating: peligro10bateriaderating,\n peligroeeprom: peligroeeprom,\n fallo51sobrecorriente: fallo51sobrecorriente,\n fallosoftwareinversor: fallosoftwareinversor,\n falloautotest: falloautotest,\n fallo55continuaenac: fallo55continuaenac,\n fallo56bateriaabierta: fallo56bateriaabierta,\n fallo57sensorcorriente: fallo57sensorcorriente,\n fallocortobateria: fallocortobateria,\n peligro13altovoltajeplaca: peligro13altovoltajeplaca,\n fallompptsobrecarga: fallompptsobrecarga,\n peligro14mpptsobrecarga: peligro14mpptsobrecarga,\n peligro12bateriabajaparamppt: peligro12bateriabajaparamppt\n }\n }\n]","outputs":1,"noerr":0,"initialize":"","finalize":"","x":650,"y":540,"wires":[["4c1a593c.2808d8"]]},{"id":"4c1a593c.2808d8","type":"join","z":"2c0cfdc.c46c602","name":"Juntando Todo 4 s","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"4","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":890,"y":380,"wires":[["eff4f325.390ac"]]},{"id":"c683b45d.2d7cb8","type":"link out","z":"2c0cfdc.c46c602","name":"TodasLecturasHibrido","links":[],"x":1040,"y":460,"wires":[],"l":true},{"id":"1b65284f.139fa8","type":"comment","z":"2c0cfdc.c46c602","name":"Creando Objeto con todas las lecturas del Hibrido","info":"","x":1020,"y":320,"wires":[]},{"id":"eff4f325.390ac","type":"function","z":"2c0cfdc.c46c602","name":"Id en topic num serie","func":"var topic = flow.get('numerodeserie');\nmsg.topic = topic;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1100,"y":380,"wires":[["c683b45d.2d7cb8","4231b9a42710da37","280e455d.250e1a"]]},{"id":"10de9cf2.6fb1a3","type":"inject","z":"2c0cfdc.c46c602","name":"QMOD Modo de Trabajo","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"5","crontab":"","once":false,"onceDelay":0.1,"topic":"Modo de Trabajo","payload":"QMOD","payloadType":"str","x":150,"y":820,"wires":[["ac2a49dd.512438"]]},{"id":"1c62fbc2.20db04","type":"function","z":"2c0cfdc.c46c602","name":"QMOD Extractor","func":"var output = msg.payload;\nlet mododetrabajo = output.slice(1, 2);\nreturn [{\n payload: {\n mododetrabajo: mododetrabajo\n }\n }\n ];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":620,"y":580,"wires":[["4c1a593c.2808d8"]]},{"id":"2927bbeda6465fb5","type":"tcp request","z":"2c0cfdc.c46c602","name":"","server":"192.168.1.145","port":"26","out":"time","ret":"buffer","splitc":"0","newline":"","trim":false,"tls":"","x":620,"y":160,"wires":[["765057a0.9c7028"]]},{"id":"4231b9a42710da37","type":"mqtt out","z":"2c0cfdc.c46c602","name":"","topic":"inversor/max","qos":"","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"48a3862e702eae8c","x":1130,"y":640,"wires":[]},{"id":"ffea1959e1538615","type":"mqtt in","z":"2c0cfdc.c46c602","name":"","topic":"inversor/max","qos":"1","datatype":"json","broker":"48a3862e702eae8c","nl":false,"rap":true,"rh":0,"inputs":0,"x":890,"y":680,"wires":[["f18484aad7c7dccc"]]},{"id":"f18484aad7c7dccc","type":"debug","z":"2c0cfdc.c46c602","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1100,"y":720,"wires":[]},{"id":"e15d8961bf1a6a20","type":"inject","z":"2c0cfdc.c46c602","name":"QPIGS2 Extraccion","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"5","crontab":"","once":false,"onceDelay":0.1,"topic":"Extraccion","payload":"QPIGS2","payloadType":"str","x":140,"y":860,"wires":[[]]},{"id":"fcd12eb.29738d","type":"function","z":"2c0cfdc.c46c602","name":"QPIGS2Extraccion","func":"var output = msg.payload.split(\" \");\nlet amperiosenplaca2 = parseInt(output[0].slice(1, 5));\nlet voltajeenplaca2 = parseInt(output[1]);\nlet potenciaenplaca2 = parseInt(output[2]);\nreturn [\n {\n payload: {\n potenciaenplaca2: potenciaenplaca2,\n voltajeenplaca2: voltajeenplaca2,\n amperiosenplaca2: amperiosenplaca2\n }\n }\n];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":650,"y":500,"wires":[["4c1a593c.2808d8"]]},{"id":"de7bd723a6d0161a","type":"function","z":"2c0cfdc.c46c602","name":"QPIGSExtraccion","func":"var output = msg.payload.split(\" \");\nlet voltajered = parseFloat(output[0].slice(1, 5));\nlet frecuenciared = parseFloat(output[1]);\nlet voltajesalida = parseFloat(output[2]);\nlet frecuenciasalida = parseFloat(output[3]);\nlet potenciaparentesalida = parseInt(output[4]);\nlet potenciaactivasalida = parseInt(output[5]);\nlet porcentajecargasalida = parseInt(output[6]);\nlet voltajebusalta = parseInt(output[7]);\nlet voltajebateria = parseFloat(output[8]);\nlet amperioscargabat = parseInt(output[9]);\nlet capacidadbateria = parseInt(output[10]);\nlet temperaturainversor = parseInt(output[11]);\nlet amperiosenplaca = parseInt(output[12]);\nlet voltajeenplaca = parseInt(output[13]);\nlet voltajescc = parseFloat(output[14]);\nlet amperiosdescargabat = parseInt(output[15]);\nlet prioridadSBU = parseInt(output[16].slice(0,1));\nlet estadoconf = parseInt(output[16].slice(1,2));\nlet estadoscc = parseInt(output[16].slice(2,3));\nlet cargasconectadas = parseInt(output[16].slice(3,4));\nlet voltajeconstantemientrascarga = parseInt(output[16].slice(4,5));\nlet estadodecargageneral = parseInt(output[16].slice(5,6));\nlet estadodecargasolar = parseInt(output[16].slice(6,7));\nlet estadodecargared = parseInt(output[16].slice(7,9));\nlet potenciaenplaca = parseInt(output[19]);\nlet estadodelmppt = parseInt(output[20].slice(0,1));\nlet estadodelswitch = parseInt(output[20].slice(1,2));\nreturn [\n {\n payload: {\n voltajered: voltajered,\n frecuenciared: frecuenciared,\n voltajesalida: voltajesalida,\n frecuenciasalida: frecuenciasalida,\n potenciaparentesalida: potenciaparentesalida,\n potenciaactivasalida: potenciaactivasalida,\n porcentajecargasalida: porcentajecargasalida,\n voltajebateria: voltajebateria,\n amperiosdescargabat: amperiosdescargabat,\n amperioscargabat: amperioscargabat,\n temperaturainversor: temperaturainversor,\n potenciaenplaca: potenciaenplaca,\n voltajeenplaca: voltajeenplaca,\n estadodelmppt: estadodelmppt,\n cargasconectadas: cargasconectadas,\n voltajebusalta: voltajebusalta,\n capacidadbateria: capacidadbateria,\n amperiosenplaca: amperiosenplaca, \n voltajescc: voltajescc,\n prioridadSBU: prioridadSBU,\n estadoconf: estadoconf,\n estadoscc: estadoscc,\n voltajeconstantemientrascarga: voltajeconstantemientrascarga,\n estadodecargageneral: estadodecargageneral,\n estadodecargasolar: estadodecargasolar,\n estadodecargared: estadodecargared,\n estadodelswitch: estadodelswitch\n }\n }\n];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":630,"y":680,"wires":[["4c1a593c.2808d8"]]},{"id":"6d1208c899ad6e7c","type":"function","z":"2c0cfdc.c46c602","name":"CRCTJ","func":" // Algoritmo para lanzar los comandos hacia Voltronics con CRC propietario\n // Algoritmo realizado por Tejota \n var topic = (msg.payload) + (\" \") + (msg.topic); // Topic con el comando string y posible descripcion\n var comandobuffer = Buffer.from(msg.payload); // pasando a buffer el string del comando \n var crc = 0x0000; // inicio del crc\n for (tj = 0; tj < comandobuffer.length; tj++) // scaneo del buffer\n {\n const byte = comandobuffer[tj]; // analizando el byte para aplicarle el crc16xmodem\n tejota = (crc >>> 8) & 0xff;\n tejota ^= byte & 0xff;\n tejota ^= tejota >>> 4;\n crc = (crc << 8) & 0xffff; // Algoritmo\n crc ^= tejota; // crc16 xmodem \n tejota = (tejota << 5) & 0xffff; // sin tabla estatica\n crc ^= tejota;\n tejota = (tejota << 7) & 0xffff;\n crc ^= tejota;\n } // resultante crc numerico \n var crchexastring = crc.toString(16).padStart(4,'0'); // crc numerico a string hexa añadiendo ceros a izquierda si es preciso\n var crchexabuffer = Buffer.from(crchexastring, \"hex\"); // buffer del crchexa\n for (mdk=0; mdk < crchexabuffer.length; mdk++) // scaneo del buffer\n {\n if (crchexabuffer[mdk]==10 || crchexabuffer[mdk]==13 || crchexabuffer[mdk]==40) // Exceptuando estos bytes mdk \n {\n crchexabuffer[mdk]++; // se pone el byte siguiente si es alguno de las excepciones mdk\n }\n } \n const retornodecarro = Buffer.from(\"\\r\");\n var crctotalbuffer = [comandobuffer, crchexabuffer, retornodecarro]; // construyendo el buffer final hacia el hibrido\n msg.payload = Buffer.concat(crctotalbuffer);\n msg.topic = topic;\n return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":280,"y":220,"wires":[["89c0f835.c54ab8"]]},{"id":"48a3862e702eae8c","type":"mqtt-broker","name":"","broker":"192.168.1.107","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"0","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]