Registry / communication / node-red-contrib-weather

node-red-contrib-weather

JSON →
library0.1.2jsnpmunverified

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.

npm install node-red-contrib-weather
INSTALL
IMPORT
SIG · NODE-RED-CONTRIB-W
N
node-red-contrib-weather
communicationjavascriptv0.1.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

weather node
Install via npm: npm install -g node-red-contrib-weather (then use in Node-RED palette)
Cannot import in code; it's a Node-RED node, not a library.
Node-RED nodes are added via npm install and appear in the palette; no programmatic import.
msg.payload input
Input msg.payload must be JSON: {"latitude":31,"longitude":121}
Sending non-JSON payload or missing payload field; node falls back to node's configured lat/lon.
Only supports China region; lat/lon ranges approx 18-54 N, 73-135 E.
output msg.payload
Weather data is placed in msg.payload (object with weather fields).
Expecting msg.data or msg.weather; earlier versions (0.0.x) used msg directly.
Since v0.1.1, output changed from msg to msg.payload.

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.
Debug
Known issues
gotchaOnly 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.
affects: >=0.0.1
deprecatedUnofficial 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.
affects: >=0.0.1
breakingOutput 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.
affects: >=0.1.1
deprecatedNo updates since 2019-12-5; no activity, may be abandoned.
fix
Check for newer versions or consider alternatives.
affects: >=0.1.2
Errors
Common errors & fixes
TypeError: Cannot read property 'payload' of undefined
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: No data from weather API
Latitude/longitude out of China range or API temporarily unavailable.
fix
Use coordinates within China (e.g., 31,121 for Shanghai). Check network connectivity.
Weather node output is empty object {}
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.
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
node-redrequiredThis is a Node-RED contrib node, requires Node-RED runtime (peer dependency).
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
node-red-contrib-weather — npm install node-red-contrib-weather · libregistry