KristjanESPERANTO / MMM-OneCallWeather

Magic Mirror weather module using openweathermap.org "One Call" api
MIT License
3 stars 2 forks source link

loading.. #2

Closed mirrormonark closed 9 months ago

mirrormonark commented 1 year ago

My config:

        {
            module: "onecall/loader",
            disabled: false,
            config: {
                lat: "XXXX",                               // your location latitude,
                lon: "XXXX",                               // your location longitude,
                appid: "XXXXXXXXXXXXXX",                             // your Openweathermap appid
                appid2: "",                            // optional
                backup: "",                            // optional backup appid
                dayUpdateInterval: 10 * 60 * 1000,     // every 10 minutes
                nightUpdateInterval: 15 * 60 * 1000,   // every 15 minutes
            }
        },
        {   
            module: "MMM-OneCallWeather",
            position: "top_right",  // This can be any of the regions.
                                    // Best results in bottom_bar region due to horizontal default layout and icon sizes.
            pages: {"daily":"top_right"},
            disabled: false,
            config: {
                // See 'Configuration options' for more information.
                latitude: "XXXXX", //Latitude from https://www.latlong.net/
                longitude: "XXXXX", //Longitude from https://www.latlong.net/ - is West + is East of London
                apikey: "XXXXXXXXXXXXXXXXXXX" //openweathermap.org API key.
            }
        },

I'm using the modules "page-indicator" and "page-selector" in my mirror

mirrormonark commented 1 year ago

I noticed that the old form called "Onecall" no longer exists and was used for this module it seems to me. It is a 2-3 year old module but there is nothing left.. neither dev nor module... I have the folder

KristjanESPERANTO commented 1 year ago

Where did you get that module: "onecall/loader"? I have never seen such a module.

Try this:

        {   
            module: "MMM-OneCallWeather",
            position: "top_right",
            pages: {"daily":"top_right"},
            disabled: false,
            config: {
                latitude: "XXXXX",
                longitude: "XXXXX",
                apikey: "XXXXX",
                                apiVersion: "3.0"
            }
        },

Of course you have to replace the XXXXX parts :slightly_smiling_face:

KristjanESPERANTO commented 1 year ago

When did you create your apikey?

mirrormonark commented 1 year ago

apikey with openweather... apikey only free not buy.

The OneCall module was a module to take the API is use it more than once but making the call look like only once. That was how it worked.

The OneCall module contained the possibility of having APIs per hour, daily, in anticipation,

mirrormonark commented 1 year ago

it doesn't work.. :(

KristjanESPERANTO commented 1 year ago

The OneCall module was a module to take the API is use it more than once but making the call look like only once.

Sounds nice. Where did you get it?

it doesn't work.. :(

I think we will figure it out. What does npm run config:check say? (you have to run it in the MagicMirror folder)

KristjanESPERANTO commented 1 year ago

When did you create your apikey? I'm asking this to find out if it's a key for apiVersion 2.5 or 3.0.

mirrormonark commented 1 year ago

npm run config:check say "Your configuration file doesn't contain syntax errors :)"

mirrormonark commented 1 year ago

I found this guy who forked the dev... That doesn't work either. Try . https://github.com/handwrittenjello/onecall

mirrormonark commented 1 year ago

maybe you could implement it in your fork

mirrormonark commented 1 year ago

I own 2 apikeys. one made this year (2 days ago) while the other was made in 2020 I think so it should be 2.5

KristjanESPERANTO commented 1 year ago

I found this guy who forked the dev...

This is definitely interesting. I'll take a look. I don't have the time for new functions at the moment. But some troubleshooting is okay.

I own 2 apikeys. one made this year (2 days ago) while the other was made in 2020 I think so it should be 2.5

Please try the following: Remove all modules from your config and add only this module with the new apikey:

        {   
            module: "MMM-OneCallWeather",
            position: "top_right",
            pages: {"daily":"top_right"},
            disabled: false,
            config: {
                latitude: "XXXXX",
                longitude: "XXXXX",
                apikey: "XXXXX",
                                apiVersion: "3.0"
            }
        },

If that doesn't work: Which node version (node -v) and which npm version (npm -v) do you have?

mirrormonark commented 1 year ago

