MagicMirrorOrg/MagicMirror · warning
[weather] Deprecation warning: Your are using the deprecated
Error message
[weather] Deprecation warning: Your are using the deprecated config values 'useKmh'. Please switch to windUnits!
What it means
The weather module's start() detects the legacy boolean config option `useKmh` and emits a deprecation warning while internally mapping it to windUnits = 'kmh'. The module still works, but the option is scheduled for removal; the replacement is the string option `windUnits`.
Source
Thrown at defaultmodules/weather/weather.js:102
// Override getHeader method.
getHeader () {
if (this.config.appendLocationNameToHeader) {
const locationName = this.fetchedLocationName || "";
if (this.data.header && locationName) return `${this.data.header} ${locationName}`;
else if (locationName) return locationName;
}
return this.data.header ? this.data.header : "";
},
// Start the weather module.
start () {
moment.locale(this.config.lang);
if (this.config.useKmh) {
Log.warn("[weather] Deprecation warning: Your are using the deprecated config values 'useKmh'. Please switch to windUnits!");
this.windUnits = "kmh";
} else if (this.config.useBeaufort) {
Log.warn("[weather] Deprecation warning: Your are using the deprecated config values 'useBeaufort'. Please switch to windUnits!");
this.windUnits = "beaufort";
}
if (typeof this.config.showHumidity === "boolean") {
Log.warn("[weather] Deprecation warning: Please consider updating showHumidity to the new style (config string).");
this.config.showHumidity = this.config.showHumidity ? "wind" : "none";
}
// All providers run server-side: use stable identifier so reconnects don't spawn duplicate HTTPFetchers
this.instanceId = this.identifier;
if (window.initWeatherTheme) window.initWeatherTheme(this);
Log.log(`[weather] Initializing server-side provider with instance ID: ${this.instanceId}`);
this.sendSocketNotification("INIT_WEATHER", {View on GitHub (pinned to 4b4a59534f)
Solutions
- Remove `useKmh: true` from the weather config and add `windUnits: "kmh"`.
- If wind speed in another unit is desired, pick the matching windUnits value ('metric'/'imperial'/'kmh'/'beaufort' as supported).
- Restart MagicMirror and confirm the warning no longer appears.
Example fix
// before
config: { weatherProvider: "openweathermap", useKmh: true }
// after
config: { weatherProvider: "openweathermap", windUnits: "kmh" } Defensive patterns
Strategy: validation
Validate before calling
if ("useKmh" in weatherConfig) {
throw new Error("useKmh is deprecated: use windUnits: 'kmh'");
} Type guard
function usesDeprecatedWindOpts(cfg) {
return "useKmh" in cfg || "useBeaufort" in cfg;
} Prevention
- Use windUnits ('kmh'/'beaufort' etc.) instead of legacy booleans.
- Lint config.js against a schema that rejects removed keys.
- Read the module changelog after upgrading.
When it happens
Trigger: Config.js contains `useKmh: true` (or any truthy value) in the weather module configuration; the check `if (this.config.useKmh)` in start() fires the warning.
Common situations: Long-time MagicMirror users upgrading the weather module after migrating from old weather modules (currentweather) that used useKmh; copied configs from older tutorials.
Related errors
- [weather] Deprecation warning: Your are using the deprecated
- [weather] Deprecation warning: Please consider updating show
- Unknown weather type: ${this.config.type}
- apiKey is required
- Latitude and longitude are required
AI-assisted analysis of MagicMirrorOrg/MagicMirror@4b4a59534f (2026-08-31).
Data as JSON: /api/errors/4e42cb0e720f764e.
Report an issue: GitHub.