Got it working! I think I’ll just avoid dot notation from now on…
Repo is linked below. If anyone’s looking to use this, OpenWeatherMap’s One Call API asks for latitude and longitude instead of a location or location ID. But in return, you can get not only current and daily (max 7 days) forecasts, but also hourly forecasts (max 48 hours).
All original functionality of the module should remain intact.
Sample Module Configurations:
{
module: "weather",
position: "bottom_left",
header: "Current Forecast",
config: {
weatherProvider: "openweathermap",
weatherEndpoint: "/onecall",
type: "wDataCurrent",
apiKey: "OPENWEATHERMAPAPIKEY", // your OpenWeatherMap API key
initialLoadDelay: 0,
lat: 40.7128, // your latitude
lon: -74.0060, // your longitude
}
},
{
module: "weather",
position: "bottom_center",
header: "Hourly Forecast",
config: {
weatherProvider: "openweathermap",
weatherEndpoint: "/onecall",
type: "wDataHourly",
apiKey: "OPENWEATHERMAPAPIKEY", // your OpenWeatherMap API key
initialLoadDelay: 2500,
lat: 40.7128, // your latitude
lon: -74.0060, // your longitude
maxEntries: 32, // max 48, set by OWM One Call API
showPrecipitationAmount: true
}
},
{
module: "weather",
position: "bottom_right",
header: "Daily Forecast",
config: {
weatherProvider: "openweathermap",
weatherEndpoint: "/onecall",
type: "wDataDaily",
apiKey: "OPENWEATHERMAPAPIKEY", // your OpenWeatherMap API key
initialLoadDelay: 5000,
lat: 40.7128, // your latitude
lon: -74.0060, // your longitude
maxEntries: 7, // max 7, set by OWM One Call API
colored: true,
showPrecipitationAmount: true
}
}
Sample MagicMirror Output:
Link to Branch
Not making a pull request yet since I don’t know how the default Weather module is meant to be designed.