node-red-contrib-weather

raw JSON →
0.1.2 verified Sat Apr 25 auth: no javascript maintenance

Node-RED Node for fetching weather data from Xiaomi (Mi) weather API for Chinese locations. Current stable version 0.1.2, last released 2019-12-5, no active development. Key differentiator: simple integration with Node-RED, supports latitude/longitude input within China only, outputs weather object, temperature, humidity, weather condition, AQI, sunrise/sunset. Does not use any official weather API; data source is Xiaomi's internal service. Low maintenance, bug fixes via GitHub issues/QQ group.

error TypeError: Cannot read property 'payload' of undefined
cause Input msg object is missing or not from a proper Node-RED inject node.
fix
Ensure inject node is configured to send a JSON payload: {"latitude":31,"longitude":121}.
error Error: No data from weather API
cause Latitude/longitude out of China range or API temporarily unavailable.
fix
Use coordinates within China (e.g., 31,121 for Shanghai). Check network connectivity.
error Weather node output is empty object {}
cause Input payload not parsed as JSON; node uses default lat/lon from node config which may be empty.
fix
Set input payload to valid JSON string: {"latitude":31,"longitude":121} or configure lat/lon in node properties.
gotcha Only supports Chinese locations; lat/lon outside China (approx 18-54 N, 73-135 E) will return no data or errors.
fix Use only within China; for global weather, use other nodes like node-red-contrib-openweathermap.
deprecated Unofficial Xiaomi API; may break or become unavailable without notice.
fix Consider switching to a more reliable weather node using an official API with API key.
breaking Output structure changed in v0.1.1: data moved from msg to msg.payload.
fix Update downstream nodes to read msg.payload instead of msg directly.
deprecated No updates since 2019-12-5; no activity, may be abandoned.
fix Check for newer versions or consider alternatives.
npm install node-red-contrib-weather
yarn add node-red-contrib-weather
pnpm add node-red-contrib-weather

Shows minimal Node-RED flow using the weather node with latitude/longitude input.

// In Node-RED flow:
// Inject node -> weather node -> Debug node
// Inject node payload: {"latitude":31,"longitude":121}
// Weather node configuration: leave lat/lon empty (use input payload)
// Debug node outputs weather object with fields: temperature, humidity, condition, AQI, sunrise, sunset, etc.