Seeing my previously working inputs were not functioning with no changes to my Mycodo setup and after switching to the OpenWeather One Call 3.0 API. I can’t seem to get the input to work.
I am not very knowledgeable in how everything works but did manage to get some info.
From Daemon log:
2024-10-02 18:40:05,761 - DEBUG - mycodo.inputs.weather_openweathermap_onecall_4a9ae47e - Response: {‘cod’: 401, ‘message’: ‘Invalid API key. Please see REMOVED LINK TO POST for more info.’}
2024-10-02 18:40:05,763 - ERROR - mycodo.inputs.weather_openweathermap_onecall_4a9ae47e - No response. Check your configuration.
User error I thought at first, (could still be really) but using these address in browser with the same API key works and the call is logged in my OpenWeather user account. I did notice there is quite a difference in the amount of data returned by the 2.5 vs 3.0 test and the “weather” vs “onecall” difference in address.
“https://api.openweathermap.org/data/2.5/weather?q=Chicago&appid=“API KEY””
“https://api.openweathermap.org/data/3.0/onecall?lat=42.060961&lon=-95.206711&appid=“API KEY””
Returns:
{
“lat”: 42.061,
“lon”: -95.2067,
“timezone”: “America/Chicago”,
“timezone_offset”: -18000,
“current”: {
“dt”: 1727912438,
“sunrise”: 1727871558,
“sunset”: 1727913629,
“temp”: 298.05,
“feels_like”: 297.25,
“pressure”: 1007,
“humidity”: 25,
“dew_point”: 276.69,
“uvi”: 0,
“clouds”: 0,
“visibility”: 10000,
“wind_speed”: 5.66,
“wind_deg”: 210,
“wind_gust”: 8.23,
“weather”: [
{
“id”: 800,
“main”: “Clear”,
“description”: “clear sky”,
“icon”: “01d”
}
etc …
For general curiosity. Is there a way to see what commands Mycodo is sending for the API call or everything else through the command line like a log tail? Not that I’m going to figure out anything but the would be interesting to see.