====== Node-Red: Zbieranie informacji na temat temperatury za pomocą narzędzia Node-Red ====== Jeżeli chcesz przeczytać jak działa Node-Red kliknij [[projekty:projektsystemupomiarowokontrolnegonabaziearduino#omowienie_zasady_dzialania_systemu_node-red|tutaj]]. Przepływ node-red. {{:narzedzia:pasted:20250513-142809.png}} konfiguracja HTTP request {{:narzedzia:pasted:20250513-142855.png}} Kod w środku węzła //Make Query// // Format current date-time as a string const now = new Date(); const dateStr = now.toISOString(); // You can reformat if needed // Get the temperature from the payload const temp = msg.payload; // Extract the numeric value from the temperature string const tempValue = parseInt(temp.replace(/[^\-?\d]/g, '')); msg.temp = tempValue; // Construct the SQL query (excluding ID) msg.topic = ` INSERT INTO WarsawTemp ([DATE], [TEMP]) VALUES ('${dateStr}', ${tempValue}) `; return msg;