Monitorizacion de un AXPERT MAX mediante NODERED.
Aunque este modelo dispone de un display inteligente (MCU) capaz de recolectar datos por si solo y de disponer de un gateway wifi con una app china para su control y monitorizacion lo que voy a contar a continuacion sirve tambien para controlar y monitorizar con nuestra propia aplicación sobre un hardware ARM como es una raspberry Pi y un sistema operativo RASPBIAN con NODERED como plataforma de desarrollo de nuestra app.
La forma de conectarse al MAX es por puerto serie, bien sea desde un conversor USB-RS232 o bien desde un conversor RS-232-TCPIP descritos en los hilos:
https://www.solarweb.net/forosolar/f...60x-resto.html https://www.solarweb.net/forosolar/f...232-tcpip.html
Como es un hibrido un poco diferente a los offgrid standard, logicamente lleva comandos nuevos de control y monitorizacion.
Al llevar control de tiempo (fecha y hora) tambien hay comandos nuevos que se basan en esta variable.
Vamos a comenzar por los flujos de monitorizacion, es decir, de solo lectura. Este hibrido trabaja en protocolo P30.
Flujo presentado:
Código HTML:
[{"id":"9bc9a9f6.d07ec8","type":"tab","label":"Axpert MAX","disabled":false,"info":""},{"id":"509893d1.98ab3c","type":"function","z":"9bc9a9f6.d07ec8","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":1020,"y":640,"wires":[["8bc4fb15.08c6c8"]]},{"id":"645a2e8b.dcbcb","type":"debug","z":"9bc9a9f6.d07ec8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1590,"y":180,"wires":[]},{"id":"22222d68.bf0a42","type":"link out","z":"9bc9a9f6.d07ec8","name":"Respuesta Puerto serie","links":["4faa967b.783d88"],"x":1410,"y":640,"wires":[],"l":true},{"id":"ff4e665c.3a6d68","type":"comment","z":"9bc9a9f6.d07ec8","name":"Comunicacion Puerto Serie","info":"","x":1190,"y":600,"wires":[]},{"id":"ab516497.6a2e48","type":"switch","z":"9bc9a9f6.d07ec8","name":"Repartidor Datos Lecturas","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"QID Numero de Serie","vt":"str"},{"t":"eq","v":"QPIGS Estado General","vt":"str"},{"t":"eq","v":"QVFW Version CPU1","vt":"str"},{"t":"eq","v":"QVFW3 Firmware CPU3","vt":"str"},{"t":"eq","v":"QFLAG Miscelanea","vt":"str"},{"t":"eq","v":"QPIRI Configuracion","vt":"str"},{"t":"eq","v":"QBEQI Ecualizacion Bateria","vt":"str"},{"t":"eq","v":"QPIWS Informacion Warnings","vt":"str"},{"t":"eq","v":"QMOD Modo de Trabajo","vt":"str"},{"t":"eq","v":"QPIGS2 Campo2","vt":"str"},{"t":"eq","v":"QLED Barra LED","vt":"str"},{"t":"cont","v":"energiaproducidadiaria","vt":"str"},{"t":"cont","v":"cargadiariaentregada","vt":"str"}],"checkall":"true","repair":false,"outputs":13,"x":810,"y":280,"wires":[["9c689710.cb0018"],["e4137dce.db47"],["4423063a.c56eb8"],["198b4fc2.1fca4"],["8d3d9618.158258"],["bd349fa8.774d1"],["dd066a1.e232a98"],["af0311cf.2cd99"],["3a0b2dac.6bc8a2"],["fcd12eb.29738d"],["3b4d261d.daba4a"],["c2c747ec.cc0b58"],["f5269e19.63df9"]]},{"id":"63fac829.9a70a8","type":"comment","z":"9bc9a9f6.d07ec8","name":"Repartiendo por topic","info":"","x":820,"y":160,"wires":[]},{"id":"8d3d9618.158258","type":"function","z":"9bc9a9f6.d07ec8","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":1070,"y":220,"wires":[["40daa278.7eaa8c"]]},{"id":"e4137dce.db47","type":"function","z":"9bc9a9f6.d07ec8","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":1070,"y":100,"wires":[["40daa278.7eaa8c"]]},{"id":"bd349fa8.774d1","type":"function","z":"9bc9a9f6.d07ec8","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]);\nglobal.set('voltajeabsorcionconfmax0' , voltajeabsorcionconf);\nglobal.set('voltajeflotacionconfmax0' , voltajeflotacionconf);\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,"initialize":"","finalize":"","x":1060,"y":260,"wires":[["40daa278.7eaa8c"]]},{"id":"4423063a.c56eb8","type":"function","z":"9bc9a9f6.d07ec8","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":1080,"y":140,"wires":[["40daa278.7eaa8c"]]},{"id":"198b4fc2.1fca4","type":"function","z":"9bc9a9f6.d07ec8","name":"QVFW3 Firmware U3","func":"var output = msg.payload;\nlet Firmware3 = (output.slice(10, 15));\nreturn [\n {\n payload: {\n Firmware3: Firmware3\n }\n }\n]","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1080,"y":180,"wires":[["40daa278.7eaa8c"]]},{"id":"dd066a1.e232a98","type":"function","z":"9bc9a9f6.d07ec8","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,"noerr":0,"initialize":"","finalize":"","x":1070,"y":300,"wires":[["40daa278.7eaa8c"]]},{"id":"9c689710.cb0018","type":"function","z":"9bc9a9f6.d07ec8","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":1080,"y":60,"wires":[["40daa278.7eaa8c"]]},{"id":"d4064c8b.a9e53","type":"comment","z":"9bc9a9f6.d07ec8","name":"Extractores","info":"","x":1070,"y":20,"wires":[]},{"id":"af0311cf.2cd99","type":"function","z":"9bc9a9f6.d07ec8","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":1090,"y":340,"wires":[["5b6d382c.101f88"]]},{"id":"40daa278.7eaa8c","type":"join","z":"9bc9a9f6.d07ec8","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":1350,"y":280,"wires":[["d4e52660.0f5988"]]},{"id":"3a0b2dac.6bc8a2","type":"function","z":"9bc9a9f6.d07ec8","name":"QMOD Extractor","func":"var output = msg.payload;\nlet mdts = output.slice(1, 2);\nlet mododetrabajo;\nif (mdts === \"P\") {\n mododetrabajo = 0;\n} else if (mdts === \"S\") {\n mododetrabajo = 1;\n} else if (mdts === \"L\") {\n mododetrabajo = 2;\n} else if (mdts === \"B\") {\n mododetrabajo = 3;\n} else if (mdts === \"F\") {\n mododetrabajo = 4;\n} else if (mdts === \"H\") {\n mododetrabajo = 5;\n} \nreturn [{\n payload: {\n mododetrabajo: mododetrabajo\n }\n }\n ];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1060,"y":380,"wires":[["40daa278.7eaa8c"]]},{"id":"fcd12eb.29738d","type":"function","z":"9bc9a9f6.d07ec8","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":1070,"y":420,"wires":[["40daa278.7eaa8c"]]},{"id":"3b4d261d.daba4a","type":"function","z":"9bc9a9f6.d07ec8","name":"QLEDExtraccion","func":"var output = msg.payload.split(\" \");\nlet led = parseInt(output[0].slice(1, 2));\nlet ledvelocidad = parseInt(output[1]);\nlet ledefectos = parseInt(output[2]);\nlet ledbrillo = parseInt(output[3]);\nlet ledcosa = parseInt(output[4]);\nlet colorred = (output[5].slice(0,9));\nlet colorsolar = (output[5].slice(9,18));\nlet colorbateria = (output[5].slice(18,27));\nreturn [\n {\n payload: {\n led: led,\n ledvelocidad: ledvelocidad,\n ledefectos: ledefectos,\n ledbrillo: ledbrillo,\n ledcosa: ledcosa,\n colorred: colorred,\n colorsolar: colorsolar,\n colorbateria: colorbateria\n }\n }\n];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1060,"y":460,"wires":[["40daa278.7eaa8c"]]},{"id":"c2c747ec.cc0b58","type":"function","z":"9bc9a9f6.d07ec8","name":"QED Energia diaria producida","func":"var energiadiaria = parseInt(msg.payload.slice(1, 9));\nreturn [\n {\n payload: {\n energiadiaria: energiadiaria\n }\n }\n];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1110,"y":500,"wires":[["40daa278.7eaa8c"]]},{"id":"f5269e19.63df9","type":"function","z":"9bc9a9f6.d07ec8","name":"QLD Carga diaria entregada","func":"var cargadiariaentregada = parseInt(msg.payload.slice(1, 9));\nreturn [\n {\n payload: {\n cargadiariaentregada: cargadiariaentregada\n }\n }\n];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1100,"y":540,"wires":[["40daa278.7eaa8c"]]},{"id":"1dd162e5.f2db9d","type":"inject","z":"9bc9a9f6.d07ec8","name":"QPIRI Configuracion","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"4","crontab":"","once":false,"onceDelay":0.1,"topic":"Configuracion","payload":"QPIRI","payloadType":"str","x":160,"y":280,"wires":[["61ce5339.3ff7ac"]]},{"id":"bb6879c0.e826a8","type":"inject","z":"9bc9a9f6.d07ec8","name":"QFLAG Miscelanea","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"4","crontab":"","once":false,"onceDelay":0.1,"topic":"Miscelanea","payload":"QFLAG","payloadType":"str","x":160,"y":240,"wires":[["61ce5339.3ff7ac"]]},{"id":"60ba838c.a6dd2c","type":"inject","z":"9bc9a9f6.d07ec8","name":"QBEQI Ecualizacion Bateria","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"4","crontab":"","once":false,"onceDelay":0.1,"topic":"Ecualizacion Bateria","payload":"QBEQI","payloadType":"str","x":190,"y":320,"wires":[["61ce5339.3ff7ac"]]},{"id":"a17ca4f5.bae9e8","type":"inject","z":"9bc9a9f6.d07ec8","name":"QPIWS Informacion Warnings","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"4","crontab":"","once":false,"onceDelay":0.1,"topic":"Informacion Warnings","payload":"QPIWS","payloadType":"str","x":190,"y":360,"wires":[["61ce5339.3ff7ac"]]},{"id":"5acbc736.c03538","type":"inject","z":"9bc9a9f6.d07ec8","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":170,"y":120,"wires":[["61ce5339.3ff7ac"]]},{"id":"a6e956bb.15a808","type":"inject","z":"9bc9a9f6.d07ec8","name":"QID Numero de Serie","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"4","crontab":"","once":false,"onceDelay":0.1,"topic":"Numero de Serie","payload":"QID","payloadType":"str","x":160,"y":80,"wires":[["61ce5339.3ff7ac"]]},{"id":"d882e049.679d1","type":"inject","z":"9bc9a9f6.d07ec8","name":"QVFW Firmware CPU1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"4","crontab":"","once":false,"onceDelay":0.1,"topic":"Version CPU1","payload":"QVFW","payloadType":"str","x":170,"y":160,"wires":[["61ce5339.3ff7ac"]]},{"id":"251c2eb7.ca3252","type":"inject","z":"9bc9a9f6.d07ec8","name":"QVFW3 Firmware CPU3","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"4","crontab":"","once":false,"onceDelay":0.1,"topic":"Firmware CPU3","payload":"QVFW3","payloadType":"str","x":170,"y":200,"wires":[["61ce5339.3ff7ac"]]},{"id":"61ce5339.3ff7ac","type":"link out","z":"9bc9a9f6.d07ec8","name":"EntradaalCRC","links":["2756c316.eadf3c"],"x":580,"y":360,"wires":[],"l":true},{"id":"497e6e1c.0ee55","type":"comment","z":"9bc9a9f6.d07ec8","name":"Comandos de monitorizacion cada 4 segundos","info":"Comandos de Monitorizacion","x":220,"y":40,"wires":[]},{"id":"39202c23.e6ea64","type":"inject","z":"9bc9a9f6.d07ec8","name":"QMOD Modo de Trabajo","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"4","crontab":"","once":false,"onceDelay":0.1,"topic":"Modo de Trabajo","payload":"QMOD","payloadType":"str","x":170,"y":400,"wires":[["61ce5339.3ff7ac"]]},{"id":"c82b0d71.22c3c","type":"inject","z":"9bc9a9f6.d07ec8","name":"QPIGS2 Segundo Campo","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"4","crontab":"","once":false,"onceDelay":0.1,"topic":"Campo2","payload":"QPIGS2","payloadType":"str","x":180,"y":440,"wires":[["61ce5339.3ff7ac"]]},{"id":"4813b372.e9c16c","type":"inject","z":"9bc9a9f6.d07ec8","name":"DAT Ajuste de Fecha","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 04 * * *","once":false,"onceDelay":0.1,"topic":"ajustedetiempo","payload":"DAT","payloadType":"str","x":160,"y":480,"wires":[["da8cd6b5.8dc498"]]},{"id":"da8cd6b5.8dc498","type":"simpletime","z":"9bc9a9f6.d07ec8","name":"","mydate":true,"myymd":true,"myyear":true,"mymonth":true,"mymonthn":true,"mydom":true,"mydoy":true,"myday":true,"myhourpm":true,"myhour":true,"mytime":true,"mytimes":true,"myminute":true,"myminutes":true,"mysecond":true,"mymillis":true,"myepoch":true,"myrawdate":true,"mypm":true,"x":130,"y":520,"wires":[["7ca8dbdc.f345e4"]]},{"id":"7ca8dbdc.f345e4","type":"function","z":"9bc9a9f6.d07ec8","name":"FormatoTiempo","func":"var comando = msg.payload;\nvar aa = msg.myyear.slice(2,4);\nvar mm = msg.mymonthn;\nvar dd = msg.mydom;\nvar hh = msg.myhour;\nvar ff = msg.myminute;\nvar ss = msg.mysecond;\nmsg.payload = comando + aa + mm + dd + hh + ff + ss;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":300,"y":520,"wires":[["61ce5339.3ff7ac"]]},{"id":"445143c5.a5e9fc","type":"inject","z":"9bc9a9f6.d07ec8","name":"QLED Barra LED","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"4","crontab":"","once":false,"onceDelay":0.1,"topic":"Barra LED","payload":"QLED","payloadType":"str","x":150,"y":560,"wires":[["61ce5339.3ff7ac"]]},{"id":"aa4c4d04.97883","type":"inject","z":"9bc9a9f6.d07ec8","name":"Energiaproducidadiaria","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"energiaproducidadiaria","payload":"QED","payloadType":"str","x":170,"y":600,"wires":[["aafe8fbb.da251"]]},{"id":"aafe8fbb.da251","type":"simpletime","z":"9bc9a9f6.d07ec8","name":"","mydate":true,"myymd":true,"myyear":true,"mymonth":true,"mymonthn":true,"mydom":true,"mydoy":true,"myday":true,"myhourpm":true,"myhour":true,"mytime":true,"mytimes":true,"myminute":true,"myminutes":true,"mysecond":true,"mymillis":true,"myepoch":true,"myrawdate":true,"mypm":true,"x":370,"y":600,"wires":[["2f807913.a65ce6"]]},{"id":"d4afdba8.6582e8","type":"inject","z":"9bc9a9f6.d07ec8","name":"Cargadiariaentregada","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"cargadiariaentregada","payload":"QLD","payloadType":"str","x":170,"y":640,"wires":[["dc6f9b44.a170f8"]]},{"id":"dc6f9b44.a170f8","type":"simpletime","z":"9bc9a9f6.d07ec8","name":"","mydate":true,"myymd":true,"myyear":true,"mymonth":true,"mymonthn":true,"mydom":true,"mydoy":true,"myday":true,"myhourpm":true,"myhour":true,"mytime":true,"mytimes":true,"myminute":true,"myminutes":true,"mysecond":true,"mymillis":true,"myepoch":true,"myrawdate":true,"mypm":true,"x":370,"y":640,"wires":[["985cc328.92477"]]},{"id":"2f807913.a65ce6","type":"function","z":"9bc9a9f6.d07ec8","name":"FormatoTiempo","func":"var comando = msg.payload;\nvar aa = msg.myyear;\nvar mm = msg.mymonthn;\nvar dd = msg.mydom;\nmsg.payload = comando + aa + mm + dd;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":600,"wires":[["61ce5339.3ff7ac"]]},{"id":"985cc328.92477","type":"function","z":"9bc9a9f6.d07ec8","name":"FormatoTiempo","func":"var comando = msg.payload;\nvar aa = msg.myyear;\nvar mm = msg.mymonthn;\nvar dd = msg.mydom;\nmsg.payload = comando + aa + mm + dd;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":640,"wires":[["61ce5339.3ff7ac"]]},{"id":"6919b517.d1e43c","type":"comment","z":"9bc9a9f6.d07ec8","name":"Monitorizacion para Hibrido AXPERT MAX SINGLE ","info":"","x":690,"y":40,"wires":[]},{"id":"4698e682.977198","type":"link out","z":"9bc9a9f6.d07ec8","name":"TodasLecturasAXPERTMAX","links":[],"x":1560,"y":340,"wires":[],"l":true},{"id":"bd8fa222.184f2","type":"comment","z":"9bc9a9f6.d07ec8","name":"Creando Objeto con todas las lecturas del Hibrido","info":"","x":1440,"y":240,"wires":[]},{"id":"d4e52660.0f5988","type":"function","z":"9bc9a9f6.d07ec8","name":"Id en topic num serie","func":"var topic = flow.get('numerodeserie');\nmsg.topic = topic;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1560,"y":280,"wires":[["4698e682.977198","645a2e8b.dcbcb"]]},{"id":"2756c316.eadf3c","type":"link in","z":"9bc9a9f6.d07ec8","name":"EntradaalCRC","links":["61ce5339.3ff7ac"],"x":830,"y":640,"wires":[["509893d1.98ab3c"]],"l":true},{"id":"4faa967b.783d88","type":"link in","z":"9bc9a9f6.d07ec8","name":"Respuesta Puerto serie","links":["22222d68.bf0a42"],"x":580,"y":280,"wires":[["ab516497.6a2e48"]],"l":true},{"id":"5b6d382c.101f88","type":"rbe","z":"9bc9a9f6.d07ec8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1310,"y":340,"wires":[["40daa278.7eaa8c"]]},{"id":"8bc4fb15.08c6c8","type":"serial request","z":"9bc9a9f6.d07ec8","name":"","serial":"f455d2af.938f","x":1190,"y":640,"wires":[["22222d68.bf0a42"]]},{"id":"f455d2af.938f","type":"serial-port","z":"","serialport":"/dev/ttyUSB0","serialbaud":"2400","databits":"8","parity":"none","stopbits":"1","waitfor":"","dtr":"none","rts":"none","cts":"none","dsr":"none","newline":"\\r","bin":"false","out":"char","addchar":"","responsetimeout":"10000"}]
Corresponde a este flujo en la plataforma:
Archivo adjunto 23973
Algunas consideraciones de este flujo:
1.- Esta hecho para conversor USB-RS232 tipo PL2303.
2.- La salida obtenida es un JSON con todos los parametros solicitados y topic el numero de serie del MAX.
3.- La solicitud de datos es cada 4 segundos.
4.- Hay un ajuste de fecha y hora una vez cada 24 horas siendo a las 4:00 cuando se hace.
5.- Da datos cada minuto de energia producida por campos solares (los dos) diarios.
6.- Da datos cada minuto de energia consumida en ACOUT diaria.
7.- Es necesaria la instalacion del nodo
simpletime. Se busca en la paleta de nodos instalables.
Para proximas entregas queda pendiente un dashboard alimentado por ese JSON como podria ser este:
Archivo adjunto 23974