It is currently January 22nd, 2022, 5:50 am

Weather Skins Not Working

Help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 4132
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working

Post by Yincognito »

sesco wrote: January 11th, 2022, 5:53 am It works! Thank you soo much, I appreciate it :D :D
:great:
freakycat
Posts: 1
Joined: January 11th, 2022, 12:49 pm

Re: Weather Skins Not Working

Post by freakycat »

I have this Webparser but unfortunately i don't get it where i should put these line characters and seriously i am no programmer who gets it as easy like a baby his milk...
so my humble request is for all who use JDWS-03 is to get some help here

Code: Select all

[Variables]
WeatherUnitsMetric=m
WeatherUnitsImperial=e

TimeFormat24HTime0=%#I:%M %p
TimeFormat24HTime1=%H:%M

Substitute="^null$":"", '^"(.*)"$':"\1", "^\\1$":""
SubstituteIcons="^0$":"jdwi-storm", "^1$":"jdwi-storm", "^2$":"jdwi-storm", "^3$":"jdwi-storm", "^4$":"jdwi-storm", "^5$":"jdwi-sleet", "^6$":"jdwi-sleet", "^7$":"jdwi-sleet", "^8$":"jdwi-sleet", "^9$":"jdwi-rain", "^10$":"jdwi-sleet", "^11$":"jdwi-rain", "^12$":"jdwi-rain", "^13$":"jdwi-snow", "^14$":"jdwi-snow", "^15$":"jdwi-snow", "^16$":"jdwi-snow", "^17$":"jdwi-sleet", "^18$":"jdwi-sleet", "^19$":"jdwi-fog", "^20$":"jdwi-fog", "^21$":"jdwi-fog", "^22$":"jdwi-fog", "^23$":"jdwi-windy", "^24$":"jdwi-windy", "^25$":"jdwi-snow", "^26$":"jdwi-cloudy", "^27$":"jdwi-cloudy-night", "^28$":"jdwi-cloudy-day", "^29$":"jdwi-cloudy-night", "^30$":"jdwi-cloudy-day", "^31$":"jdwi-clear-night", "^32$":"jdwi-clear-day", "^33$":"jdwi-partly-cloudy-night", "^34$":"jdwi-partly-cloudy-day", "^35$":"jdwi-sleet", "^36$":"jdwi-clear-day", "^37$":"jdwi-storm-day", "^38$":"jdwi-storm-day", "^39$":"jdwi-rain", "^40$":"jdwi-rain", "^41$":"jdwi-snow-day", "^42$":"jdwi-snow", "^43$":"jdwi-snow", "^44$":"jdwi-unknown", "^45$":"jdwi-rain-night", "^46$":"jdwi-snow-night", "^47$":"jdwi-storm-night", "^na$":"", "":"jdwi-unknown"

; ================================================

[mUnitsTemperature]
Measure=String

