It is currently May 9th, 2024, 12:50 am

Custom weather plugin

Share and get help with Plugins and Addons
User avatar
balala
Rainmeter Sage
Posts: 16206
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Custom weather plugin

Post by balala »

cperryoh wrote: October 23rd, 2023, 2:27 pm Wow. I just logged back into this account after forever, I didn't know this post got some attention. Sorry for being a bit absent,
It's extremely easy to get a notification when anyone posts a reply. You have to check the Notify my when a reply is posted checkbox below the field in which are you writing your reply / post:

Notify.png

If you do this, you'll get an email every time another user posts in this topic.
cperryoh wrote: October 23rd, 2023, 2:27 pm Edit 2: i figured out how to compile x32 DLLs, those are up now in the releases section.
Here? Are you sure? I can't find them. As far as I can tell, none of the linked files contains the plugin. Am I missing something?
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7211
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Custom weather plugin

Post by Yincognito »

balala wrote: October 23rd, 2023, 7:09 pmHere? Are you sure? I can't find them. As far as I can tell, none of the linked files contains the plugin. Am I missing something?
They are in the releases section.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16206
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Custom weather plugin

Post by balala »

Yincognito wrote: October 23rd, 2023, 8:18 pm They are in the releases section.
Good point. Sorry, I missed it, as I thought...
Thanks for the clarification.
ZXCVBOT

Re: Custom weather plugin

Post by ZXCVBOT »

Good thing someone did this :rosegift:. I was going to look for Weather skins next. It makes my job a lot easier as I do not see the accuracy for weather.com in my region - just the temperature (the difference between actual temperature & feels like is beyond imperfect - not everyday, but on most days) - all other details however are proper - It would also be beneficial if someone is unable to get information without using a vpn just for getting weather info or is blocked in someone's country or whatever else reason.
  I just remembered my old school project that included OpenWeatherMap - I'll use that API - if that still works :D  
EDIT:
I was not able to resist, I tried, but kept getting: Plugin: Unable to load "WeatherApiPlugin.dll" (error 126) (Enhancements\Weather\Weather.ini - [weatherApi]).

I just copy-pasted the first code in this thread, downloaded both instances of the .dlls, pasted them properly and am using a working API (checked it out right now and used my old code that worked properly - not Rainmeter code.) Rainmeter\Skins\@Vault\Plugins\WeatherAPIPlugin\WeatherPlugin_x64.dll.

Where am I going wrong?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5408
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Custom weather plugin

Post by eclectic-tech »

ZXCVBOT wrote: October 24th, 2023, 10:40 am {snip}
Where am I going wrong?
Installing to your @Vault is a good idea, but for Rainmeter to use the new plugin, the correct bit file needs to be copied into the 'Plugins' folder in the Rainmeter installation folder; 'Rainmeter/Plugins'. Then do a Refresh All or restart Rainmeter.
ZXCVBOT

Re: Custom weather plugin

Post by ZXCVBOT »

Thanks for the reply, I also pasted the correct file in the Rainmeter/Plugins directory - I did what you told earlier and after this, still the same error persists.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5408
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Custom weather plugin

Post by eclectic-tech »

ZXCVBOT wrote: October 24th, 2023, 11:55 am Thanks for the reply, I also pasted the correct file in the Rainmeter/Plugins directory - I did what you told earlier and after this, still the same error persists.
Try re-starting your PC... :???: That places the file in the correct location, beyond that I have no idea, since I do not use this plugin :confused:
ZXCVBOT

Re: Custom weather plugin

Post by ZXCVBOT »

Maybe I should wait for the dev of the skin to show how he/she managed to do it, as he/she would not be going to post it without testing themselves.
I did all that and re-installed Rainmeter (I tested it on Portable one earlier :Whistle) - tried it all again - NOTHING.

EDIT 1: For easy testing: (EDIT 2: Forgot the </>)

Code: Select all

[Variables]
Font=Segoe UI
FontColor=255,255,255,255
FontSize=15
API=
Longitude=
Latitude=

[MeasureWeather]
Measure=Plugin
Plugin=WeatherPlugin_x64.dll
Key=#API#
Longitude=#Longitude#
Latitude=#Latitude#

[MeterTemperature]
Meter=String
X=2
Y=2
FontFace=#FONTNAME#
FontColor=#FONTCOLOR#
FontSize=#FONTSIZE#
StringAlign=(CenterCenter)r
DynamicVaribles=1
AntiAlias=1
Text=[MeasureWeather] [MeasureWeather:GetValue(Temp)]
#Other options: temp_min, temp_max, humidity, condition, description, icon, iconUrl

