LCN automation Issendorf

Copy - paste the flow.

In text field id the lcn protocol description.

Enjoy.

[{"id":"11f0d0f26419dfe5","type":"tab","label":"LCN","disabled":false,"info":"","env":[]},{"id":"58f3be09d04d6229","type":"function","z":"11f0d0f26419dfe5","name":"lcnCrc","func":"// Obliczanie lcn_crc\nfunction lcn_crc(data) {\n    var _crc = 0;\n    for (var a = 0; a < data.length; a++) {\n        _crc += data[a];\n        _crc = (_crc << 2) & 0xFFFF;\n        _crc += ((_crc >> 9) & 0x03);\n        _crc += ((_crc >> 8) & 0x01);\n        _crc &= 0x00FF;\n    }\n    return _crc;\n}\n\n// Pobierz dane z bufora wejściowego\nvar inputBuffer = msg.payload;\n\n// Konwertuj bufor na tablicę\nvar input = Array.from(inputBuffer);\nvar receivedCRC = input[2]; // Trzeci bajt, który jest otrzymaną sumą kontrolną\n\n// Obliczenie CRC dla wszystkich bajtów oprócz trzeciego bajtu\nvar crcData = input.slice(0, 2).concat(input.slice(3)); // Bajty 0 i 1 są przed trzecim bajtem, a bajty po 3 włącznie są po trzecim bajcie\nvar calculatedCRC = lcn_crc(crcData);\n\n// Przygotowanie wyniku\nmsg.payload = {\n    calculatedCRC: calculatedCRC,\n    receivedCRC: receivedCRC,\n    crcMatch: calculatedCRC === receivedCRC // Sprawdzenie czy obliczone CRC jest zgodne z otrzymanym CRC\n};\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":260,"wires":[["d8cadda423d9bba0"]]},{"id":"d8cadda423d9bba0","type":"debug","z":"11f0d0f26419dfe5","name":"debug 7","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":700,"y":260,"wires":[]},{"id":"e4b02ef357a9b08e","type":"comment","z":"11f0d0f26419dfe5","name":"LCN - opis protokołu","info":"\nLCN\nParametry transmisji.\n- 9600, 8-bit, bez kontroli parzystości, 1-stop\n- Sygnał DTR ma być cały czas aktywny\n- Sygnał RTS ma być aktywny w czasie wysyłania danych\n- Sygnał DSR służy do sprawdzenia zajętości magistrali\n- Sygnał CTS służy do określenia czasu trwania ramki i pauzy między ramkami. Na\nlinii CTS jest ten sam sygnał co na linii RXD.\nPakiet danych LCN\n1. Adres źródłowy\n2. INFO (rodzaj pakietu)\n3. Suma kontrolna CRC\n4. Segment sieci\n5. Adres docelowy\n6. Polecenie\n7. Parametr 1\n8. Parametr 2\n1. Adres źródłowy\n- 5-254 dla urządzeń\n- 1 dla komputera\nW celu uzyskania poprawnej wartości należy dokonać lustrzanego odbicia tego\nbajta. Np. odebrana wartość 0x0A oznacza adres 0x05.\n2. INFO (rodzaj pakietu)\n- 0x00 – Pakiet z potwierdzeniem odbioru pakietu, dla komputera. Pakiet\ntego rodzaju ma krótszą długość (6 bajtów), a polecenia ma wartość 0x00\n- 0x04 – Pakiet z rozkazem, wysyłanym, z jednego urządzenia do drugiego\n- 0x05 – Pakiet z rozkazem, wysyłany z komputera do urządzenia\n- 0x06 – Pakiet zwrotny z informacją o aktualnym stanie urządzenia, np. z\ninformacją o aktualnym poziomie oświetlenia. W tym przypadku, adresem\ndocelowym zawsze jest 0x04\n- 0x07 – Pakiet wysyłany do grupy. W polu „adres docelowy”, powinien się\nznaleźć adres grupy 5-254. Adres grupowy 0x03 dotyczy wszystkich\nurządzeń. Urządzenie może mieć przypisanych 12 adresów grupowych.\n3. Suma kontrolna CRC\nSuma kontrolna obliczana jest dla wszystkich bajtów z wyłączeniem samego\nbajta sumy CRC.\nPrzykładowa implementacja:\nunsigned char lcn_crc(unsigned char *data, unsigned char size)\n{\nint a;\nunsigned int _crc=0;\nfor(a=0; a<size; a++)\n{\n_crc += *(data+a);\n_crc <<= 2;\n_crc += ((_crc>>9)&0x03);\n_crc += ((_crc>>8)&0x01);\n_crc &= 0x00FF;\n}\nreturn _crc;\n}\n4. Segment sieci\nAktualnie używany segment sieci to: 0x00.\nW dokumentacji podany jest zakres numerów segmentów: 5-124\n5. Adres docelowy.\nAdres z zakresu 5-254, lub adres grupy.\n6, 7, 8. Polecenie, parametr 1, parametr 2.\nWartości specyficzne dla konkretnego urządzenia, do sterowania jego pracą.\nWYKAZ POLECEŃ STERUJĄCYCH\nPuste polecenie.\nPolecenie = 0x00\nPar 1 = 0x00\nPar 2 = 0x00\nNa tego typu polecenie również wysyłane jest potwierdzenie\nUstaw jasność świecenia obu żarówek.\nPolecenie = 0x01\nPar 1 – wartość jasności dla żarówki 1, z zakresu 0-200 (0-100%)\nPar 2 – wartość jasności dla żarówki 2, z zakresu 0-200 (0-100%)\nCzas rozjaśniania/ściemniania nie podlega regulacji\nUstaw jasność świecenia żarówki.\nPolecenie = 0x04 – żarówka nr 1\nPolecenie = 0x05 – żarówka nr 2\nPar 1 – wartość jasności, z zakresu 0-50 (0-100%)\nPar 2 – czas rozjaśniania/ściemniania, z zakresu 0-250 (0-486s)\ndla par2 <= 4 czas = par2 * 0.25s\ndla 5 <= par2 <= 6 czas = ( pra2 * 0.5s ) - 1\ndla 7 <= par2 <= 10 czas = ( par2 * 1s ) – 4\ndla 11<=par2 <= 250 czas = ( par2 * 2s ) – 14\ndla par2 > 250 czas = 486s\nNp.:\nPar2 = 0 czas = 0s\nPar2 = 1 czas = 0.25s\nPar2 = 2 czas = 0.5s\nPar2 = 3 czas = 0.75s\nPar2 = 4 czas = 1s\nPar2 = 5 czas = 1.5s\nPar2 = 6 czas = 2s\nPar2 = 7 czas = 3s\nPar2 = 8 czas = 4s\nPar2 = 9 czas = 5s\nPar2 = 10 czas = 6s\nPar2 = 11 czas = 8s\nPar2 = 12 czas = 10s\nPar2 = 13 czas = 12s\nPar2 = 14 czas = 14s\nWłącz – wyłącz żarówkę (invert).\nWłącza pojedynczą żarówkę gdy była wyłączona lub wyłącza żarówkę gdy była\nwłączona (Invert).\nPolecenie = 0x04 – żarówka nr 1\nPolecenie = 0x05 – żarówka nr 2\nPar 1 = 0xFD\nPar 2 – czas rozjaśniania/ściemniania, z zakresu 0-250 (0-486s)\nStop rozjaśnianie/ściemnianie (ramp stop).\nPolecenie = 0x04 – żarówka nr 1\nPolecenie = 0x05 – żarówka nr 2\nPar 1 = 0x7B\nPar 2 = 0xFE\nWłącz i ściemnij.\nUstawia natychmiastowo jasność na podany poziom, a następnie zmniejsza je do zera\nz podanym czasem ściemniania.\nPolecenie = 0x0E – żarówka nr 1\nPolecenie = 0x0F – żarówka nr 2\nPar 1 – początkowa wartość jasności, z zakresu 0-50 (0-100%)\nPar 2 – czas ściemniania, z zakresu 0-250 (0-486s)\nWłącz żarówkę na pewien czas.\nZałącza jedną z żarówek, na określony czas. Czas rozjaśniania jest stały. Czas\nściemniania można wybrać jako: fast, normal, slow.\nPolecenie = 0x04 – żarówka 1\nPolecenie = 0x05 – żarówka 2\nPar 1 = 0xFC\nPar 2 = 0x40 + czas świecenia, dla trybu fast\nPar 2 = 0x80 + czas świecenia, dla trybu normal\nPar 2 = 0xC0 + czas świecenia, dla trybu slow\nWartość czasu świecenia z zakresu 0-57 ( 0-1500s)\ndla wartości: 0 do 30 czas = wartość * 6s\ndla wartości: 36 do 57 czas = ( wartość * 60s ) - 1920\nMigotanie żarówki.\nMigocze pojedynczą żarówką, określoną ilość razy, z określoną szybkością\nrozjaśniania i ściemniania, z określonym maksymalną jasnością.\nPolecenie = 0x04 – żarówka 1\nPolecenie = 0x05 – żarówka 2\nPar 1 – bity 0-3 – ilość migotań: 0-15\nPar 1 – bity 4-5 – maksymalna jasność świecenia: 01-25%, 10-50%, 11-100%\nPar 1 – bity 6-7 – szybkość rozjaśniania/ściemniania: 00-fast, 01-normal, 10-slow\nPar 2 = 0xFD\nRelatywna zmiana jasności oświetlenia.\nPolecenie = 0x04 – żarówka 1\nPolecenie = 0x05 – żarówka 2\n","x":150,"y":40,"wires":[]},{"id":"29ae550043562ace","type":"function","z":"11f0d0f26419dfe5","name":"function 1","func":"var dataArray = msg.payload;\nvar inputByte = msg.payload[0];\nvar mirroredByte = 0;\n\nfor (var i = 0; i < 8; i++) {\n    if ((inputByte & (1 << i)) !== 0) {\n        mirroredByte |= (1 << (7 - i));\n    }\n}\n\n// Obliczanie lcn_crc\nfunction lcn_crc(data) {\n    var _crc = 0;\n    for (var a = 0; a < data.length; a++) {\n        _crc += data[a];\n        _crc = (_crc << 2) & 0xFFFF;\n        _crc += ((_crc >> 9) & 0x03);\n        _crc += ((_crc >> 8) & 0x01);\n        _crc &= 0x00FF;\n    }\n    return _crc;\n}\n\n// Pobierz dane z bufora wejściowego\nvar inputBuffer = msg.payload;\n\n// Konwertuj bufor na tablicę\nvar input = Array.from(inputBuffer);\nvar receivedCRC = input[2]; // Trzeci bajt, który jest otrzymaną sumą kontrolną\n\n// Obliczenie CRC dla wszystkich bajtów oprócz trzeciego bajtu\nvar crcData = input.slice(0, 2).concat(input.slice(3)); // Bajty 0 i 1 są przed trzecim bajtem, a bajty po 3 włącznie są po trzecim bajcie\nvar calculatedCRC = lcn_crc(crcData);\n\nvar jsonObject = {\n    senderAddress: mirroredByte,\n    info: dataArray[1],\n    receivedCRC: dataArray[2],\n    segment: dataArray[3],\n    receiverAddress: dataArray[4],\n    polecenie: dataArray[5],\n    parameter1: dataArray[6],\n    parameter2: dataArray[7],\n    crcMatch: calculatedCRC === receivedCRC\n};\n\nmsg.payload = jsonObject;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":440,"wires":[["1bc6bee7d10f3ff2","ad6580877131d051","466b2aca99c4780e","a026c85ce1d1e320","94890b441f2b0b3b","2e684b936aa2631e","0ac698dde099ab84","7ca54496aca9451f"]]},{"id":"8fa4bffbade14077","type":"ui_led","z":"11f0d0f26419dfe5","order":2,"group":"60af8dd3.b5f624","width":0,"height":0,"label":"PK1","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#cfc4c4","value":"0","valueType":"num"},{"color":"#008000","value":"1","valueType":"num"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":1090,"y":360,"wires":[]},{"id":"1bc6bee7d10f3ff2","type":"function","z":"11f0d0f26419dfe5","name":"function 3","func":"// Pobierz dane z wiadomości wejściowej\nvar data1 = msg.payload.polecenie;\nvar data2 = msg.payload.parameter1;\nvar data3 = msg.payload.parameter2;\nvar n = 3; // zmień tę wartość na numer żądanego bitu\n\n// Sprawdź warunek\nif (data1 === 104 && data2 === 48) {\n    // Jeżeli warunek spełniony, zwróć data3\n    msg.payload = (data3 >> n) & 1;\n} \n\n// Zwróć nową wiadomość\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":500,"wires":[["5ba6169aa84fa5bb","95f1057ba60a8208"]]},{"id":"d8dda85714261830","type":"ui_led","z":"11f0d0f26419dfe5","order":2,"group":"60af8dd3.b5f624","width":0,"height":0,"label":"PK2","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#cfc4c4","value":"0","valueType":"num"},{"color":"#008000","value":"1","valueType":"num"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":1090,"y":400,"wires":[]},{"id":"3fca03840a06f1be","type":"ui_led","z":"11f0d0f26419dfe5","order":2,"group":"60af8dd3.b5f624","width":0,"height":0,"label":"PK3","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#cfc4c4","value":"0","valueType":"num"},{"color":"#008000","value":"1","valueType":"num"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":1090,"y":440,"wires":[]},{"id":"5ba6169aa84fa5bb","type":"ui_led","z":"11f0d0f26419dfe5","order":2,"group":"60af8dd3.b5f624","width":0,"height":0,"label":"PK4","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#cfc4c4","value":"0","valueType":"num"},{"color":"#008000","value":"1","valueType":"num"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":1090,"y":480,"wires":[]},{"id":"717159b5eb8769f5","type":"ui_led","z":"11f0d0f26419dfe5","order":2,"group":"60af8dd3.b5f624","width":0,"height":0,"label":"PK5","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#cfc4c4","value":"0","valueType":"num"},{"color":"#008000","value":"1","valueType":"num"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":1090,"y":520,"wires":[]},{"id":"c66428f4d357c9f3","type":"ui_led","z":"11f0d0f26419dfe5","order":2,"group":"60af8dd3.b5f624","width":0,"height":0,"label":"PK6","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#cfc4c4","value":"0","valueType":"num"},{"color":"#008000","value":"1","valueType":"num"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":1090,"y":560,"wires":[]},{"id":"120701f9847c22ba","type":"ui_led","z":"11f0d0f26419dfe5","order":2,"group":"60af8dd3.b5f624","width":0,"height":0,"label":"PK7","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#cfc4c4","value":"0","valueType":"num"},{"color":"#008000","value":"1","valueType":"num"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":1090,"y":600,"wires":[]},{"id":"c21510a4f4df56ed","type":"ui_led","z":"11f0d0f26419dfe5","order":2,"group":"60af8dd3.b5f624","width":0,"height":0,"label":"PK8","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#cfc4c4","value":"0","valueType":"num"},{"color":"#008000","value":"1","valueType":"num"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":1090,"y":640,"wires":[]},{"id":"a026c85ce1d1e320","type":"function","z":"11f0d0f26419dfe5","name":"function 4","func":"// Pobierz dane z wiadomości wejściowej\nvar data1 = msg.payload.polecenie;\nvar data2 = msg.payload.parameter1;\nvar data3 = msg.payload.parameter2;\nvar n = 2; // zmień tę wartość na numer żądanego bitu\n\n// Sprawdź warunek\nif (data1 === 104 && data2 === 48) {\n    // Jeżeli warunek spełniony, zwróć data3\n    msg.payload = (data3 >> n) & 1;\n} \n\n// Zwróć nową wiadomość\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":460,"wires":[["3fca03840a06f1be"]]},{"id":"466b2aca99c4780e","type":"function","z":"11f0d0f26419dfe5","name":"function 5","func":"// Pobierz dane z wiadomości wejściowej\nvar data1 = msg.payload.polecenie;\nvar data2 = msg.payload.parameter1;\nvar data3 = msg.payload.parameter2;\nvar n = 1; // zmień tę wartość na numer żądanego bitu\n\n// Sprawdź warunek\nif (data1 === 104 && data2 === 48) {\n    // Jeżeli warunek spełniony, zwróć data3\n    msg.payload = (data3 >> n) & 1;\n}\n\n// Zwróć nową wiadomość\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":420,"wires":[["d8dda85714261830"]]},{"id":"ad6580877131d051","type":"function","z":"11f0d0f26419dfe5","name":"function 6","func":"// Pobierz dane z wiadomości wejściowej\nvar data1 = msg.payload.polecenie;\nvar data2 = msg.payload.parameter1;\nvar data3 = msg.payload.parameter2;\nvar n = 0; // zmień tę wartość na numer żądanego bitu\n\n// Sprawdź warunek\nif (data1 === 104 && data2 === 48) {\n    // Jeżeli warunek spełniony, zwróć data3\n    msg.payload = (data3 >> n) & 1;\n}\n\n// Zwróć nową wiadomość\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":380,"wires":[["8fa4bffbade14077"]]},{"id":"94890b441f2b0b3b","type":"function","z":"11f0d0f26419dfe5","name":"function 7","func":"// Pobierz dane z wiadomości wejściowej\nvar data1 = msg.payload.polecenie;\nvar data2 = msg.payload.parameter1;\nvar data3 = msg.payload.parameter2;\nvar n = 4; // zmień tę wartość na numer żądanego bitu\n\n// Sprawdź warunek\nif (data1 === 104 && data2 === 48) {\n    // Jeżeli warunek spełniony, zwróć data3\n    msg.payload = (data3 >> n) & 1;\n} \n\n// Zwróć nową wiadomość\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":540,"wires":[["717159b5eb8769f5"]]},{"id":"2e684b936aa2631e","type":"function","z":"11f0d0f26419dfe5","name":"function 8","func":"// Pobierz dane z wiadomości wejściowej\nvar data1 = msg.payload.polecenie;\nvar data2 = msg.payload.parameter1;\nvar data3 = msg.payload.parameter2;\nvar n = 5; // zmień tę wartość na numer żądanego bitu\n\n// Sprawdź warunek\nif (data1 === 104 && data2 === 48) {\n    // Jeżeli warunek spełniony, zwróć data3\n    msg.payload = (data3 >> n) & 1;\n} \n\n// Zwróć nową wiadomość\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":580,"wires":[["c66428f4d357c9f3"]]},{"id":"0ac698dde099ab84","type":"function","z":"11f0d0f26419dfe5","name":"function 9","func":"// Pobierz dane z wiadomości wejściowej\nvar data1 = msg.payload.polecenie;\nvar data2 = msg.payload.parameter1;\nvar data3 = msg.payload.parameter2;\nvar n = 6; // zmień tę wartość na numer żądanego bitu\n\n// Sprawdź warunek\nif (data1 === 104 && data2 === 48) {\n    // Jeżeli warunek spełniony, zwróć data3\n    msg.payload = (data3 >> n) & 1;\n} \n\n// Zwróć nową wiadomość\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":620,"wires":[["120701f9847c22ba"]]},{"id":"7ca54496aca9451f","type":"function","z":"11f0d0f26419dfe5","name":"function 10","func":"// Pobierz dane z wiadomości wejściowej\nvar data1 = msg.payload.polecenie;\nvar data2 = msg.payload.parameter1;\nvar data3 = msg.payload.parameter2;\nvar n = 7; // zmień tę wartość na numer żądanego bitu\n\n// Sprawdź warunek\nif (data1 === 104 && data2 === 48) {\n    // Jeżeli warunek spełniony, zwróć data3\n    msg.payload = (data3 >> n) & 1;\n} \n\n// Zwróć nową wiadomość\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":660,"wires":[["c21510a4f4df56ed"]]},{"id":"95f1057ba60a8208","type":"debug","z":"11f0d0f26419dfe5","name":"debug 10","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1000,"y":300,"wires":[]},{"id":"d550af1bcc4e6b45","type":"function","z":"11f0d0f26419dfe5","name":"lcnOutput","func":"var inputBuffer = msg.payload;\nvar input = Array.from(inputBuffer);\nvar receivedCRC = input[2];\nvar crcData = input.slice(0, 2).concat(input.slice(3));\nvar calculatedCRC = lcn_crc(crcData);\n\n// Obliczanie lcn_crc\nfunction lcn_crc(data) {\n    var _crc = 0;\n    for (var a = 0; a < data.length; a++) {\n        _crc += data[a];\n        _crc = (_crc << 2) & 0xFFFF;\n        _crc += ((_crc >> 9) & 0x03);\n        _crc += ((_crc >> 8) & 0x01);\n        _crc &= 0x00FF;\n    }\n    return _crc;\n}\n\ninputBuffer[2]=calculatedCRC;\n\n// Zamiana tablicy na bufor raw\nconst arrayToRawBuffer = (array) => {\n    const buffer = Buffer.from(array);\n    return buffer;\n};\nif (Array.isArray(inputBuffer)) {\n    const outputBuffer = arrayToRawBuffer(inputBuffer);\n    msg.payload = outputBuffer;\n}\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":760,"wires":[["7e8a56d09c81162a","294ee59eb50ea257"]]},{"id":"7e8a56d09c81162a","type":"debug","z":"11f0d0f26419dfe5","name":"debug 13","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1040,"y":760,"wires":[]},{"id":"0d21494d72b7cf9d","type":"comment","z":"11f0d0f26419dfe5","name":"Receiving from LCN","info":"","x":210,"y":120,"wires":[]},{"id":"b3621bd9d72966cd","type":"ui_button","z":"11f0d0f26419dfe5","name":"","group":"60af8dd3.b5f624","order":10,"width":0,"height":0,"passthru":false,"label":"Przekaźnik 1","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"1","payloadType":"num","topic":"topic","topicType":"msg","x":410,"y":720,"wires":[["4c1751779e8c9ec6"]]},{"id":"4c1751779e8c9ec6","type":"function","z":"11f0d0f26419dfe5","name":"function 11","func":"var relayNo = msg.payload;\nvar destinationAddress = 11;\nmsg.payload=[1,4,0,0,destinationAddress,19,0,relayNo]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":760,"wires":[["d550af1bcc4e6b45"]]},{"id":"c36bfd0373e0f5c0","type":"ui_button","z":"11f0d0f26419dfe5","name":"","group":"60af8dd3.b5f624","order":10,"width":0,"height":0,"passthru":false,"label":"Przekaźnik 2","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"2","payloadType":"num","topic":"topic","topicType":"msg","x":410,"y":760,"wires":[["4c1751779e8c9ec6"]]},{"id":"3d94d2f59745b0f4","type":"ui_button","z":"11f0d0f26419dfe5","name":"","group":"60af8dd3.b5f624","order":10,"width":0,"height":0,"passthru":false,"label":"Przekaźnik 3","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"4","payloadType":"num","topic":"topic","topicType":"msg","x":410,"y":800,"wires":[["4c1751779e8c9ec6"]]},{"id":"1a84dd8d636bd3a6","type":"ui_button","z":"11f0d0f26419dfe5","name":"","group":"60af8dd3.b5f624","order":10,"width":0,"height":0,"passthru":false,"label":"Przekaźnik 4","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"8","payloadType":"num","topic":"topic","topicType":"msg","x":410,"y":840,"wires":[["4c1751779e8c9ec6"]]},{"id":"6b1e14f8e37c9e7c","type":"ui_button","z":"11f0d0f26419dfe5","name":"","group":"60af8dd3.b5f624","order":10,"width":0,"height":0,"passthru":false,"label":"Przekaźnik 5","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"16","payloadType":"num","topic":"topic","topicType":"msg","x":410,"y":880,"wires":[["4c1751779e8c9ec6"]]},{"id":"c2eae75ae150d187","type":"ui_button","z":"11f0d0f26419dfe5","name":"","group":"60af8dd3.b5f624","order":10,"width":0,"height":0,"passthru":false,"label":"Przekaźnik 6","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"32","payloadType":"num","topic":"topic","topicType":"msg","x":410,"y":920,"wires":[["4c1751779e8c9ec6"]]},{"id":"f34bc45139b74b8f","type":"ui_button","z":"11f0d0f26419dfe5","name":"","group":"60af8dd3.b5f624","order":10,"width":0,"height":0,"passthru":false,"label":"Przekaźnik 7","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"64","payloadType":"num","topic":"topic","topicType":"msg","x":410,"y":960,"wires":[["4c1751779e8c9ec6"]]},{"id":"fb4f905a78223925","type":"ui_button","z":"11f0d0f26419dfe5","name":"","group":"60af8dd3.b5f624","order":10,"width":0,"height":0,"passthru":false,"label":"Przekaźnik 8","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"128","payloadType":"num","topic":"topic","topicType":"msg","x":410,"y":1000,"wires":[["4c1751779e8c9ec6"]]},{"id":"3d953f3342e425f6","type":"serial in","z":"11f0d0f26419dfe5","name":"LCN-PK","serial":"16a7a178bc1f59c1","x":200,"y":200,"wires":[["58f3be09d04d6229","29ae550043562ace"]]},{"id":"f7ac56b611cbfac2","type":"comment","z":"11f0d0f26419dfe5","name":"Sending to LCN","info":"","x":200,"y":660,"wires":[]},{"id":"294ee59eb50ea257","type":"serial out","z":"11f0d0f26419dfe5","name":"LCN-PK","serial":"16a7a178bc1f59c1","x":1060,"y":700,"wires":[]},{"id":"60af8dd3.b5f624","type":"ui_group","name":"Default","tab":"18378f18.6d7e31","order":1,"disp":true,"width":"12","collapse":false,"className":""},{"id":"16a7a178bc1f59c1","type":"serial-port","serialport":"/dev/ttyS1","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","waitfor":"","dtr":"none","rts":"none","cts":"none","dsr":"none","newline":"\\n","bin":"false","out":"char","addchar":"","responsetimeout":"10000"},{"id":"18378f18.6d7e31","type":"ui_tab","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Flow Info

Created 1 year ago
Rating: not yet rated

Actions

Rate:

Node Types

Core
  • comment (x3)
  • debug (x3)
  • function (x12)
Other
  • serial in (x1)
  • serial out (x1)
  • serial-port (x1)
  • tab (x1)
  • ui_button (x8)
  • ui_group (x1)
  • ui_led (x8)
  • ui_tab (x1)

Tags

  • lcn
  • issendorf
  • averon
  • https://youtu.be/HEKY9fnAguA?si=aqkrWk6Ch0pX88Pu
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option