String=[#WeatherUnits[#WeatherUnits]]

RegExpSubstitute=1
Substitute="^m$":"C", "^e$":"F"

[mUnitsSpeed]
Measure=String

String=[#WeatherUnits[#WeatherUnits]]

RegExpSubstitute=1
Substitute="^m$":"km/h", "^e$":"mi/h"

[mUnitsDistance]
Measure=String

String=[#WeatherUnits[#WeatherUnits]]

RegExpSubstitute=1
Substitute="^m$":"km", "^e$":"mi"

[mUnitsPressure]
Measure=String

String=[#WeatherUnits[#WeatherUnits]]

RegExpSubstitute=1
Substitute="^m$":"mb", "^e$":"in"

; ================================================

[mLocationParent]
Measure=WebParser
;URL=https://api.openweathermap.org/data/2.5/weather?lat=50.118&lon=9.131&mode=xml&units=metric&lang=[#Language]&appid=2f9859fae28e01f4996d7d51de604b1d
URL=https://nominatim.openstreetmap.org/search?q=#WeatherLocation#&format=geocodejson&limit=1&addressdetails=1&accept-language=#Language#
RegExp=(?siU)"features":\[{"type":"Feature","properties":{"geocoding":{.*,"label":"(.*)",.*,"admin":{.*?"level\d+":"(.*)"}}},"geometry":{"type":"Point","coordinates":\[(.*),(.*)\]}}\]
;RegExp=(?siU)[#p1].*[#p2]
UpdateRate=-1
;UpdateRate=900

FinishAction=[!UpdateMeasureGroup Location] [!EnableMeasureGroup Parent] [!UpdateMeasureGroup Parent] [!Log "Location found: [mLocation]" Notice]
OnConnectErrorAction=[!Log "Unable to connect to Nominatim." Error]
OnRegExpErrorAction=[!Log "No results found for that location." Error]

[mLocation]
Group=Location
Measure=WebParser

URL=[mLocationParent]
StringIndex=1

[mLocationCity]
Group=Location
Measure=WebParser

URL=[mLocationParent]
StringIndex=2

Substitute="":"Earth"

[mLocationLat]
Group=Location
Measure=WebParser

URL=[mLocationParent]
StringIndex=4

[mLocationLon]
Group=Location
Measure=WebParser

URL=[mLocationParent]
StringIndex=3

; ================================================

[mCurrentParent]
Group=Parent
Measure=WebParser

URL=https://api.weather.com/v3/wx/observations/current?geocode=[&mLocationLat],[&mLocationLon]&units=[#WeatherUnits[#WeatherUnits]]&language=#Language#&format=json&apiKey=d522aa97197fd864d36b418f39ebb323
RegExp=(?siU){"cloudCeiling":.*,"cloudCoverPhrase":.*,"dayOfWeek":.*,"dayOrNight":.*,"expirationTimeUtc":.*,"iconCode":(.*),"iconCodeExtend":.*,"obsQualifierCode":.*,"obsQualifierSeverity":.*,"precip1Hour":.*,"precip6Hour":.*,"precip24Hour":.*,"pressureAltimeter":(.*),"pressureChange":.*,"pressureMeanSeaLevel":.*,"pressureTendencyCode":.*,"pressureTendencyTrend":.*,"relativeHumidity":(.*),"snow1Hour":.*,"snow6Hour":.*,"snow24Hour":.*,"sunriseTimeLocal":.*,"sunriseTimeUtc":.*,"sunsetTimeLocal":.*,"sunsetTimeUtc":.*,"temperature":(.*),"temperatureChange24Hour":.*,"temperatureDewPoint":.*,"temperatureFeelsLike":.*,"temperatureHeatIndex":.*,"temperatureMax24Hour":.*,"temperatureMaxSince7Am":.*,"temperatureMin24Hour":.*,"temperatureWindChill":.*,"uvDescription":(.*),"uvIndex":(.*),"validTimeLocal":.*,"validTimeUtc":.*,"visibility":(.*),"windDirection":(.*),"windDirectionCardinal":(.*),"windGust":.*,"windSpeed":(.*),"wxPhraseLong":(.*),"wxPhraseMedium":.*,"wxPhraseShort":.*}
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36
UpdateRate=(60*15)

FinishAction=[!EnableMeasureGroup Current] [!UpdateMeasureGroup Current] [!UpdateMeter *] [!UpdateMeter *] [!Redraw] [!Log "Finished parsing current weather data." Notice]
OnConnectErrorAction=[!Log "Unable to connect to Weather.com." Error]
OnRegExpErrorAction=[!Log "Something went wrong." Error]

Disabled=1
DynamicVariables=1

; ================================================

[mCurrentIcon]
Group=Current
Measure=WebParser

URL=[mCurrentParent]
StringIndex=1

RegExpSubstitute=1
Substitute="#Substitute#", "#SubstituteIcons#"

[mCurrentPressure]
Group=Current
Measure=WebParser

URL=[mCurrentParent]
StringIndex=2

RegExpSubstitute=1
Substitute="#Substitute#", "":"--"

[mCurrentHumidity]
Group=Current
Measure=WebParser

URL=[mCurrentParent]
StringIndex=3

RegExpSubstitute=1
Substitute="#Substitute#", "(.+)":"\1%", "":"--"

[mCurrentTemperature]
Group=Current
Measure=WebParser

URL=[mCurrentParent]
StringIndex=4

RegExpSubstitute=1
Substitute="#Substitute#", "(.+)":"\1°", "":"--"

[mCurrentUVDescription]
Group=Current
Measure=WebParser

URL=[mCurrentParent]
StringIndex=5

RegExpSubstitute=1
Substitute="#Substitute#", "":"--"

[mCurrentUVIndex]
Group=Current
Measure=WebParser

URL=[mCurrentParent]
StringIndex=6

RegExpSubstitute=1
Substitute="#Substitute#", "":"--"

[mCurrentVisibility]
Group=Current
Measure=WebParser

URL=[mCurrentParent]
StringIndex=7

RegExpSubstitute=1
Substitute="#Substitute#", "":"--"

[mCurrentWindDirection]
Group=Current
Measure=WebParser

URL=[mCurrentParent]
StringIndex=8

RegExpSubstitute=1
Substitute="#Substitute#", "":"0"

[mCurrentWindDirectionIcon]
Group=Current
Measure=Calc

Formula=(Round([mCurrentWindDirection]/15)*15)%360

Disabled=1
UpdateDivider=-1
DynamicVariables=1

RegExpSubstitute=1
Substitute="(.*)":"jdwi-wind-from-\1"

[mCurrentWindDirectionCardinal]
Group=Current
Measure=WebParser

URL=[mCurrentParent]
StringIndex=9

RegExpSubstitute=1
Substitute="#Substitute#", "":"--"

[mCurrentWindSpeed]
Group=Current
Measure=WebParser

URL=[mCurrentParent]
StringIndex=10

RegExpSubstitute=1
Substitute="#Substitute#", "":"--"

[mCurrentPhrase]
Group=Current
Measure=WebParser

URL=[mCurrentParent]
StringIndex=11

RegExpSubstitute=1
Substitute="#Substitute#", "":"N/A"
User avatar
SilverAzide
Rainmeter Sage
Posts: 1739
Joined: March 23rd, 2015, 5:26 pm

Re: Weather Skins Not Working

Post by SilverAzide »

freakycat wrote: January 11th, 2022, 12:57 pm I have this Webparser but unfortunately i don't get it where i should put these line characters and seriously i am no programmer who gets it as easy like a baby his milk...
so my humble request is for all who use JDWS-03 is to get some help here
Unfortunately, that skin does not appear to use the "standard" weather.com template code (as found here). You might want to post a note to the author to let them know the skin is broken.

If you want to fix it yourself, in the code you posted above, find the following section:

Code: Select all

[mCurrentParent]
Group=Parent
Measure=WebParser
URL=https://api.weather.com/v3/wx/observations/current?geocode=[&mLocationLat],[&mLocationLon]&units=#WeatherUnits[#WeatherUnits]]&language=#Language#&format=json&apiKey=d522aa97197fd864d36b418f39ebb323
See that stuff at the end, apiKey=d522aa97197fd864d36b418f39ebb323? Change it to apiKey=21d8a80b3d6b444998a80b3d6b1449d3. Save the file and refresh the skin.
Gadgets Wiki GitHub More Gadgets...
User avatar
eXAKR
Posts: 30
Joined: January 11th, 2012, 12:22 pm

Re: Weather Skins Not Working

Post by eXAKR »

jsmorley wrote: January 10th, 2022, 8:48 pm I think you will find that if you change the API Key to 21d8a80b3d6b444998a80b3d6b1449d3, it will begin to work again.
Noticed that my moon phase widget skin, TenLuna, wasn't working anymore, and wondered if Weather.com changed or broke their data feed again. Came in here looking for a potential solution and found your post above there with the new API key, which I fed into my skin's code, and everything's working fine again. Released an emergency update on my deviantART for this; if anyone prefers to manually fix this issue instead, go to the Rainmeter skin's folder, then navigate to TenLuna\@Resources\ > open LunaSource.inc > under the Variables section, change the APIKey variable to the one in the above post.
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Weather Skins Not Working

Post by JamX »

SilverAzide wrote: January 11th, 2022, 1:22 pm See that stuff at the end, apiKey=d522aa97197fd864d36b418f39ebb323? Change it to apiKey=21d8a80b3d6b444998a80b3d6b1449d3. Save the file and refresh the skin.
Many Thanks for the solution :thumbup: :bow:
User avatar
Active Colors
Moderator
Posts: 952
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: Weather Skins Not Working

Post by Active Colors »

Yincognito wrote: January 10th, 2022, 11:22 pm A little skin that changes the key for you on left click:

Code: Select all

[Variables]
APIKeyLabel=SUN_V3_API_KEY_CLIENT
SkinName=Weather.com

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255

---Measures---

[APIKeyValue]
Measure=WebParser
URL=https://weather.com
RegExp=(?siU)"#APIKeyLabel#":"(.*)"
StringIndex=1
UpdateRate=-1

---Meters---

[APIKey]
Meter=String
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=APIKeyValue
Text="API Key: %1"
LeftMouseUpAction=[!WriteKeyValue Variables APIKey "[APIKeyValue]" "#SKINSPATH##SkinName#\@Resources\WeatherComJSONVariables.inc"]
DynamicVariables=1
Somehow this throws me the "(Fetch error) An error occurred in the secure channel support (ErrorCode=12157) (#Test\Atest.ini - [APIKeyValue])". I tried using my browser's UserAgent but no luck.
The weather skins that parse weather.com are working normally.
Any idea what can be wrong?
JLO
Posts: 2
Joined: October 7th, 2021, 7:14 pm

Re: Weather Skins Not Working

Post by JLO »

In Sonders\weather, the key is in the "Styles-weather.inc" location and updated the key will resolve the issue.
The key is also written in the "WeatherComJSONVariables.inc" file but updating the key here did -not- resolve it.
seanx
Posts: 17
Joined: May 16th, 2021, 10:47 am

Re: Weather Skins Not Working

Post by seanx »

I changed APIKey in SONDER and in SketchyWeather, but the weather still doesn't show up in either of them. Something else needs to be changed or set up. Well thank you
User avatar
balala
Rainmeter Sage
Posts: 13719
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather Skins Not Working

Post by balala »

seanx wrote: January 12th, 2022, 8:13 pm I changed APIKey in SONDER and in SketchyWeather, but the weather still doesn't show up in either of them. Something else needs to be changed or set up. Well thank you
Have you refreshed the skin(s)? Because nothing else has to be changed.
User avatar
Yincognito
Rainmeter Sage
Posts: 4132
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working

Post by Yincognito »

Active Colors wrote: January 12th, 2022, 10:21 am Somehow this throws me the "(Fetch error) An error occurred in the secure channel support (ErrorCode=12157) (#Test\Atest.ini - [APIKeyValue])". I tried using my browser's UserAgent but no luck.
The weather skins that parse weather.com are working normally.
Any idea what can be wrong?
This doesn't happen on my side, everything works perfectly:
WeatherAPIKey.jpg
Unfortunately, I can't figure out what is wrong on your side, since I can't experience your error in the first place. I thought about having UserAgent options and whatnot in the measure, but I found out a super simple WebParser measure worked anyway, at least in my case. I have no idea what could be wrong in your setup - it should work without issues. :???:

P.S. The way the error is phrased seems to indicate that maybe the https protocol is somehow involved? Just speculating, but I don't have enough data to state this as a fact, obviously.
EDIT: You said that that skins parsing weather.com work normally. Maybe using the options the WebParser measures in those skins use could solve the issue? If those are indeed parsing the weather.com webpage and not the JSON, that is (not sure if there's a difference between the two when it comes to the web request though)...

EDIT2: Anyway, keep me posted if you discover what the issue is, because I might implement a weather.com "APIKey detection" system in my skins' Settings area based on this little skin, on their next update.
You do not have the required permissions to view the files attached to this post.