[MeterContainer]
Meter=Shape
Shape=Rectangle 3,3,175,30,4 | Fill Color 215,18,18,100 | StrokeWidth 3
Edit 3/4:
Heavily edited the original code.
Tried this: Text=[MeasureWeather] [MeasureWeather:GetValue(Temp)]

Reason: [MeasureWeather:GetValue(Temp)] always returns 0, whereas MeasureWeather returns the actual temperature.

Also, is there any way to change the ℃ ℉ and how to use other options that you have included?
Last edited by ZXCVBOT on October 24th, 2023, 1:56 pm, edited 2 times in total.
User avatar
balala
Rainmeter Sage
Posts: 16206
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Custom weather plugin

Post by balala »

eclectic-tech wrote: October 24th, 2023, 11:51 am Installing to your @Vault is a good idea, but for Rainmeter to use the new plugin, the correct bit file needs to be copied into the 'Plugins' folder in the Rainmeter installation folder; 'Rainmeter/Plugins'. Then do a Refresh All or restart Rainmeter.
The @Vault folder is used for a kind of backup. When installing a skin containing a plugin, a copy of both versions of the plugin (the x86 and the x64 versions) are placed into this @Vault folder, in order to have a backup of them. If anytime later the user who installed it wants to create a skin installer, he needs both versions of the plugin. They can be taken from this folder.
Rainmeter is not using those plugins from the @Vault folder. It doesn't care what is stored into this folder, doesn't follow which plugins are there. As said, the plugins are placed there only for "backup" reasons.
ZXCVBOT wrote: October 24th, 2023, 11:55 am Thanks for the reply, I also pasted the correct file in the Rainmeter/Plugins directory - I did what you told earlier and after this, still the same error persists.
Rainmeter stores the plugins into two different folders:
  • The built-in plugins (like ActionTimer, InputText or Win7Audio, but these are just examples, there are much more) are stored in the C:\Program Files\Rainmeter\Plugins folder. The plugins installed by skins have not to be placed here.
  • The not built-in plugins, which are installed when installing a skin using a not-built-in plugin, are located into the C:\Users\<YourName>\AppData\Roaming\Rainmeter\Plugins folder. Here you have to place a plugin, if you want to copy it manually (not sure this is a good idea, but can be done).
So, you have to copy the appropriate version of the plugin (either the x86, or the x64 version, depending on your system) into the C:\Users\<YourName>\AppData\Roaming\Rainmeter\Plugins folder. If you manually copy the plugin, it's your duty to make sure to copy the appropriate version (when installing it, Rainmeter knows which version of the plugin to copy).
To make sure where to copy the plugin, use the #SETTINGSPATH#Plugins\ variable / expression. This expression is returning the folder where you have to copy the plugin. Use for instance the following meter (you can add this to any existing skin or creat a new skin for this purpose):

Code: Select all

[MeterPlugin]
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=12
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=#SETTINGSPATH#Plugins\
DynamicVariables=1
LeftMouseUpAction=["#SETTINGSPATH#Plugins\"]
The meter shows the path of your plugin folders which stores the not-built in plugins. If you click the above meter, the folder opens and you can copy the plugin there. If you copy the proper version of it, it definitely should work.
User avatar
Yincognito
Rainmeter Sage
Posts: 7211
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Custom weather plugin

Post by Yincognito »

ZXCVBOT wrote: October 24th, 2023, 10:40 am Good thing someone did this :rosegift:. I was going to look for Weather skins next. It makes my job a lot easier as I do not see the accuracy for weather.com in my region - just the temperature (the difference between actual temperature & feels like is beyond imperfect - not everyday, but on most days) - all other details however are proper - It would also be beneficial if someone is unable to get information without using a vpn just for getting weather info or is blocked in someone's country or whatever else reason.
  I just remembered my old school project that included OpenWeatherMap - I'll use that API - if that still works :D  
EDIT:
I was not able to resist, I tried, but kept getting: Plugin: Unable to load "WeatherApiPlugin.dll" (error 126) (Enhancements\Weather\Weather.ini - [weatherApi]).

I just copy-pasted the first code in this thread, downloaded both instances of the .dlls, pasted them properly and am using a working API (checked it out right now and used my old code that worked properly - not Rainmeter code.) Rainmeter\Skins\@Vault\Plugins\WeatherAPIPlugin\WeatherPlugin_x64.dll.

Where am I going wrong?
Eclectic-tech and balala are correct, the files must be in the correct location AND be properly named (just look at how other plugins are most likely named just as their root folder, irrespective of bit architecture) in order to work. Unfortunately, me personally can't test this since I don't have such an API key, so I wouldn't be able to help more than this. Bottom line, if the plugin files are written properly, placed properly and named properly, they should work, assuming the key or whatever is also correct.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth