{"record":{"id":"4e42cb0e720f764e","repo":"MagicMirrorOrg/MagicMirror","slug":"weather-deprecation-warning-your-are-using-the","errorCode":null,"errorMessage":"[weather] Deprecation warning: Your are using the deprecated config values 'useKmh'. Please switch to windUnits!","messagePattern":"\\[weather\\] Deprecation warning: Your are using the deprecated config values 'useKmh'\\. Please switch to windUnits!","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"defaultmodules/weather/weather.js","lineNumber":102,"sourceCode":"\n\t// Override getHeader method.\n\tgetHeader () {\n\t\tif (this.config.appendLocationNameToHeader) {\n\t\t\tconst locationName = this.fetchedLocationName || \"\";\n\n\t\t\tif (this.data.header && locationName) return `${this.data.header} ${locationName}`;\n\t\t\telse if (locationName) return locationName;\n\t\t}\n\n\t\treturn this.data.header ? this.data.header : \"\";\n\t},\n\n\t// Start the weather module.\n\tstart () {\n\t\tmoment.locale(this.config.lang);\n\n\t\tif (this.config.useKmh) {\n\t\t\tLog.warn(\"[weather] Deprecation warning: Your are using the deprecated config values 'useKmh'. Please switch to windUnits!\");\n\t\t\tthis.windUnits = \"kmh\";\n\t\t} else if (this.config.useBeaufort) {\n\t\t\tLog.warn(\"[weather] Deprecation warning: Your are using the deprecated config values 'useBeaufort'. Please switch to windUnits!\");\n\t\t\tthis.windUnits = \"beaufort\";\n\t\t}\n\t\tif (typeof this.config.showHumidity === \"boolean\") {\n\t\t\tLog.warn(\"[weather] Deprecation warning: Please consider updating showHumidity to the new style (config string).\");\n\t\t\tthis.config.showHumidity = this.config.showHumidity ? \"wind\" : \"none\";\n\t\t}\n\n\t\t// All providers run server-side: use stable identifier so reconnects don't spawn duplicate HTTPFetchers\n\t\tthis.instanceId = this.identifier;\n\n\t\tif (window.initWeatherTheme) window.initWeatherTheme(this);\n\n\t\tLog.log(`[weather] Initializing server-side provider with instance ID: ${this.instanceId}`);\n\n\t\tthis.sendSocketNotification(\"INIT_WEATHER\", {","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/MagicMirrorOrg/MagicMirror/blob/4b4a59534f7da01e4030e46029fe9dd649a7675e/defaultmodules/weather/weather.js#L84-L120","documentation":"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`.","triggerScenarios":"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.","commonSituations":"Long-time MagicMirror users upgrading the weather module after migrating from old weather modules (currentweather) that used useKmh; copied configs from older tutorials.","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."],"exampleFix":"// before\nconfig: { weatherProvider: \"openweathermap\", useKmh: true }\n// after\nconfig: { weatherProvider: \"openweathermap\", windUnits: \"kmh\" }","handlingStrategy":"validation","validationCode":"if (\"useKmh\" in weatherConfig) {\n  throw new Error(\"useKmh is deprecated: use windUnits: 'kmh'\");\n}","typeGuard":"function usesDeprecatedWindOpts(cfg) {\n  return \"useKmh\" in cfg || \"useBeaufort\" in cfg;\n}","tryCatchPattern":null,"preventionTips":["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."],"tags":["deprecation","config","weather"],"backgroundTag":"deprecated-config-option","analyzedSha":"4b4a59534f7da01e4030e46029fe9dd649a7675e","analyzedAt":"2026-08-31T21:49:42.591Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}