Untitled
unknown
plain_text
a month ago
1.3 kB
3
Indexable
Never
var weight = msg.payload.weight; var temperature = msg.payload.temperature; // Check if weight is greater than 20 kg var occupied = weight > 20; // Check if temperature is between 34 and 42°C var validTemp = temperature >= 34 && temperature <= 42; // Determine fan status var fanStatus = (occupied && validTemp) ? "ON" : "OFF"; msg.payload = { weight: weight, temperature: temperature, fanStatus: fanStatus }; return msg; 4. Add Dashboard Text Node to Display Status for Seat 2 Purpose: This node will display the status of Seat 2 on the dashboard. Configuration: Weight: msg.payload.weight Temperature: msg.payload.temperature Fan Status: msg.payload.fanStatus Connecting the Nodes Inject Node: Connect to the first function node (generate random values). First Function Node: Connect to the second function node (check occupancy). Second Function Node: Connect to the three dashboard text nodes (weight, temperature, fan status). Deploy and Test Deploy the flow by clicking the Deploy button. Observe the random sensor values and fan status for Seat 2 on the dashboard. Repeat these steps for each of the 15 seats (3 cabins with 5 seats each) to complete the setup. If you need further assistance or customization, feel free to ask!
Leave a Comment