I did what you asked (delete all modules) but it always tells me "upload". As for the versions here it is: node version: v16.19.1 npm version: 8.19.3

mirrormonark commented 1 year ago

hey i see this.. [MMM-OneCallWeather] 14-Mar-23 00:05 ERROR AxiosError: Request failed with status code 401

KristjanESPERANTO commented 1 year ago

Okay, this is an indication that something is wrong with the key.

Can you create a third key and send it to me in a private message via the forum? After the test you can delete it again. I would test how the correct setting must be for your keys.

But I'm going to sleep soon. So I won't answer anymore today.

mirrormonark commented 1 year ago

goodnight :)

KristjanESPERANTO commented 1 year ago

Something is wrong with the key you sent me. I always get the following error message: "Invalid API key. Please see https://openweathermap.org/faq#error401 for more info." (with the onecall endpoint in version 2.5 and 3.0). But the weather endpoint, on the other hand, works with your key. That's strange.

I also created a new key for myself and it works with that - I have only the Free plan. I'm running out of ideas 😕

mirrormonark commented 1 year ago

Is it possible that the free plan provides that only one API can be created? because I didn't delete the others. Can we prove this? Did you sir have a API created or do you have more than one for testing?

KristjanESPERANTO commented 1 year ago

I currently have two keys in my OpenWeatherMap account. One that I use productively and one for testing. Both work fine.

mirrormonark commented 1 year ago

I apologize, I can ask you all the steps you do on the OpenWeather site... I think to me that I did not enable the OneCall then..

KristjanESPERANTO commented 1 year ago

On the My services page, the following should be in the "Price Plan" column: "Free Plan".

On the API Key page you can generate new keys.

mirrormonark commented 1 year ago

the weather modules I use are: MMM-WEATHERBACKGROUND MMM-OPENMAPWHEATHER MMM-NOAA3 MMM-PLACEINFO

I use them on separate pages so not all together. Could it be that one of these gives problems to the module?

mirrormonark commented 1 year ago

i try.. OFF all this module but nothing

mirrormonark commented 1 year ago

API calls return an error 401

You can get the error 401 in the following cases:

You did not specify your API key in API request. Your API key is not activated yet. Within the next couple of hours, it will be activated and ready to use. You are using wrong API key in API request. Please, check your right API key in personal account. You are using a Free subscription and try requesting data available in other subscriptions . For example, 16 days/daily forecast API, any historical weather data, Weather maps 2.0, etc). Please, check your subscription in your personal account

mirrormonark commented 1 year ago

MMM-weatherforecast this is only work for forecast for me

mirrormonark commented 1 year ago

Hourly forecast: unavailable Daily forecast: unavailable Calls per minute: 60 3 hour forecast: 5 days

i believe is this the problem. with free api and i believe i have api 2.5 e not 3.0

KristjanESPERANTO commented 1 year ago

Hourly forecast: unavailable Daily forecast: unavailable Calls per minute: 60 3 hour forecast: 5 days

I have the same.

mirrormonark commented 1 year ago

but for you working??

KristjanESPERANTO commented 1 year ago

Yes, it works perfectly.

mirrormonark commented 1 year ago

maybe the problem is because use 4-5 modules with openmap

mirrormonark commented 1 year ago

hi how are you? let me inform you that i figured out the problem on this form...i simply paid the site subscription for the plan and everything works. i had not entered any card before.

KristjanESPERANTO commented 1 year ago

Interesting. Then new free API keys might not work anymore? 😮

mirrormonark commented 1 year ago

i don't think so. simply i did the api onecall plan... i put in my cash card and i have like 1000 free calls if i exceed i pay.

Manu85340 commented 9 months ago

@KristjanESPERANTO hello I installed your MMM-OneCallWeather module thanks to @sdetweil, he helped me with this module and many other things and I have a question in the readme he wrote there: "colored If set 'colored' to true the min-temp get a blue tone and the max-temp get a red tone.

Default value: true" I added this to my js.config but the values remain white am I doing something wrong?

KristjanESPERANTO commented 9 months ago

@Manu85340 Please open a new issue and show there your config (without API key) :slightly_smiling_face:

KristjanESPERANTO commented 9 months ago

I'm closing this issue because mirrormonark was able to solve the issue by switching to a paid key.