<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://kodi.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Roman+VM</id>
	<title>Official Kodi Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://kodi.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Roman+VM"/>
	<link rel="alternate" type="text/html" href="https://kodi.wiki/view/Special:Contributions/Roman_VM"/>
	<updated>2026-06-17T10:28:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on_rules&amp;diff=263659</id>
		<title>Add-on rules</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on_rules&amp;diff=263659"/>
		<updated>2026-05-31T12:22:51Z</updated>

		<summary type="html">&lt;p&gt;Roman VM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]}}&lt;br /&gt;
&lt;br /&gt;
== Repository Submission Guidelines - Please Read Before Submitting Your Addon ==&lt;br /&gt;
&lt;br /&gt;
Inclusion in the Kodi.org repository is at the sole discretion of Team Kodi. Because maintaining such a large repository is a large task, we have set some guidelines for inclusion. Please ensure that these guidelines are met before submitting request to be added. In order to be considered for the official repository, the following guidelines must be met:&lt;br /&gt;
&lt;br /&gt;
* All add-ons must be developed as described on the [https://kodi.wiki/view/Add-on_development Add-on development] page.&lt;br /&gt;
* All add-ons must be compatible with Python 3. Contributions requiring Python 2 are no longer accepted. For more details see: [https://kodi.tv/article/the-sun-sets-on-python-2/ The Sun Sets on Python 2]&lt;br /&gt;
* You &#039;&#039;&#039;must&#039;&#039;&#039; include a license file (named &amp;lt;code&amp;gt;LICENSE.txt&amp;lt;/code&amp;gt;). We recommend the [http://creativecommons.org/choose/non-web-popup?license_code=by-sa&amp;amp;jurisdiction=&amp;amp;version=3.0&amp;amp;lang=en CC-BY-SA 3.0] for skins and the [http://www.gnu.org/licenses/gpl-howto.html GPL v2+] for others, but most copy left licenses will suffice. Proprietary licenses will not be allowed. Please investigate which license suits your needs and you fully understand the contents.&lt;br /&gt;
* All files must be free and legal to distribute.&lt;br /&gt;
* The add-on must not violate any known copyright laws - if in doubt, let us know and we&#039;ll look into it for you.&lt;br /&gt;
* All source files must be included. No pre-compiled or obfuscated files will be allowed. The only exception may be granted for minified JS/CSS files of web interface addons.&lt;br /&gt;
* You acknowledge that you are the maintainer of your add-on.&lt;br /&gt;
* Team-Kodi reserves the right to update or remove it at any time as we deem necessary.&lt;br /&gt;
* If a new stable Kodi is going to be released no new submissions are accepted to the repository for the previous version. This will start from when the first [http://en.wikipedia.org/wiki/Release_candidate#Release_candidate release candidate (RC)] of the new version is released. Only fixes and updates will be accepted and processed for the previous version (e.g. if the current stable is 13.x, no updates are allowed for 11.x any more). See: [https://kodi.wiki/view/Submitting_Add-ons#Allowed_submissions Allowed submissions]&lt;br /&gt;
* Monetization of add-ons (for instance advertising or paid subscriptions) will not be allowed. We can make an exception in case you own the copyright for the content the add-on provides. Please contact us on the forum if you believe such an exception may apply to your add-on.&lt;br /&gt;
* All &amp;lt;code&amp;gt;xbmc.python.module&amp;lt;/code&amp;gt; addons must be used by at least one other add-on in official repository.&lt;br /&gt;
&lt;br /&gt;
== Updates ==&lt;br /&gt;
&lt;br /&gt;
Keep in mind that add-ons in the official repository should be considered &#039;&#039;&#039;stable&#039;&#039;&#039;. This means that they should be well-tested before you submit them for inclusion. Because they are for stable users, they should avoid being updated too often. Too often is of course subjective. If your add-on is in rapid development, and features are constantly being added, hold off until you have hit a good stopping point and &#039;&#039;&#039;tested&#039;&#039;&#039; the current version.&lt;br /&gt;
&lt;br /&gt;
This means that you should &#039;&#039;&#039;not&#039;&#039;&#039; submit a request every time you change your code. If you are submitting updates more than once per week something is wrong. Once or twice per month is probably a better goal, barring unforeseen conditions (like a content source changing its paths). With good reasons provided we will of course make exceptions as we strive to provide the best user experience.&lt;br /&gt;
&lt;br /&gt;
== General requirements ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a list of what basic sanity checks are done by repository maintainer on each submission.&lt;br /&gt;
&lt;br /&gt;
=== Basic file checks ===&lt;br /&gt;
&lt;br /&gt;
* all strings used by add-ons must be localized, no hard-coded language strings should ever be used&lt;br /&gt;
* all paths should be treated as case-sensitive, so that they work on all OSs and file systems.&lt;br /&gt;
* all paths and files should be lower-case due to the previous point&lt;br /&gt;
** exceptions are README, COPYING, &amp;lt;code&amp;gt;LICENSE.txt&amp;lt;/code&amp;gt; that should be upper-case and the &amp;quot;Default&amp;quot; directory in &amp;lt;code&amp;gt;resources/skins&amp;lt;/code&amp;gt;, for add-ons that need it.&lt;br /&gt;
* the following file-types are not allowed: &amp;lt;code&amp;gt;.so .dll .pyo .exe .xbt .xpr Thumbs.db&amp;lt;/code&amp;gt; and so on (any binary files)&lt;br /&gt;
* all text files should use UNIX end-of-line&lt;br /&gt;
* all &amp;lt;code&amp;gt;.xml&amp;lt;/code&amp;gt; files must pass xml validation&lt;br /&gt;
* all &amp;lt;code&amp;gt;.xml&amp;lt;/code&amp;gt; files must have xml declaration as header&lt;br /&gt;
* all &amp;lt;code&amp;gt;.xml/.txt&amp;lt;/code&amp;gt; must have unix style EOL&#039;s&lt;br /&gt;
* don&#039;t use a BOM at the start of your files&lt;br /&gt;
* file permissions: files should not be marked as executable&lt;br /&gt;
* filenames must have correct encoding (for skins: check your studio logos for corrupt filenames)&lt;br /&gt;
* use 4-letter &#039;&#039;&#039;lc_CC&#039;&#039;&#039; language codes for localized addon metadata in &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;addon.xml&amp;lt;/code&amp;gt; must have at least &#039;&#039;&#039;en_GB&#039;&#039;&#039; metadata.&lt;br /&gt;
&lt;br /&gt;
=== Things that must be included ===&lt;br /&gt;
&lt;br /&gt;
* [https://kodi.wiki/view/Add-on_structure#addon.xml addon.xml] must contain correct and valid info / version&lt;br /&gt;
* [https://kodi.wiki/view/Add-on_structure#icon.png icon.png] must be present (256x256) or (512x512) with solid colors (no transparency)&lt;br /&gt;
* [https://kodi.wiki/view/Add-on_structure#fanart.jpg fanart.jpg] must be present (1280x720 or 1920x1080 or 3840x2160)&lt;br /&gt;
* [https://kodi.wiki/view/Add-on_structure#LICENSE.txt LICENSE.txt] must be present&lt;br /&gt;
&lt;br /&gt;
See also: [https://kodi.wiki/view/Add-on_structure &#039;&#039;&#039;Add-on structure&#039;&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
=== Things that can&#039;t be included ===&lt;br /&gt;
&lt;br /&gt;
* no &amp;lt;code&amp;gt;.xbt&amp;lt;/code&amp;gt; files (these will be generated by our repository)&lt;br /&gt;
* no other add-ons included (skinners: if you need a script, submit it separately and depend on it)&lt;br /&gt;
* don&#039;t include unneeded files (&amp;lt;code&amp;gt;.pdf&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.doc&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thumbs.db&amp;lt;/code&amp;gt;, etc...)&lt;br /&gt;
* no licensed fonts / background images / anything&lt;br /&gt;
* binary/compiled/obfuscated files (with possible exception for minified JS/CSS files)&lt;br /&gt;
&lt;br /&gt;
== Requirements for skins ==&lt;br /&gt;
&lt;br /&gt;
=== Basic checks ===&lt;br /&gt;
&lt;br /&gt;
* The file size must be sane. There is no hard limit, but a 100mb skin is pushing it.&lt;br /&gt;
* No mods. Mods are great, and pop up frequently in the forums. But we would rather not have several versions of the same skin in our repo. But if your mod is substantial different enough from the original (and by giving it a different name), we will of course take it in consideration. Also if the original skin is no longer available through our repo, we would have no problem replacing it with a mod.&lt;br /&gt;
* In order to compile your images with TexturePacker, all graphics files should have a resolution of at least 4x4.&lt;br /&gt;
* themes must be in a subfolder of the &amp;lt;code&amp;gt;themes/&amp;lt;/code&amp;gt; folder in the skin root (eg. &amp;lt;code&amp;gt;skin.foo/themes/blue/&amp;lt;/code&amp;gt;). The &amp;lt;code&amp;gt;.xbt&amp;lt;/code&amp;gt; file will be created by our repo backend.&lt;br /&gt;
* If you want to have some images outside of &amp;lt;code&amp;gt;Textures.xbt&amp;lt;/code&amp;gt;, then make sure you place those images outside of the &amp;lt;code&amp;gt;media/&amp;lt;/code&amp;gt; folder and reference them using &amp;lt;code&amp;gt;special://skin/backdrops/&amp;lt;/code&amp;gt; or similar. This is most useful for backgrounds - it keeps the size of the packed textures down. Any images you have in the &amp;lt;code&amp;gt;media/&amp;lt;/code&amp;gt; folder will be placed in &amp;lt;code&amp;gt;Textures.xbt&amp;lt;/code&amp;gt; in the official repository.&lt;br /&gt;
* Please be careful with addon dependencies. Only add dependencies that are needed for the skin to function properly.&lt;br /&gt;
&lt;br /&gt;
=== Code checks ===&lt;br /&gt;
&lt;br /&gt;
* all labels must be localized&lt;br /&gt;
* code should be case-sensitive&lt;br /&gt;
* skins should not create warning/errors in the logfile, this can be a lot of things:&lt;br /&gt;
** invalid includes&lt;br /&gt;
** undefined actions&lt;br /&gt;
** unable to evaluate condition&lt;br /&gt;
** undefined vars&lt;br /&gt;
** can&#039;t focus &#039;id&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This of course also applies to script add-ons that use skin files&lt;br /&gt;
&lt;br /&gt;
==== Optional support ====&lt;br /&gt;
&lt;br /&gt;
This is optional and should not block inclusion in official repo.&lt;br /&gt;
&lt;br /&gt;
* Mouse support&lt;br /&gt;
* Touchscreen support&lt;br /&gt;
* Peripheral dialogs&lt;br /&gt;
* PVR support&lt;br /&gt;
* ADSP support&lt;br /&gt;
* RDS support&lt;br /&gt;
* Game support&lt;br /&gt;
&lt;br /&gt;
== Requirements for all python addons ==&lt;br /&gt;
&lt;br /&gt;
We do not enforce any specific code style rules or coding practices. It&#039;s the developer&#039;s responsibility to ensure proper functioning of their addons.&lt;br /&gt;
&lt;br /&gt;
General requirements:&lt;br /&gt;
&lt;br /&gt;
* all &amp;lt;code&amp;gt;special://&amp;lt;/code&amp;gt; paths should be translated using &amp;lt;code&amp;gt;xbmc.translatePath(&amp;quot;special://foo/bar&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;xbmc.translatePath(xbmcaddon.Addon().getAddonInfo(&#039;path&#039;))&amp;lt;/code&amp;gt; should be used for files included with the add-on&lt;br /&gt;
* &amp;lt;code&amp;gt;xbmc.translatePath(xbmcaddon.Addon().getAddonInfo(&#039;profile&#039;))&amp;lt;/code&amp;gt; should be used for storing add-on related files&lt;br /&gt;
* direct access to the Kodi database is &#039;&#039;&#039;not&#039;&#039;&#039; allowed. You must use [https://kodi.wiki/view/JSON-RPC_API JSON RPC] for this.&lt;br /&gt;
* directly using any kind of analytics (Google Analytics for example) from within add-ons is not allowed. This should be handled server side by using user-agent.&lt;br /&gt;
* addons should use the &amp;lt;code&amp;gt;xbmc.log()&amp;lt;/code&amp;gt; method to write to the logfile and use the debug logging level only. &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; functions should not be used.&lt;br /&gt;
* Plugins should &#039;&#039;&#039;not&#039;&#039;&#039; force certain skin viewtypes on their own by calling &amp;lt;code&amp;gt;Container.SetViewMode(id)&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Container.SetSortMethod(id)&amp;lt;/code&amp;gt; built-in functions. They should set the correct media content from which the correct skin view type is automatically provided.&lt;br /&gt;
* add-ons should store all their data in their own profile subfolder inside the &amp;lt;code&amp;gt;addon_data&amp;lt;/code&amp;gt; folder (accessed via &amp;lt;code&amp;gt;Addon.getAddonInfo(&#039;profile&#039;)&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;special://profile&amp;lt;/code&amp;gt;). Access (read/write/delete) to any other files or folders is not allowed by default and should require an explicit user confirmation, e.g. via a UI modal dialog or a file selector. Short-lived files may also be stored in the Kodi temp folder &amp;lt;code&amp;gt;special://temp&amp;lt;/code&amp;gt; directory but the addon profile folder is preferable.&lt;br /&gt;
* addons must not install other addons or modify their files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exceptions to this rule may be granted in specific cases only. Please contact Team XBMC&#039;s add-on repository maintainers on github if your add-on needs access to such files.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In case we grant such an exception for your addon, access (read/write/delete) to other files/directories must be opt-in by the user, and be clear for the user to understand what is being accessed.&lt;br /&gt;
&lt;br /&gt;
== Specific requirements for scrapers ==&lt;br /&gt;
&lt;br /&gt;
* scraper must return the following minimum information: movie title, year, plot, cast, poster, fanart&lt;br /&gt;
* Scrapers should store their file cache in &amp;lt;code&amp;gt;special://temp/scrapers/&amp;lt;addon_id&amp;gt;&amp;lt;/code&amp;gt; folder that is monitored by Kodi.&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-on development]]&lt;/div&gt;</summary>
		<author><name>Roman VM</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=HOW-TO:Video_addon&amp;diff=258181</id>
		<title>HOW-TO:Video addon</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=HOW-TO:Video_addon&amp;diff=258181"/>
		<updated>2025-06-21T11:21:28Z</updated>

		<summary type="html">&lt;p&gt;Roman VM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]|[[Python development]]}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
This tutorial will explain how to write your first Kodi/XBMC video plugin Add-on&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
Assuming you have already followed the Hello World Add-on you will have a text editor already setup. Since we are dealing with videos this time its probably a good idea to have a video player setup. We recommend another great open source project for this&lt;br /&gt;
&lt;br /&gt;
- VLC http://www.videolan.org/vlc/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Installing=&lt;br /&gt;
You can find the Add-on source code here:&lt;br /&gt;
&lt;br /&gt;
https://github.com/romanvm/plugin.video.example&lt;br /&gt;
&lt;br /&gt;
You need to download an installable zip from &amp;quot;Releases&amp;quot; section of the repo and install it from the &#039;&#039;&#039;Addons&#039;&#039;&#039; section of kodi GUI &lt;br /&gt;
by clicking a &amp;quot;package&amp;quot; icon in the top left corner and selecting &amp;quot;Instal from ZIP&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that Kodi no longer supports &amp;quot;drop in&amp;quot; installing by copying addon files into &#039;&#039;&#039;addon&#039;&#039;&#039; sub-directory of the Kodi profile directory.&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
You can first give the add-on a test run by going to:&lt;br /&gt;
System &amp;gt;&amp;gt; Add-Ons &amp;gt;&amp;gt; Enabled Add-Ons &amp;gt;&amp;gt; Video Add-Ons &amp;gt;&amp;gt; Example Kodi video Plugin. You should now be able to watch some test videos hosted from an internet web server.&lt;br /&gt;
&lt;br /&gt;
[[File:Plugin-video-example.jpg.jpg]]&lt;br /&gt;
&lt;br /&gt;
=Explanation=&lt;br /&gt;
So whats happening in this add-on?&lt;br /&gt;
&lt;br /&gt;
Basically the Add-on is checking a website for the hosted videos. In this example we are directly linking to the videos, but there are possibilities for dynamic content and scraping of just about any online source&lt;br /&gt;
&lt;br /&gt;
Once the video link is sent to Kodi, our video player takes over and buffers, then plays the video just like any other media.&lt;br /&gt;
&lt;br /&gt;
=Structure=&lt;br /&gt;
main.py &amp;lt;-- This is the actual python code for your Add-On&lt;br /&gt;
&lt;br /&gt;
addon.xml &amp;lt;-- This is the Add-Ons metadata&lt;br /&gt;
&lt;br /&gt;
icon.png &amp;lt;-- A PNG icon for the add-on. It can be 256x256 or 512x512 pixels big. Try to make it look nice!&lt;br /&gt;
&lt;br /&gt;
Readme.md &amp;lt;-- The readme text file with a description of the Add-on and install instructions. This shows on the front of the GitHub page and helps users to understand your Add-on before downloading.&lt;br /&gt;
&lt;br /&gt;
=The Code=&lt;br /&gt;
So now we come to the actual Add-On code, this is where most of your Add-on is written and is a simple text file containing python code.&lt;br /&gt;
&lt;br /&gt;
Since this is a very simple Add-On, all its code are located in https://github.com/romanvm/plugin.video.example/blob/master/main.py file that is the Add-On entry point. &lt;br /&gt;
Read the comments in the file that explain what each part of the code does.&lt;br /&gt;
&lt;br /&gt;
More complex Add-Ons may include additional modules and packages. In this case a good practice is to put only minimal code in your Add-On entrypoint and keep the rest&lt;br /&gt;
of the code in importable modueles.&lt;br /&gt;
&lt;br /&gt;
=Changing the code=&lt;br /&gt;
&lt;br /&gt;
Hopefully by now you have managed to run the Add-On, understand the structure and can see what the code can do. Now lets trying changing it a little!&lt;br /&gt;
&lt;br /&gt;
Since we already have the Add-on installed we can go directly to the Kodi userdata folder and edit the python directly. You can also have Kodi open at this time ready to run the Add-on when required. Just switch between your text editor and Kodi any time.&lt;br /&gt;
&lt;br /&gt;
Note that all the data for video strams are located in movies.json file. This allows to separate media information from the actual Python code.&lt;br /&gt;
&lt;br /&gt;
Try changing some of the links to another jpeg file or hosted online video. Also try to change the genre and see how that effects the view in Kodi.&lt;br /&gt;
&lt;br /&gt;
Click save on your text editor and now try running the Add-On inside Kodi. You should see the new video links and navigation right away.&lt;br /&gt;
&lt;br /&gt;
Congratulations! you&#039;ve just played an online video from your very own Video Add-on&lt;br /&gt;
&lt;br /&gt;
=Streaming Video=&lt;br /&gt;
In addition to this guide, here are some comments from an experienced developer who has worked with streaming video sites:&lt;br /&gt;
&lt;br /&gt;
The docs will help you a lot, way more than any wiki.&lt;br /&gt;
&lt;br /&gt;
https://xbmc.github.io/docs.kodi.tv/master/kodi-base/index.html&lt;br /&gt;
&lt;br /&gt;
Speaking of docs, the ListItem reference will be most useful, time and time again.&lt;br /&gt;
&lt;br /&gt;
https://xbmc.github.io/docs.kodi.tv/master/kodi-base/d8/d29/group__python__xbmcgui__listitem.html&lt;br /&gt;
&lt;br /&gt;
Since you&#039;re relying on a streaming platform you won&#039;t need to do anything particular yourself, you can get away with fetching the data and posting an item with the URL of the video. InputStream.Adaptive configuration might be needed, especially if the videos need DRM.&lt;br /&gt;
&lt;br /&gt;
You can get a lot done with the requests module, depending on the data you&#039;re processing. It&#039;s fully supported in Kodi, cookie and sessions included.&lt;br /&gt;
In short, it&#039;s really simple, you:&lt;br /&gt;
&lt;br /&gt;
- get the information you need off the internet (title/URL could suffice for a start);&lt;br /&gt;
&lt;br /&gt;
- you generate items that Kodi will treat as video sources (see xbmcplugin.addDirectoryItem() and xbmcgui.ListItem());&lt;br /&gt;
&lt;br /&gt;
You could also read the sources of plugins such as AsciiDisco&#039;s Netflix or Sandmann79&#039;s Amazon/AmazonVOD addons.&lt;br /&gt;
&lt;br /&gt;
You can read more in this thread&lt;br /&gt;
https://forum.kodi.tv/showthread.php?tid=348328&lt;br /&gt;
&lt;br /&gt;
=Final Thoughts=&lt;br /&gt;
&lt;br /&gt;
Writing a Video Add-on is actually pretty simple once you get the basic structure correct. You can scrape most online sources with Regex, or host your own videos on the web. You can also play youtube clips or vevo videos using some additional easy to use modules.&lt;br /&gt;
&lt;br /&gt;
If you have any questions about this tutorial, feel free to discuss it on our forums here: http://forum.kodi.tv/showthread.php?tid=248774&lt;br /&gt;
&lt;br /&gt;
=Extra info=&lt;br /&gt;
&lt;br /&gt;
Just a reminder...&lt;br /&gt;
IMPORTANT!!!!!!!   Do not mix tabs and spaces in python&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-on development]]&lt;/div&gt;</summary>
		<author><name>Roman VM</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=File:Plugin-video-example.jpg.jpg&amp;diff=258180</id>
		<title>File:Plugin-video-example.jpg.jpg</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=File:Plugin-video-example.jpg.jpg&amp;diff=258180"/>
		<updated>2025-06-21T11:00:08Z</updated>

		<summary type="html">&lt;p&gt;Roman VM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;plugin-video-example screenshot&lt;/div&gt;</summary>
		<author><name>Roman VM</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Weather_addons&amp;diff=253679</id>
		<title>Weather addons</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Weather_addons&amp;diff=253679"/>
		<updated>2024-10-28T13:31:34Z</updated>

		<summary type="html">&lt;p&gt;Roman VM: /* Weather location configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Main|Weather}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|This page describes the development of Weather addons for Kodi. If you&#039;re interested in them from a user&#039;s perspective (where to get them, how to configure them, etc.), please use the link above.}}&lt;br /&gt;
&lt;br /&gt;
== addon.xml ==&lt;br /&gt;
Weather addons use the &#039;xbmc.python.weather&#039; extension point.&lt;br /&gt;
The basic layout of the addon.xml of a weather addon will look like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; line highlight=&amp;quot;6&amp;quot; style=&amp;quot;white-space: pre-wrap;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;weather.name&amp;quot; name=&amp;quot;My Weather&amp;quot; version=&amp;quot;1.2.3&amp;quot; provider-name=&amp;quot;me&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;requires&amp;gt;&lt;br /&gt;
		&amp;lt;import addon=&amp;quot;xbmc.python&amp;quot; version=&amp;quot;3.0.0&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/requires&amp;gt;&lt;br /&gt;
	&amp;lt;extension point=&amp;quot;xbmc.python.weather&amp;quot; library=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;summary lang=&amp;quot;en_GB&amp;quot;&amp;gt;&amp;lt;/summary&amp;gt;&lt;br /&gt;
		&amp;lt;description lang=&amp;quot;en_GB&amp;quot;&amp;gt;&amp;lt;/description&amp;gt;&lt;br /&gt;
		&amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;platform&amp;gt;&amp;lt;/platform&amp;gt;&lt;br /&gt;
		&amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
		&amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
		&amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
		&amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
		&amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
	&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Things to know ==&lt;br /&gt;
There are a few things (quirks) you need to be aware of when creating a weather addon...&lt;br /&gt;
* A weather addon will be run automatically when the skins asks to display one of these weather-specific infolabels:&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Conditions&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Temperature&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Location&amp;lt;/code&amp;gt;&lt;br /&gt;
* The weather addon will run at 30 minute intervals (as long the current skin window displays one of the above-mentioned infolabels)&lt;br /&gt;
* In the weather window, Kodi will automatically try to translate all the weather strings&lt;br /&gt;
* Kodi will also handle transformations between units (for instance, Celsius to Fahrenheit, km/h to mph)&lt;br /&gt;
&lt;br /&gt;
== Theory of operation ==&lt;br /&gt;
Kodi can run a weather addon in two modes:&lt;br /&gt;
&lt;br /&gt;
=== Weather location configuration ===&lt;br /&gt;
In order to set up a weather addon, you need to include a settings.xml file for your weather addon. It needs to have this structure:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; style=&amp;quot;white-space: pre-wrap;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section id=&amp;quot;weather.name&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;category id=&amp;quot;locations&amp;quot; label=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;group id=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location1&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location1)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location2&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;32003&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location2)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
          &amp;lt;dependencies&amp;gt;&lt;br /&gt;
            &amp;lt;dependency type=&amp;quot;enable&amp;quot; operator=&amp;quot;!is&amp;quot; setting=&amp;quot;location1&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/dependencies&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location3&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;32004&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location3)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
          &amp;lt;dependencies&amp;gt;&lt;br /&gt;
            &amp;lt;dependency type=&amp;quot;enable&amp;quot; operator=&amp;quot;!is&amp;quot; setting=&amp;quot;location2&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/dependencies&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
      &amp;lt;/group&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can define as many weather locations as you want in your settings.xml file. Additional location parameters, like longitude and latitude,&lt;br /&gt;
can be saved as invisible settings.&lt;br /&gt;
&lt;br /&gt;
When you&#039;re going to set up a location in the weather addon settings, Kodi will pass the argument(s) you&#039;ve defined in the RunScript() action above to your addon. For instance, if you set the &#039;Location 2&#039; entry active in the Weather settings, Kodi will pass &#039;Loc2&#039; to your addon.&lt;br /&gt;
&lt;br /&gt;
=== Retrieving weather data ===&lt;br /&gt;
When weather information needs to be retrieved, Kodi will pass the location number to your addon. For instance, if the weather for Location 4 is requested, Kodi will pass &#039;4&#039; to the weather addon.&lt;br /&gt;
&lt;br /&gt;
=== Required output ===&lt;br /&gt;
When a weather addon is asked to retrieve weather information, it needs to return this info to Kodi. This is done by making the various pieces of information available as window properties of the weather window.&lt;br /&gt;
&lt;br /&gt;
The basic python code needed to provide a window property:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
WINDOW = xbmcgui.Window(12600)&lt;br /&gt;
WINDOW.setProperty(name, value)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Kodi expects a weather addon to populate these properties:&lt;br /&gt;
&lt;br /&gt;
=== Current Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Current.Condition|2=&amp;lt;code&amp;gt;Current.Condition&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the weather condition as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Temperature|2=&amp;lt;code&amp;gt;Current.Temperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=temperature in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Wind|2=&amp;lt;code&amp;gt;Current.Wind&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=windspeed in km/h|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.WindDirection|2=&amp;lt;code&amp;gt;Current.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction, NNE|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Humidity|2=&amp;lt;code&amp;gt;Current.Humidity&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=relative humidity as a percentage|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.FeelsLike|2=&amp;lt;code&amp;gt;Current.FeelsLike&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=feels-like temperature in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.UVIndex|2=&amp;lt;code&amp;gt;Current.UVIndex&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the UV-index as an integer|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.DewPoint|2=&amp;lt;code&amp;gt;Current.DewPoint&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=dewpoint in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Precipitation|2=&amp;lt;code&amp;gt;Current.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Cloudiness|2=&amp;lt;code&amp;gt;Current.Cloudiness&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=cloud cover in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.OutlookIcon|2=&amp;lt;code&amp;gt;Current.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon, as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.FanartCode|2=&amp;lt;code&amp;gt;Current.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Kodi will read those window properties and do unit conversions if needed, depending on the regional settings in Kodi.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hourly Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Hourly.%i.Time|2=&amp;lt;code&amp;gt;Hourly.%i.Time&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=hour time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.LongDate|2=&amp;lt;code&amp;gt;Hourly.%i.LongDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=long date and time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.ShortDate|2=&amp;lt;code&amp;gt;Hourly.%i.ShortDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short date and time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Outlook|2=&amp;lt;code&amp;gt;Hourly.%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.OutlookIcon|2=&amp;lt;code&amp;gt;Hourly.%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.FanartCode|2=&amp;lt;code&amp;gt;Hourly.%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.WindSpeed|2=&amp;lt;code&amp;gt;Hourly.%i.WindSpeed&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind speed with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.WindDirection|2=&amp;lt;code&amp;gt;Hourly.%i.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction as a label, e.g. NW|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Humidity|2=&amp;lt;code&amp;gt;Hourly.%i.Humidity&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=humidity in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Temperature|2=&amp;lt;code&amp;gt;Hourly.%i.Temperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.DewPoint|2=&amp;lt;code&amp;gt;Hourly.%i.DewPoint&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=dew point as temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.FeelsLike|2=&amp;lt;code&amp;gt;Hourly.%i.FeelsLike&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=apparent temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Pressure|2=&amp;lt;code&amp;gt;Hourly.%i.Pressure&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=pressure with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Precipitation|2=&amp;lt;code&amp;gt;Hourly.%i.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those parameters are not localized autmatically so it&#039;s addon&#039;s responsibility&lt;br /&gt;
to localize them properly. Hourly items are 1-indexed, that is, they start from 1.&lt;br /&gt;
&lt;br /&gt;
=== Daily Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Term|1=Daily.%i.ShortDate|2=&amp;lt;code&amp;gt;Daily.%i.ShortDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short date|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.ShortDay|2=&amp;lt;code&amp;gt;Daily.%i.ShortDay&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short day label, e.g. Mon|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.HighTemperature|2=&amp;lt;code&amp;gt;Daily.%i.HighTemperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=high temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.LowTemperature|2=&amp;lt;code&amp;gt;Daily.%i.LowTemperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=low temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.Outlook|2=&amp;lt;code&amp;gt;Daily.%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.OutlookIcon|2=&amp;lt;code&amp;gt;Daily.%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.FanartCode|2=&amp;lt;code&amp;gt;Daily.%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.WindSpeed|2=&amp;lt;code&amp;gt;Daily.%i.WindSpeed&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind speed with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.WindDirection|2=&amp;lt;code&amp;gt;Daily.%i.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction as a label, e.g. NW|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.Precipitation|2=&amp;lt;code&amp;gt;Daily.%i.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those parameters are not localized autmatically so it&#039;s addon&#039;s responsibility&lt;br /&gt;
to localize them properly. Daily items are 1-indexed, that is, they start from 1.&lt;br /&gt;
&lt;br /&gt;
=== Additional Weather Properties ===&lt;br /&gt;
&lt;br /&gt;
Some skins, e.g. aeon.nox.silvo, may use the following properties (up to 7 days):&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Day%i.Title|2=&amp;lt;code&amp;gt;Day%i.Title&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=day of the week|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.HighTemp|2=&amp;lt;code&amp;gt;Day%i.HighTemp&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=high temperature for the day, in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.LowTemp|2=&amp;lt;code&amp;gt;Day%i.LowTemp&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=low temperature of the day, in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.Outlook|2=&amp;lt;code&amp;gt;Day%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the weather forecast|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.OutlookIcon|2=&amp;lt;code&amp;gt;Day%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon, as a filename|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.FanartCode|2=&amp;lt;code&amp;gt;Day%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those properties are 0-indexed.&lt;br /&gt;
&lt;br /&gt;
=== General Properties ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Location|2=&amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=location name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Location|2=&amp;lt;code&amp;gt;Current.Location&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=location name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=WeatherProvider|2=&amp;lt;code&amp;gt;WeatherProvider&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather addon name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=WeatherProviderLogo|2=&amp;lt;code&amp;gt;WeatherProviderLogo&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=path to the addon logo file, preferrabely in a banner format|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Weather.IsFetched|2=&amp;lt;code&amp;gt;Weather.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.IsFetched|2=&amp;lt;code&amp;gt;Current.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if current weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.IsFetched|2=&amp;lt;code&amp;gt;Hourly.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if hourly weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.IsFetched|2=&amp;lt;code&amp;gt;Daily.IsFetched &amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if daily weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The name of the window property set by the weather addon and the resulting window property for the skin will differ in a few scenarios:&lt;br /&gt;
* Current.OutlookIcon (addon) -&amp;gt; Current.ConditionIcon (skin)&lt;br /&gt;
* Current.Wind (addon) -&amp;gt; Current.WindSpeed (skin)&lt;br /&gt;
* Current.Wind / Current.WindDirection (addon) -&amp;gt; Current.Wind (skin)&lt;br /&gt;
Kodi combines the Wind and WindDirection properties into a Wind property with this format: &#039;From &amp;lt;wind dir&amp;gt; at &amp;lt;speed&amp;gt; &amp;lt;unit&amp;gt;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, several window properties set by the addon will be made available to the skin as infolabels:&lt;br /&gt;
* Current.Condition (addon) -&amp;gt; Weather.Conditions (skin)&lt;br /&gt;
* Current.Temperature (addon) -&amp;gt; Weather.Temperature (skin)&lt;br /&gt;
* Current.FanartCode (addon) -&amp;gt; Weather.FanartCode (skin)&lt;br /&gt;
&lt;br /&gt;
Finally, at the end of your script, you need to set the following window properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Location%i (the name of each weather location that has been configured by the user. for locations that are not configured, set an empty property.)&lt;br /&gt;
* Locations (the total number of locations that have been set up by the user. don&#039;t count the ones that have not been configured!)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the addon has finished, Kodi will make one additional infolabel available to the skin:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Weather.Location (the name of the current weather location)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The name of the weather addon, can be displayed by the skin using:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Weather.Plugin (the name of the weather addon)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Advanced weather info (optional)=&lt;br /&gt;
Besides the weather infolabels mentioned above, your addon can return many more, basically there are no limits.&lt;br /&gt;
Keep in mind though, that it requires skin support to display this additional information in Kodi.&lt;br /&gt;
&lt;br /&gt;
If you want to go this route, have a look at the infolabels provided by the Openweathermap and Wunderground addons:&amp;lt;br /&amp;gt;&lt;br /&gt;
* https://github.com/xbmc/repo-scripts/blob/krypton/weather.openweathermap.extended/README.txt&amp;lt;br /&amp;gt;&lt;br /&gt;
* https://github.com/xbmc/repo-scripts/blob/jarvis/weather.wunderground/README.txt&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The infolabels provided by those addons are reasonably well supported by a number of skins already,&lt;br /&gt;
so try if you can use the same infolabel names in your addon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Weather Codes=&lt;br /&gt;
Kodi ships with an icon pack that includes an icon for each weather condition.&amp;lt;br /&amp;gt;&lt;br /&gt;
(https://github.com/xbmc/xbmc/tree/master/addons/resource.images.weathericons.default)&amp;lt;br /&amp;gt;&lt;br /&gt;
Several additional weather icon packs are available through the official Kodi repository.&lt;br /&gt;
&lt;br /&gt;
The following condition-code table is used for the icon names:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 	tornado&lt;br /&gt;
1 	tropical storm&lt;br /&gt;
2 	hurricane&lt;br /&gt;
3 	severe thunderstorms&lt;br /&gt;
4 	thunderstorms&lt;br /&gt;
5 	mixed rain and snow&lt;br /&gt;
6 	mixed rain and sleet&lt;br /&gt;
7 	mixed snow and sleet&lt;br /&gt;
8 	freezing drizzle&lt;br /&gt;
9 	drizzle&lt;br /&gt;
10 	freezing rain&lt;br /&gt;
11 	showers&lt;br /&gt;
12 	showers&lt;br /&gt;
13 	snow flurries&lt;br /&gt;
14 	light snow showers&lt;br /&gt;
15 	blowing snow&lt;br /&gt;
16 	snow&lt;br /&gt;
17 	hail&lt;br /&gt;
18 	sleet&lt;br /&gt;
19 	dust&lt;br /&gt;
20 	foggy&lt;br /&gt;
21 	haze&lt;br /&gt;
22 	smoky&lt;br /&gt;
23 	blustery&lt;br /&gt;
24 	windy&lt;br /&gt;
25 	cold&lt;br /&gt;
26 	cloudy&lt;br /&gt;
27 	mostly cloudy (night)&lt;br /&gt;
28 	mostly cloudy (day)&lt;br /&gt;
29 	partly cloudy (night)&lt;br /&gt;
30 	partly cloudy (day)&lt;br /&gt;
31 	clear (night)&lt;br /&gt;
32 	sunny&lt;br /&gt;
33 	fair (night)&lt;br /&gt;
34 	fair (day)&lt;br /&gt;
35 	mixed rain and hail&lt;br /&gt;
36 	hot&lt;br /&gt;
37 	isolated thunderstorms&lt;br /&gt;
38 	scattered thunderstorms&lt;br /&gt;
39 	scattered thunderstorms&lt;br /&gt;
40 	scattered showers&lt;br /&gt;
41 	heavy snow&lt;br /&gt;
42 	scattered snow showers&lt;br /&gt;
43 	heavy snow&lt;br /&gt;
44 	partly cloudy&lt;br /&gt;
45 	thundershowers&lt;br /&gt;
46 	snow showers&lt;br /&gt;
47 	isolated thundershowers&lt;br /&gt;
na 	not available&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-on_development]]&lt;/div&gt;</summary>
		<author><name>Roman VM</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Weather_addons&amp;diff=253678</id>
		<title>Weather addons</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Weather_addons&amp;diff=253678"/>
		<updated>2024-10-28T13:30:59Z</updated>

		<summary type="html">&lt;p&gt;Roman VM: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Main|Weather}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|This page describes the development of Weather addons for Kodi. If you&#039;re interested in them from a user&#039;s perspective (where to get them, how to configure them, etc.), please use the link above.}}&lt;br /&gt;
&lt;br /&gt;
== addon.xml ==&lt;br /&gt;
Weather addons use the &#039;xbmc.python.weather&#039; extension point.&lt;br /&gt;
The basic layout of the addon.xml of a weather addon will look like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; line highlight=&amp;quot;6&amp;quot; style=&amp;quot;white-space: pre-wrap;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;weather.name&amp;quot; name=&amp;quot;My Weather&amp;quot; version=&amp;quot;1.2.3&amp;quot; provider-name=&amp;quot;me&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;requires&amp;gt;&lt;br /&gt;
		&amp;lt;import addon=&amp;quot;xbmc.python&amp;quot; version=&amp;quot;3.0.0&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/requires&amp;gt;&lt;br /&gt;
	&amp;lt;extension point=&amp;quot;xbmc.python.weather&amp;quot; library=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;summary lang=&amp;quot;en_GB&amp;quot;&amp;gt;&amp;lt;/summary&amp;gt;&lt;br /&gt;
		&amp;lt;description lang=&amp;quot;en_GB&amp;quot;&amp;gt;&amp;lt;/description&amp;gt;&lt;br /&gt;
		&amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;platform&amp;gt;&amp;lt;/platform&amp;gt;&lt;br /&gt;
		&amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
		&amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
		&amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
		&amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
		&amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
	&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Things to know ==&lt;br /&gt;
There are a few things (quirks) you need to be aware of when creating a weather addon...&lt;br /&gt;
* A weather addon will be run automatically when the skins asks to display one of these weather-specific infolabels:&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Conditions&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Temperature&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Location&amp;lt;/code&amp;gt;&lt;br /&gt;
* The weather addon will run at 30 minute intervals (as long the current skin window displays one of the above-mentioned infolabels)&lt;br /&gt;
* In the weather window, Kodi will automatically try to translate all the weather strings&lt;br /&gt;
* Kodi will also handle transformations between units (for instance, Celsius to Fahrenheit, km/h to mph)&lt;br /&gt;
&lt;br /&gt;
== Theory of operation ==&lt;br /&gt;
Kodi can run a weather addon in two modes:&lt;br /&gt;
&lt;br /&gt;
=== Weather location configuration ===&lt;br /&gt;
In order to set up a weather addon, you need to include a settings.xml file for your weather addon. It needs to have this structure:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; style=&amp;quot;white-space: pre-wrap;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section id=&amp;quot;weather.name&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;category id=&amp;quot;locations&amp;quot; label=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;group id=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location1&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location1)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location2&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;32003&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location2)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
          &amp;lt;dependencies&amp;gt;&lt;br /&gt;
            &amp;lt;dependency type=&amp;quot;enable&amp;quot; operator=&amp;quot;!is&amp;quot; setting=&amp;quot;location1&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/dependencies&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location3&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;32004&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location3)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
          &amp;lt;dependencies&amp;gt;&lt;br /&gt;
            &amp;lt;dependency type=&amp;quot;enable&amp;quot; operator=&amp;quot;!is&amp;quot; setting=&amp;quot;location2&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/dependencies&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
      &amp;lt;/group&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can define as many weather locations as you want in your settings.xml file. Additional location parameters, like longitude and latitude,&lt;br /&gt;
can be saved as invissble settings.&lt;br /&gt;
&lt;br /&gt;
When you&#039;re going to set up a location in the weather addon settings, Kodi will pass the argument(s) you&#039;ve defined in the RunScript() action above to your addon. For instance, if you set the &#039;Location 2&#039; entry active in the Weather settings, Kodi will pass &#039;Loc2&#039; to your addon.&lt;br /&gt;
&lt;br /&gt;
=== Retrieving weather data ===&lt;br /&gt;
When weather information needs to be retrieved, Kodi will pass the location number to your addon. For instance, if the weather for Location 4 is requested, Kodi will pass &#039;4&#039; to the weather addon.&lt;br /&gt;
&lt;br /&gt;
=== Required output ===&lt;br /&gt;
When a weather addon is asked to retrieve weather information, it needs to return this info to Kodi. This is done by making the various pieces of information available as window properties of the weather window.&lt;br /&gt;
&lt;br /&gt;
The basic python code needed to provide a window property:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
WINDOW = xbmcgui.Window(12600)&lt;br /&gt;
WINDOW.setProperty(name, value)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Kodi expects a weather addon to populate these properties:&lt;br /&gt;
&lt;br /&gt;
=== Current Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Current.Condition|2=&amp;lt;code&amp;gt;Current.Condition&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the weather condition as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Temperature|2=&amp;lt;code&amp;gt;Current.Temperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=temperature in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Wind|2=&amp;lt;code&amp;gt;Current.Wind&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=windspeed in km/h|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.WindDirection|2=&amp;lt;code&amp;gt;Current.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction, NNE|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Humidity|2=&amp;lt;code&amp;gt;Current.Humidity&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=relative humidity as a percentage|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.FeelsLike|2=&amp;lt;code&amp;gt;Current.FeelsLike&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=feels-like temperature in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.UVIndex|2=&amp;lt;code&amp;gt;Current.UVIndex&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the UV-index as an integer|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.DewPoint|2=&amp;lt;code&amp;gt;Current.DewPoint&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=dewpoint in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Precipitation|2=&amp;lt;code&amp;gt;Current.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Cloudiness|2=&amp;lt;code&amp;gt;Current.Cloudiness&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=cloud cover in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.OutlookIcon|2=&amp;lt;code&amp;gt;Current.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon, as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.FanartCode|2=&amp;lt;code&amp;gt;Current.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Kodi will read those window properties and do unit conversions if needed, depending on the regional settings in Kodi.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hourly Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Hourly.%i.Time|2=&amp;lt;code&amp;gt;Hourly.%i.Time&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=hour time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.LongDate|2=&amp;lt;code&amp;gt;Hourly.%i.LongDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=long date and time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.ShortDate|2=&amp;lt;code&amp;gt;Hourly.%i.ShortDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short date and time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Outlook|2=&amp;lt;code&amp;gt;Hourly.%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.OutlookIcon|2=&amp;lt;code&amp;gt;Hourly.%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.FanartCode|2=&amp;lt;code&amp;gt;Hourly.%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.WindSpeed|2=&amp;lt;code&amp;gt;Hourly.%i.WindSpeed&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind speed with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.WindDirection|2=&amp;lt;code&amp;gt;Hourly.%i.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction as a label, e.g. NW|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Humidity|2=&amp;lt;code&amp;gt;Hourly.%i.Humidity&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=humidity in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Temperature|2=&amp;lt;code&amp;gt;Hourly.%i.Temperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.DewPoint|2=&amp;lt;code&amp;gt;Hourly.%i.DewPoint&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=dew point as temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.FeelsLike|2=&amp;lt;code&amp;gt;Hourly.%i.FeelsLike&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=apparent temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Pressure|2=&amp;lt;code&amp;gt;Hourly.%i.Pressure&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=pressure with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Precipitation|2=&amp;lt;code&amp;gt;Hourly.%i.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those parameters are not localized autmatically so it&#039;s addon&#039;s responsibility&lt;br /&gt;
to localize them properly. Hourly items are 1-indexed, that is, they start from 1.&lt;br /&gt;
&lt;br /&gt;
=== Daily Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Term|1=Daily.%i.ShortDate|2=&amp;lt;code&amp;gt;Daily.%i.ShortDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short date|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.ShortDay|2=&amp;lt;code&amp;gt;Daily.%i.ShortDay&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short day label, e.g. Mon|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.HighTemperature|2=&amp;lt;code&amp;gt;Daily.%i.HighTemperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=high temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.LowTemperature|2=&amp;lt;code&amp;gt;Daily.%i.LowTemperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=low temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.Outlook|2=&amp;lt;code&amp;gt;Daily.%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.OutlookIcon|2=&amp;lt;code&amp;gt;Daily.%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.FanartCode|2=&amp;lt;code&amp;gt;Daily.%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.WindSpeed|2=&amp;lt;code&amp;gt;Daily.%i.WindSpeed&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind speed with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.WindDirection|2=&amp;lt;code&amp;gt;Daily.%i.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction as a label, e.g. NW|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.Precipitation|2=&amp;lt;code&amp;gt;Daily.%i.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those parameters are not localized autmatically so it&#039;s addon&#039;s responsibility&lt;br /&gt;
to localize them properly. Daily items are 1-indexed, that is, they start from 1.&lt;br /&gt;
&lt;br /&gt;
=== Additional Weather Properties ===&lt;br /&gt;
&lt;br /&gt;
Some skins, e.g. aeon.nox.silvo, may use the following properties (up to 7 days):&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Day%i.Title|2=&amp;lt;code&amp;gt;Day%i.Title&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=day of the week|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.HighTemp|2=&amp;lt;code&amp;gt;Day%i.HighTemp&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=high temperature for the day, in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.LowTemp|2=&amp;lt;code&amp;gt;Day%i.LowTemp&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=low temperature of the day, in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.Outlook|2=&amp;lt;code&amp;gt;Day%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the weather forecast|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.OutlookIcon|2=&amp;lt;code&amp;gt;Day%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon, as a filename|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.FanartCode|2=&amp;lt;code&amp;gt;Day%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those properties are 0-indexed.&lt;br /&gt;
&lt;br /&gt;
=== General Properties ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Location|2=&amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=location name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Location|2=&amp;lt;code&amp;gt;Current.Location&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=location name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=WeatherProvider|2=&amp;lt;code&amp;gt;WeatherProvider&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather addon name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=WeatherProviderLogo|2=&amp;lt;code&amp;gt;WeatherProviderLogo&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=path to the addon logo file, preferrabely in a banner format|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Weather.IsFetched|2=&amp;lt;code&amp;gt;Weather.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.IsFetched|2=&amp;lt;code&amp;gt;Current.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if current weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.IsFetched|2=&amp;lt;code&amp;gt;Hourly.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if hourly weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.IsFetched|2=&amp;lt;code&amp;gt;Daily.IsFetched &amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if daily weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The name of the window property set by the weather addon and the resulting window property for the skin will differ in a few scenarios:&lt;br /&gt;
* Current.OutlookIcon (addon) -&amp;gt; Current.ConditionIcon (skin)&lt;br /&gt;
* Current.Wind (addon) -&amp;gt; Current.WindSpeed (skin)&lt;br /&gt;
* Current.Wind / Current.WindDirection (addon) -&amp;gt; Current.Wind (skin)&lt;br /&gt;
Kodi combines the Wind and WindDirection properties into a Wind property with this format: &#039;From &amp;lt;wind dir&amp;gt; at &amp;lt;speed&amp;gt; &amp;lt;unit&amp;gt;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, several window properties set by the addon will be made available to the skin as infolabels:&lt;br /&gt;
* Current.Condition (addon) -&amp;gt; Weather.Conditions (skin)&lt;br /&gt;
* Current.Temperature (addon) -&amp;gt; Weather.Temperature (skin)&lt;br /&gt;
* Current.FanartCode (addon) -&amp;gt; Weather.FanartCode (skin)&lt;br /&gt;
&lt;br /&gt;
Finally, at the end of your script, you need to set the following window properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Location%i (the name of each weather location that has been configured by the user. for locations that are not configured, set an empty property.)&lt;br /&gt;
* Locations (the total number of locations that have been set up by the user. don&#039;t count the ones that have not been configured!)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the addon has finished, Kodi will make one additional infolabel available to the skin:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Weather.Location (the name of the current weather location)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The name of the weather addon, can be displayed by the skin using:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Weather.Plugin (the name of the weather addon)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Advanced weather info (optional)=&lt;br /&gt;
Besides the weather infolabels mentioned above, your addon can return many more, basically there are no limits.&lt;br /&gt;
Keep in mind though, that it requires skin support to display this additional information in Kodi.&lt;br /&gt;
&lt;br /&gt;
If you want to go this route, have a look at the infolabels provided by the Openweathermap and Wunderground addons:&amp;lt;br /&amp;gt;&lt;br /&gt;
* https://github.com/xbmc/repo-scripts/blob/krypton/weather.openweathermap.extended/README.txt&amp;lt;br /&amp;gt;&lt;br /&gt;
* https://github.com/xbmc/repo-scripts/blob/jarvis/weather.wunderground/README.txt&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The infolabels provided by those addons are reasonably well supported by a number of skins already,&lt;br /&gt;
so try if you can use the same infolabel names in your addon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Weather Codes=&lt;br /&gt;
Kodi ships with an icon pack that includes an icon for each weather condition.&amp;lt;br /&amp;gt;&lt;br /&gt;
(https://github.com/xbmc/xbmc/tree/master/addons/resource.images.weathericons.default)&amp;lt;br /&amp;gt;&lt;br /&gt;
Several additional weather icon packs are available through the official Kodi repository.&lt;br /&gt;
&lt;br /&gt;
The following condition-code table is used for the icon names:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 	tornado&lt;br /&gt;
1 	tropical storm&lt;br /&gt;
2 	hurricane&lt;br /&gt;
3 	severe thunderstorms&lt;br /&gt;
4 	thunderstorms&lt;br /&gt;
5 	mixed rain and snow&lt;br /&gt;
6 	mixed rain and sleet&lt;br /&gt;
7 	mixed snow and sleet&lt;br /&gt;
8 	freezing drizzle&lt;br /&gt;
9 	drizzle&lt;br /&gt;
10 	freezing rain&lt;br /&gt;
11 	showers&lt;br /&gt;
12 	showers&lt;br /&gt;
13 	snow flurries&lt;br /&gt;
14 	light snow showers&lt;br /&gt;
15 	blowing snow&lt;br /&gt;
16 	snow&lt;br /&gt;
17 	hail&lt;br /&gt;
18 	sleet&lt;br /&gt;
19 	dust&lt;br /&gt;
20 	foggy&lt;br /&gt;
21 	haze&lt;br /&gt;
22 	smoky&lt;br /&gt;
23 	blustery&lt;br /&gt;
24 	windy&lt;br /&gt;
25 	cold&lt;br /&gt;
26 	cloudy&lt;br /&gt;
27 	mostly cloudy (night)&lt;br /&gt;
28 	mostly cloudy (day)&lt;br /&gt;
29 	partly cloudy (night)&lt;br /&gt;
30 	partly cloudy (day)&lt;br /&gt;
31 	clear (night)&lt;br /&gt;
32 	sunny&lt;br /&gt;
33 	fair (night)&lt;br /&gt;
34 	fair (day)&lt;br /&gt;
35 	mixed rain and hail&lt;br /&gt;
36 	hot&lt;br /&gt;
37 	isolated thunderstorms&lt;br /&gt;
38 	scattered thunderstorms&lt;br /&gt;
39 	scattered thunderstorms&lt;br /&gt;
40 	scattered showers&lt;br /&gt;
41 	heavy snow&lt;br /&gt;
42 	scattered snow showers&lt;br /&gt;
43 	heavy snow&lt;br /&gt;
44 	partly cloudy&lt;br /&gt;
45 	thundershowers&lt;br /&gt;
46 	snow showers&lt;br /&gt;
47 	isolated thundershowers&lt;br /&gt;
na 	not available&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-on_development]]&lt;/div&gt;</summary>
		<author><name>Roman VM</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Weather_addons&amp;diff=253677</id>
		<title>Weather addons</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Weather_addons&amp;diff=253677"/>
		<updated>2024-10-28T13:28:35Z</updated>

		<summary type="html">&lt;p&gt;Roman VM: fix /* General Properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Main|Weather}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|This page describes the development of Weather addons for Kodi. If you&#039;re interested in them from a user&#039;s perspective (where to get them, how to configure them, etc.), please use the link above.}}&lt;br /&gt;
&lt;br /&gt;
== addon.xml ==&lt;br /&gt;
Weather addons use the &#039;xbmc.python.weather&#039; extension point.&lt;br /&gt;
The basic layout of the addon.xml of a weather addon will look like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; line highlight=&amp;quot;6&amp;quot; style=&amp;quot;white-space: pre-wrap;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;weather.name&amp;quot; name=&amp;quot;My Weather&amp;quot; version=&amp;quot;1.2.3&amp;quot; provider-name=&amp;quot;me&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;requires&amp;gt;&lt;br /&gt;
		&amp;lt;import addon=&amp;quot;xbmc.python&amp;quot; version=&amp;quot;3.0.0&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/requires&amp;gt;&lt;br /&gt;
	&amp;lt;extension point=&amp;quot;xbmc.python.weather&amp;quot; library=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;summary lang=&amp;quot;en_GB&amp;quot;&amp;gt;&amp;lt;/summary&amp;gt;&lt;br /&gt;
		&amp;lt;description lang=&amp;quot;en_GB&amp;quot;&amp;gt;&amp;lt;/description&amp;gt;&lt;br /&gt;
		&amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;platform&amp;gt;&amp;lt;/platform&amp;gt;&lt;br /&gt;
		&amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
		&amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
		&amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
		&amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
		&amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
	&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Things to know ==&lt;br /&gt;
There are a few things (quirks) you need to be aware of when creating a weather addon...&lt;br /&gt;
* A weather addon will be run automatically when the skins asks to display one of these weather-specific infolabels:&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Conditions&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Temperature&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Location&amp;lt;/code&amp;gt;&lt;br /&gt;
* The weather addon will run at 30 minute intervals (as long the current skin window displays one of the above-mentioned infolabels)&lt;br /&gt;
* In the weather window, Kodi will automatically try to translate all the weather strings&lt;br /&gt;
* Kodi will also handle transformations between units (for instance, Celsius to Fahrenheit, km/h to mph)&lt;br /&gt;
&lt;br /&gt;
== Theory of operation ==&lt;br /&gt;
Kodi can run a weather addon in two modes:&lt;br /&gt;
&lt;br /&gt;
=== Weather location configuration ===&lt;br /&gt;
In order to set up a weather addon, you need to include a settings.xml file for your weather addon. It needs to have this structure:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; style=&amp;quot;white-space: pre-wrap;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section id=&amp;quot;weather.name&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;category id=&amp;quot;locations&amp;quot; label=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;group id=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location1&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location1)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location2&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;32003&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location2)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
          &amp;lt;dependencies&amp;gt;&lt;br /&gt;
            &amp;lt;dependency type=&amp;quot;enable&amp;quot; operator=&amp;quot;!is&amp;quot; setting=&amp;quot;location1&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/dependencies&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location3&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;32004&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location3)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
          &amp;lt;dependencies&amp;gt;&lt;br /&gt;
            &amp;lt;dependency type=&amp;quot;enable&amp;quot; operator=&amp;quot;!is&amp;quot; setting=&amp;quot;location2&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/dependencies&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
      &amp;lt;/group&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can define as many weather locations as you want in your settings.xml file.&lt;br /&gt;
&lt;br /&gt;
When you&#039;re going to set up a location in the weather addon settings, Kodi will pass the argument(s) you&#039;ve defined in the RunScript() action above to your addon. For instance, if you set the &#039;Location 2&#039; entry active in the Weather settings, Kodi will pass &#039;Loc2&#039; to your addon.&lt;br /&gt;
&lt;br /&gt;
=== Retrieving weather data ===&lt;br /&gt;
When weather information needs to be retrieved, Kodi will pass the location number to your addon. For instance, if the weather for Location 4 is requested, Kodi will pass &#039;4&#039; to the weather addon.&lt;br /&gt;
&lt;br /&gt;
=== Required output ===&lt;br /&gt;
When a weather addon is asked to retrieve weather information, it needs to return this info to Kodi. This is done by making the various pieces of information available as window properties of the weather window.&lt;br /&gt;
&lt;br /&gt;
The basic python code needed to provide a window property:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
WINDOW = xbmcgui.Window(12600)&lt;br /&gt;
WINDOW.setProperty(name, value)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Kodi expects a weather addon to populate these properties:&lt;br /&gt;
&lt;br /&gt;
=== Current Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Current.Condition|2=&amp;lt;code&amp;gt;Current.Condition&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the weather condition as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Temperature|2=&amp;lt;code&amp;gt;Current.Temperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=temperature in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Wind|2=&amp;lt;code&amp;gt;Current.Wind&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=windspeed in km/h|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.WindDirection|2=&amp;lt;code&amp;gt;Current.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction, NNE|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Humidity|2=&amp;lt;code&amp;gt;Current.Humidity&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=relative humidity as a percentage|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.FeelsLike|2=&amp;lt;code&amp;gt;Current.FeelsLike&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=feels-like temperature in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.UVIndex|2=&amp;lt;code&amp;gt;Current.UVIndex&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the UV-index as an integer|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.DewPoint|2=&amp;lt;code&amp;gt;Current.DewPoint&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=dewpoint in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Precipitation|2=&amp;lt;code&amp;gt;Current.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Cloudiness|2=&amp;lt;code&amp;gt;Current.Cloudiness&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=cloud cover in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.OutlookIcon|2=&amp;lt;code&amp;gt;Current.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon, as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.FanartCode|2=&amp;lt;code&amp;gt;Current.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Kodi will read those window properties and do unit conversions if needed, depending on the regional settings in Kodi.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hourly Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Hourly.%i.Time|2=&amp;lt;code&amp;gt;Hourly.%i.Time&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=hour time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.LongDate|2=&amp;lt;code&amp;gt;Hourly.%i.LongDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=long date and time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.ShortDate|2=&amp;lt;code&amp;gt;Hourly.%i.ShortDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short date and time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Outlook|2=&amp;lt;code&amp;gt;Hourly.%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.OutlookIcon|2=&amp;lt;code&amp;gt;Hourly.%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.FanartCode|2=&amp;lt;code&amp;gt;Hourly.%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.WindSpeed|2=&amp;lt;code&amp;gt;Hourly.%i.WindSpeed&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind speed with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.WindDirection|2=&amp;lt;code&amp;gt;Hourly.%i.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction as a label, e.g. NW|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Humidity|2=&amp;lt;code&amp;gt;Hourly.%i.Humidity&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=humidity in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Temperature|2=&amp;lt;code&amp;gt;Hourly.%i.Temperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.DewPoint|2=&amp;lt;code&amp;gt;Hourly.%i.DewPoint&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=dew point as temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.FeelsLike|2=&amp;lt;code&amp;gt;Hourly.%i.FeelsLike&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=apparent temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Pressure|2=&amp;lt;code&amp;gt;Hourly.%i.Pressure&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=pressure with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Precipitation|2=&amp;lt;code&amp;gt;Hourly.%i.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those parameters are not localized autmatically so it&#039;s addon&#039;s responsibility&lt;br /&gt;
to localize them properly. Hourly items are 1-indexed, that is, they start from 1.&lt;br /&gt;
&lt;br /&gt;
=== Daily Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Term|1=Daily.%i.ShortDate|2=&amp;lt;code&amp;gt;Daily.%i.ShortDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short date|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.ShortDay|2=&amp;lt;code&amp;gt;Daily.%i.ShortDay&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short day label, e.g. Mon|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.HighTemperature|2=&amp;lt;code&amp;gt;Daily.%i.HighTemperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=high temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.LowTemperature|2=&amp;lt;code&amp;gt;Daily.%i.LowTemperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=low temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.Outlook|2=&amp;lt;code&amp;gt;Daily.%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.OutlookIcon|2=&amp;lt;code&amp;gt;Daily.%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.FanartCode|2=&amp;lt;code&amp;gt;Daily.%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.WindSpeed|2=&amp;lt;code&amp;gt;Daily.%i.WindSpeed&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind speed with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.WindDirection|2=&amp;lt;code&amp;gt;Daily.%i.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction as a label, e.g. NW|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.Precipitation|2=&amp;lt;code&amp;gt;Daily.%i.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those parameters are not localized autmatically so it&#039;s addon&#039;s responsibility&lt;br /&gt;
to localize them properly. Daily items are 1-indexed, that is, they start from 1.&lt;br /&gt;
&lt;br /&gt;
=== Additional Weather Properties ===&lt;br /&gt;
&lt;br /&gt;
Some skins, e.g. aeon.nox.silvo, may use the following properties (up to 7 days):&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Day%i.Title|2=&amp;lt;code&amp;gt;Day%i.Title&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=day of the week|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.HighTemp|2=&amp;lt;code&amp;gt;Day%i.HighTemp&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=high temperature for the day, in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.LowTemp|2=&amp;lt;code&amp;gt;Day%i.LowTemp&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=low temperature of the day, in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.Outlook|2=&amp;lt;code&amp;gt;Day%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the weather forecast|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.OutlookIcon|2=&amp;lt;code&amp;gt;Day%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon, as a filename|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.FanartCode|2=&amp;lt;code&amp;gt;Day%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those properties are 0-indexed.&lt;br /&gt;
&lt;br /&gt;
=== General Properties ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Location|2=&amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=location name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Location|2=&amp;lt;code&amp;gt;Current.Location&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=location name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=WeatherProvider|2=&amp;lt;code&amp;gt;WeatherProvider&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather addon name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=WeatherProviderLogo|2=&amp;lt;code&amp;gt;WeatherProviderLogo&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=path to the addon logo file, preferrabely in a banner format|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Weather.IsFetched|2=&amp;lt;code&amp;gt;Weather.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.IsFetched|2=&amp;lt;code&amp;gt;Current.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if current weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.IsFetched|2=&amp;lt;code&amp;gt;Hourly.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if hourly weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.IsFetched|2=&amp;lt;code&amp;gt;Daily.IsFetched &amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if daily weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The name of the window property set by the weather addon and the resulting window property for the skin will differ in a few scenarios:&lt;br /&gt;
* Current.OutlookIcon (addon) -&amp;gt; Current.ConditionIcon (skin)&lt;br /&gt;
* Current.Wind (addon) -&amp;gt; Current.WindSpeed (skin)&lt;br /&gt;
* Current.Wind / Current.WindDirection (addon) -&amp;gt; Current.Wind (skin)&lt;br /&gt;
Kodi combines the Wind and WindDirection properties into a Wind property with this format: &#039;From &amp;lt;wind dir&amp;gt; at &amp;lt;speed&amp;gt; &amp;lt;unit&amp;gt;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, several window properties set by the addon will be made available to the skin as infolabels:&lt;br /&gt;
* Current.Condition (addon) -&amp;gt; Weather.Conditions (skin)&lt;br /&gt;
* Current.Temperature (addon) -&amp;gt; Weather.Temperature (skin)&lt;br /&gt;
* Current.FanartCode (addon) -&amp;gt; Weather.FanartCode (skin)&lt;br /&gt;
&lt;br /&gt;
Finally, at the end of your script, you need to set the following window properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Location%i (the name of each weather location that has been configured by the user. for locations that are not configured, set an empty property.)&lt;br /&gt;
* Locations (the total number of locations that have been set up by the user. don&#039;t count the ones that have not been configured!)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the addon has finished, Kodi will make one additional infolabel available to the skin:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Weather.Location (the name of the current weather location)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The name of the weather addon, can be displayed by the skin using:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Weather.Plugin (the name of the weather addon)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Advanced weather info (optional)=&lt;br /&gt;
Besides the weather infolabels mentioned above, your addon can return many more, basically there are no limits.&lt;br /&gt;
Keep in mind though, that it requires skin support to display this additional information in Kodi.&lt;br /&gt;
&lt;br /&gt;
If you want to go this route, have a look at the infolabels provided by the Openweathermap and Wunderground addons:&amp;lt;br /&amp;gt;&lt;br /&gt;
* https://github.com/xbmc/repo-scripts/blob/krypton/weather.openweathermap.extended/README.txt&amp;lt;br /&amp;gt;&lt;br /&gt;
* https://github.com/xbmc/repo-scripts/blob/jarvis/weather.wunderground/README.txt&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The infolabels provided by those addons are reasonably well supported by a number of skins already,&lt;br /&gt;
so try if you can use the same infolabel names in your addon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Weather Codes=&lt;br /&gt;
Kodi ships with an icon pack that includes an icon for each weather condition.&amp;lt;br /&amp;gt;&lt;br /&gt;
(https://github.com/xbmc/xbmc/tree/master/addons/resource.images.weathericons.default)&amp;lt;br /&amp;gt;&lt;br /&gt;
Several additional weather icon packs are available through the official Kodi repository.&lt;br /&gt;
&lt;br /&gt;
The following condition-code table is used for the icon names:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 	tornado&lt;br /&gt;
1 	tropical storm&lt;br /&gt;
2 	hurricane&lt;br /&gt;
3 	severe thunderstorms&lt;br /&gt;
4 	thunderstorms&lt;br /&gt;
5 	mixed rain and snow&lt;br /&gt;
6 	mixed rain and sleet&lt;br /&gt;
7 	mixed snow and sleet&lt;br /&gt;
8 	freezing drizzle&lt;br /&gt;
9 	drizzle&lt;br /&gt;
10 	freezing rain&lt;br /&gt;
11 	showers&lt;br /&gt;
12 	showers&lt;br /&gt;
13 	snow flurries&lt;br /&gt;
14 	light snow showers&lt;br /&gt;
15 	blowing snow&lt;br /&gt;
16 	snow&lt;br /&gt;
17 	hail&lt;br /&gt;
18 	sleet&lt;br /&gt;
19 	dust&lt;br /&gt;
20 	foggy&lt;br /&gt;
21 	haze&lt;br /&gt;
22 	smoky&lt;br /&gt;
23 	blustery&lt;br /&gt;
24 	windy&lt;br /&gt;
25 	cold&lt;br /&gt;
26 	cloudy&lt;br /&gt;
27 	mostly cloudy (night)&lt;br /&gt;
28 	mostly cloudy (day)&lt;br /&gt;
29 	partly cloudy (night)&lt;br /&gt;
30 	partly cloudy (day)&lt;br /&gt;
31 	clear (night)&lt;br /&gt;
32 	sunny&lt;br /&gt;
33 	fair (night)&lt;br /&gt;
34 	fair (day)&lt;br /&gt;
35 	mixed rain and hail&lt;br /&gt;
36 	hot&lt;br /&gt;
37 	isolated thunderstorms&lt;br /&gt;
38 	scattered thunderstorms&lt;br /&gt;
39 	scattered thunderstorms&lt;br /&gt;
40 	scattered showers&lt;br /&gt;
41 	heavy snow&lt;br /&gt;
42 	scattered snow showers&lt;br /&gt;
43 	heavy snow&lt;br /&gt;
44 	partly cloudy&lt;br /&gt;
45 	thundershowers&lt;br /&gt;
46 	snow showers&lt;br /&gt;
47 	isolated thundershowers&lt;br /&gt;
na 	not available&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-on_development]]&lt;/div&gt;</summary>
		<author><name>Roman VM</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Weather_addons&amp;diff=253676</id>
		<title>Weather addons</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Weather_addons&amp;diff=253676"/>
		<updated>2024-10-28T13:27:20Z</updated>

		<summary type="html">&lt;p&gt;Roman VM: clarification&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Main|Weather}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|This page describes the development of Weather addons for Kodi. If you&#039;re interested in them from a user&#039;s perspective (where to get them, how to configure them, etc.), please use the link above.}}&lt;br /&gt;
&lt;br /&gt;
== addon.xml ==&lt;br /&gt;
Weather addons use the &#039;xbmc.python.weather&#039; extension point.&lt;br /&gt;
The basic layout of the addon.xml of a weather addon will look like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; line highlight=&amp;quot;6&amp;quot; style=&amp;quot;white-space: pre-wrap;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;weather.name&amp;quot; name=&amp;quot;My Weather&amp;quot; version=&amp;quot;1.2.3&amp;quot; provider-name=&amp;quot;me&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;requires&amp;gt;&lt;br /&gt;
		&amp;lt;import addon=&amp;quot;xbmc.python&amp;quot; version=&amp;quot;3.0.0&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/requires&amp;gt;&lt;br /&gt;
	&amp;lt;extension point=&amp;quot;xbmc.python.weather&amp;quot; library=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;summary lang=&amp;quot;en_GB&amp;quot;&amp;gt;&amp;lt;/summary&amp;gt;&lt;br /&gt;
		&amp;lt;description lang=&amp;quot;en_GB&amp;quot;&amp;gt;&amp;lt;/description&amp;gt;&lt;br /&gt;
		&amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;platform&amp;gt;&amp;lt;/platform&amp;gt;&lt;br /&gt;
		&amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
		&amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
		&amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
		&amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
		&amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
	&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Things to know ==&lt;br /&gt;
There are a few things (quirks) you need to be aware of when creating a weather addon...&lt;br /&gt;
* A weather addon will be run automatically when the skins asks to display one of these weather-specific infolabels:&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Conditions&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Temperature&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Location&amp;lt;/code&amp;gt;&lt;br /&gt;
* The weather addon will run at 30 minute intervals (as long the current skin window displays one of the above-mentioned infolabels)&lt;br /&gt;
* In the weather window, Kodi will automatically try to translate all the weather strings&lt;br /&gt;
* Kodi will also handle transformations between units (for instance, Celsius to Fahrenheit, km/h to mph)&lt;br /&gt;
&lt;br /&gt;
== Theory of operation ==&lt;br /&gt;
Kodi can run a weather addon in two modes:&lt;br /&gt;
&lt;br /&gt;
=== Weather location configuration ===&lt;br /&gt;
In order to set up a weather addon, you need to include a settings.xml file for your weather addon. It needs to have this structure:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; style=&amp;quot;white-space: pre-wrap;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section id=&amp;quot;weather.name&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;category id=&amp;quot;locations&amp;quot; label=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;group id=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location1&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location1)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location2&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;32003&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location2)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
          &amp;lt;dependencies&amp;gt;&lt;br /&gt;
            &amp;lt;dependency type=&amp;quot;enable&amp;quot; operator=&amp;quot;!is&amp;quot; setting=&amp;quot;location1&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/dependencies&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location3&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;32004&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location3)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
          &amp;lt;dependencies&amp;gt;&lt;br /&gt;
            &amp;lt;dependency type=&amp;quot;enable&amp;quot; operator=&amp;quot;!is&amp;quot; setting=&amp;quot;location2&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/dependencies&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
      &amp;lt;/group&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can define as many weather locations as you want in your settings.xml file.&lt;br /&gt;
&lt;br /&gt;
When you&#039;re going to set up a location in the weather addon settings, Kodi will pass the argument(s) you&#039;ve defined in the RunScript() action above to your addon. For instance, if you set the &#039;Location 2&#039; entry active in the Weather settings, Kodi will pass &#039;Loc2&#039; to your addon.&lt;br /&gt;
&lt;br /&gt;
=== Retrieving weather data ===&lt;br /&gt;
When weather information needs to be retrieved, Kodi will pass the location number to your addon. For instance, if the weather for Location 4 is requested, Kodi will pass &#039;4&#039; to the weather addon.&lt;br /&gt;
&lt;br /&gt;
=== Required output ===&lt;br /&gt;
When a weather addon is asked to retrieve weather information, it needs to return this info to Kodi. This is done by making the various pieces of information available as window properties of the weather window.&lt;br /&gt;
&lt;br /&gt;
The basic python code needed to provide a window property:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
WINDOW = xbmcgui.Window(12600)&lt;br /&gt;
WINDOW.setProperty(name, value)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Kodi expects a weather addon to populate these properties:&lt;br /&gt;
&lt;br /&gt;
=== Current Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Current.Condition|2=&amp;lt;code&amp;gt;Current.Condition&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the weather condition as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Temperature|2=&amp;lt;code&amp;gt;Current.Temperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=temperature in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Wind|2=&amp;lt;code&amp;gt;Current.Wind&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=windspeed in km/h|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.WindDirection|2=&amp;lt;code&amp;gt;Current.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction, NNE|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Humidity|2=&amp;lt;code&amp;gt;Current.Humidity&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=relative humidity as a percentage|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.FeelsLike|2=&amp;lt;code&amp;gt;Current.FeelsLike&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=feels-like temperature in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.UVIndex|2=&amp;lt;code&amp;gt;Current.UVIndex&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the UV-index as an integer|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.DewPoint|2=&amp;lt;code&amp;gt;Current.DewPoint&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=dewpoint in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Precipitation|2=&amp;lt;code&amp;gt;Current.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Cloudiness|2=&amp;lt;code&amp;gt;Current.Cloudiness&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=cloud cover in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.OutlookIcon|2=&amp;lt;code&amp;gt;Current.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon, as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.FanartCode|2=&amp;lt;code&amp;gt;Current.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Kodi will read those window properties and do unit conversions if needed, depending on the regional settings in Kodi.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hourly Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Hourly.%i.Time|2=&amp;lt;code&amp;gt;Hourly.%i.Time&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=hour time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.LongDate|2=&amp;lt;code&amp;gt;Hourly.%i.LongDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=long date and time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.ShortDate|2=&amp;lt;code&amp;gt;Hourly.%i.ShortDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short date and time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Outlook|2=&amp;lt;code&amp;gt;Hourly.%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.OutlookIcon|2=&amp;lt;code&amp;gt;Hourly.%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.FanartCode|2=&amp;lt;code&amp;gt;Hourly.%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.WindSpeed|2=&amp;lt;code&amp;gt;Hourly.%i.WindSpeed&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind speed with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.WindDirection|2=&amp;lt;code&amp;gt;Hourly.%i.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction as a label, e.g. NW|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Humidity|2=&amp;lt;code&amp;gt;Hourly.%i.Humidity&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=humidity in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Temperature|2=&amp;lt;code&amp;gt;Hourly.%i.Temperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.DewPoint|2=&amp;lt;code&amp;gt;Hourly.%i.DewPoint&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=dew point as temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.FeelsLike|2=&amp;lt;code&amp;gt;Hourly.%i.FeelsLike&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=apparent temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Pressure|2=&amp;lt;code&amp;gt;Hourly.%i.Pressure&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=pressure with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Precipitation|2=&amp;lt;code&amp;gt;Hourly.%i.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those parameters are not localized autmatically so it&#039;s addon&#039;s responsibility&lt;br /&gt;
to localize them properly. Hourly items are 1-indexed, that is, they start from 1.&lt;br /&gt;
&lt;br /&gt;
=== Daily Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Term|1=Daily.%i.ShortDate|2=&amp;lt;code&amp;gt;Daily.%i.ShortDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short date|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.ShortDay|2=&amp;lt;code&amp;gt;Daily.%i.ShortDay&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short day label, e.g. Mon|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.HighTemperature|2=&amp;lt;code&amp;gt;Daily.%i.HighTemperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=high temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.LowTemperature|2=&amp;lt;code&amp;gt;Daily.%i.LowTemperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=low temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.Outlook|2=&amp;lt;code&amp;gt;Daily.%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.OutlookIcon|2=&amp;lt;code&amp;gt;Daily.%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.FanartCode|2=&amp;lt;code&amp;gt;Daily.%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.WindSpeed|2=&amp;lt;code&amp;gt;Daily.%i.WindSpeed&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind speed with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.WindDirection|2=&amp;lt;code&amp;gt;Daily.%i.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction as a label, e.g. NW|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.Precipitation|2=&amp;lt;code&amp;gt;Daily.%i.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those parameters are not localized autmatically so it&#039;s addon&#039;s responsibility&lt;br /&gt;
to localize them properly. Daily items are 1-indexed, that is, they start from 1.&lt;br /&gt;
&lt;br /&gt;
=== Additional Weather Properties ===&lt;br /&gt;
&lt;br /&gt;
Some skins, e.g. aeon.nox.silvo, may use the following properties (up to 7 days):&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Day%i.Title|2=&amp;lt;code&amp;gt;Day%i.Title&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=day of the week|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.HighTemp|2=&amp;lt;code&amp;gt;Day%i.HighTemp&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=high temperature for the day, in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.LowTemp|2=&amp;lt;code&amp;gt;Day%i.LowTemp&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=low temperature of the day, in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.Outlook|2=&amp;lt;code&amp;gt;Day%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the weather forecast|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.OutlookIcon|2=&amp;lt;code&amp;gt;Day%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon, as a filename|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.FanartCode|2=&amp;lt;code&amp;gt;Day%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those properties are 0-indexed.&lt;br /&gt;
&lt;br /&gt;
=== General Properties ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Location|2=&amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=location name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Location|2=&amp;lt;code&amp;gt;Current.Location&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=location name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=WeatherProvider|2=&amp;lt;code&amp;gt;WeatherProvider&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather addon name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=WeatherProviderLogo|2=&amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=path to the addon logo file, preferrabely in a banner format|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Weather.IsFetched|2=&amp;lt;code&amp;gt;Weather.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.IsFetched|2=&amp;lt;code&amp;gt;Current.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if current weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.IsFetched|2=&amp;lt;code&amp;gt;Hourly.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if hourly weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.IsFetched|2=&amp;lt;code&amp;gt;Daily.IsFetched &amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if daily weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The name of the window property set by the weather addon and the resulting window property for the skin will differ in a few scenarios:&lt;br /&gt;
* Current.OutlookIcon (addon) -&amp;gt; Current.ConditionIcon (skin)&lt;br /&gt;
* Current.Wind (addon) -&amp;gt; Current.WindSpeed (skin)&lt;br /&gt;
* Current.Wind / Current.WindDirection (addon) -&amp;gt; Current.Wind (skin)&lt;br /&gt;
Kodi combines the Wind and WindDirection properties into a Wind property with this format: &#039;From &amp;lt;wind dir&amp;gt; at &amp;lt;speed&amp;gt; &amp;lt;unit&amp;gt;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, several window properties set by the addon will be made available to the skin as infolabels:&lt;br /&gt;
* Current.Condition (addon) -&amp;gt; Weather.Conditions (skin)&lt;br /&gt;
* Current.Temperature (addon) -&amp;gt; Weather.Temperature (skin)&lt;br /&gt;
* Current.FanartCode (addon) -&amp;gt; Weather.FanartCode (skin)&lt;br /&gt;
&lt;br /&gt;
Finally, at the end of your script, you need to set the following window properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Location%i (the name of each weather location that has been configured by the user. for locations that are not configured, set an empty property.)&lt;br /&gt;
* Locations (the total number of locations that have been set up by the user. don&#039;t count the ones that have not been configured!)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the addon has finished, Kodi will make one additional infolabel available to the skin:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Weather.Location (the name of the current weather location)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The name of the weather addon, can be displayed by the skin using:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Weather.Plugin (the name of the weather addon)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Advanced weather info (optional)=&lt;br /&gt;
Besides the weather infolabels mentioned above, your addon can return many more, basically there are no limits.&lt;br /&gt;
Keep in mind though, that it requires skin support to display this additional information in Kodi.&lt;br /&gt;
&lt;br /&gt;
If you want to go this route, have a look at the infolabels provided by the Openweathermap and Wunderground addons:&amp;lt;br /&amp;gt;&lt;br /&gt;
* https://github.com/xbmc/repo-scripts/blob/krypton/weather.openweathermap.extended/README.txt&amp;lt;br /&amp;gt;&lt;br /&gt;
* https://github.com/xbmc/repo-scripts/blob/jarvis/weather.wunderground/README.txt&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The infolabels provided by those addons are reasonably well supported by a number of skins already,&lt;br /&gt;
so try if you can use the same infolabel names in your addon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Weather Codes=&lt;br /&gt;
Kodi ships with an icon pack that includes an icon for each weather condition.&amp;lt;br /&amp;gt;&lt;br /&gt;
(https://github.com/xbmc/xbmc/tree/master/addons/resource.images.weathericons.default)&amp;lt;br /&amp;gt;&lt;br /&gt;
Several additional weather icon packs are available through the official Kodi repository.&lt;br /&gt;
&lt;br /&gt;
The following condition-code table is used for the icon names:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 	tornado&lt;br /&gt;
1 	tropical storm&lt;br /&gt;
2 	hurricane&lt;br /&gt;
3 	severe thunderstorms&lt;br /&gt;
4 	thunderstorms&lt;br /&gt;
5 	mixed rain and snow&lt;br /&gt;
6 	mixed rain and sleet&lt;br /&gt;
7 	mixed snow and sleet&lt;br /&gt;
8 	freezing drizzle&lt;br /&gt;
9 	drizzle&lt;br /&gt;
10 	freezing rain&lt;br /&gt;
11 	showers&lt;br /&gt;
12 	showers&lt;br /&gt;
13 	snow flurries&lt;br /&gt;
14 	light snow showers&lt;br /&gt;
15 	blowing snow&lt;br /&gt;
16 	snow&lt;br /&gt;
17 	hail&lt;br /&gt;
18 	sleet&lt;br /&gt;
19 	dust&lt;br /&gt;
20 	foggy&lt;br /&gt;
21 	haze&lt;br /&gt;
22 	smoky&lt;br /&gt;
23 	blustery&lt;br /&gt;
24 	windy&lt;br /&gt;
25 	cold&lt;br /&gt;
26 	cloudy&lt;br /&gt;
27 	mostly cloudy (night)&lt;br /&gt;
28 	mostly cloudy (day)&lt;br /&gt;
29 	partly cloudy (night)&lt;br /&gt;
30 	partly cloudy (day)&lt;br /&gt;
31 	clear (night)&lt;br /&gt;
32 	sunny&lt;br /&gt;
33 	fair (night)&lt;br /&gt;
34 	fair (day)&lt;br /&gt;
35 	mixed rain and hail&lt;br /&gt;
36 	hot&lt;br /&gt;
37 	isolated thunderstorms&lt;br /&gt;
38 	scattered thunderstorms&lt;br /&gt;
39 	scattered thunderstorms&lt;br /&gt;
40 	scattered showers&lt;br /&gt;
41 	heavy snow&lt;br /&gt;
42 	scattered snow showers&lt;br /&gt;
43 	heavy snow&lt;br /&gt;
44 	partly cloudy&lt;br /&gt;
45 	thundershowers&lt;br /&gt;
46 	snow showers&lt;br /&gt;
47 	isolated thundershowers&lt;br /&gt;
na 	not available&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-on_development]]&lt;/div&gt;</summary>
		<author><name>Roman VM</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Weather_addons&amp;diff=253675</id>
		<title>Weather addons</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Weather_addons&amp;diff=253675"/>
		<updated>2024-10-28T12:15:59Z</updated>

		<summary type="html">&lt;p&gt;Roman VM: minor update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Main|Weather}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|This page describes the development of Weather addons for Kodi. If you&#039;re interested in them from a user&#039;s perspective (where to get them, how to configure them, etc.), please use the link above.}}&lt;br /&gt;
&lt;br /&gt;
== addon.xml ==&lt;br /&gt;
Weather addons use the &#039;xbmc.python.weather&#039; extension point.&lt;br /&gt;
The basic layout of the addon.xml of a weather addon will look like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; line highlight=&amp;quot;6&amp;quot; style=&amp;quot;white-space: pre-wrap;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;weather.name&amp;quot; name=&amp;quot;My Weather&amp;quot; version=&amp;quot;1.2.3&amp;quot; provider-name=&amp;quot;me&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;requires&amp;gt;&lt;br /&gt;
		&amp;lt;import addon=&amp;quot;xbmc.python&amp;quot; version=&amp;quot;3.0.0&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/requires&amp;gt;&lt;br /&gt;
	&amp;lt;extension point=&amp;quot;xbmc.python.weather&amp;quot; library=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;summary lang=&amp;quot;en_GB&amp;quot;&amp;gt;&amp;lt;/summary&amp;gt;&lt;br /&gt;
		&amp;lt;description lang=&amp;quot;en_GB&amp;quot;&amp;gt;&amp;lt;/description&amp;gt;&lt;br /&gt;
		&amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;platform&amp;gt;&amp;lt;/platform&amp;gt;&lt;br /&gt;
		&amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
		&amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
		&amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
		&amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
		&amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
	&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Things to know ==&lt;br /&gt;
There are a few things (quirks) you need to be aware of when creating a weather addon...&lt;br /&gt;
* A weather addon will be run automatically when the skins asks to display one of these weather-specific infolabels:&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Conditions&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Temperature&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Location&amp;lt;/code&amp;gt;&lt;br /&gt;
* The weather addon will run at 30 minute intervals (as long the current skin window displays one of the above-mentioned infolabels)&lt;br /&gt;
* In the weather window, Kodi will automatically try to translate all the weather strings&lt;br /&gt;
* Kodi will also handle transformations between units (for instance, Celsius to Fahrenheit, km/h to mph)&lt;br /&gt;
&lt;br /&gt;
== Theory of operation ==&lt;br /&gt;
Kodi can run a weather addon in two modes:&lt;br /&gt;
&lt;br /&gt;
=== Weather location configuration ===&lt;br /&gt;
In order to set up a weather addon, you need to include a settings.xml file for your weather addon. It needs to have this structure:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; style=&amp;quot;white-space: pre-wrap;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section id=&amp;quot;weather.name&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;category id=&amp;quot;locations&amp;quot; label=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;group id=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location1&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location1)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location2&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;32003&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location2)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
          &amp;lt;dependencies&amp;gt;&lt;br /&gt;
            &amp;lt;dependency type=&amp;quot;enable&amp;quot; operator=&amp;quot;!is&amp;quot; setting=&amp;quot;location1&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/dependencies&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location3&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;32004&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location3)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
          &amp;lt;dependencies&amp;gt;&lt;br /&gt;
            &amp;lt;dependency type=&amp;quot;enable&amp;quot; operator=&amp;quot;!is&amp;quot; setting=&amp;quot;location2&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/dependencies&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
      &amp;lt;/group&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can define as many weather locations as you want in your settings.xml file.&lt;br /&gt;
&lt;br /&gt;
When you&#039;re going to set up a location in the weather addon settings, Kodi will pass the argument(s) you&#039;ve defined in the RunScript() action above to your addon. For instance, if you set the &#039;Location 2&#039; entry active in the Weather settings, Kodi will pass &#039;Loc2&#039; to your addon.&lt;br /&gt;
&lt;br /&gt;
=== Retrieving weather data ===&lt;br /&gt;
When weather information needs to be retrieved, Kodi will pass the location number to your addon. For instance, if the weather for Location 4 is requested, Kodi will pass &#039;4&#039; to the weather addon.&lt;br /&gt;
&lt;br /&gt;
=== Required output ===&lt;br /&gt;
When a weather addon is asked to retrieve weather information, it needs to return this info to Kodi. This is done by making the various pieces of information available as window properties of the weather window.&lt;br /&gt;
&lt;br /&gt;
The basic python code needed to provide a window property:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
WINDOW = xbmcgui.Window(12600)&lt;br /&gt;
WINDOW.setProperty(name, value)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Kodi expects a weather addon to return these properties:&lt;br /&gt;
&lt;br /&gt;
=== Current Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Current.Condition|2=&amp;lt;code&amp;gt;Current.Condition&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the weather condition as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Temperature|2=&amp;lt;code&amp;gt;Current.Temperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=temperature in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Wind|2=&amp;lt;code&amp;gt;Current.Wind&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=windspeed in km/h|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.WindDirection|2=&amp;lt;code&amp;gt;Current.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction, NNE|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Humidity|2=&amp;lt;code&amp;gt;Current.Humidity&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=relative humidity as a percentage|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.FeelsLike|2=&amp;lt;code&amp;gt;Current.FeelsLike&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=feels-like temperature in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.UVIndex|2=&amp;lt;code&amp;gt;Current.UVIndex&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the UV-index as an integer|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.DewPoint|2=&amp;lt;code&amp;gt;Current.DewPoint&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=dewpoint in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Precipitation|2=&amp;lt;code&amp;gt;Current.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Cloudiness|2=&amp;lt;code&amp;gt;Current.Cloudiness&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=cloud cover in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.OutlookIcon|2=&amp;lt;code&amp;gt;Current.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon, as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.FanartCode|2=&amp;lt;code&amp;gt;Current.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Kodi will read those window properties and do unit conversions if needed, depending on the regional settings in Kodi.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hourly Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Hourly.%i.Time|2=&amp;lt;code&amp;gt;Hourly.%i.Time&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=hour time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.LongDate|2=&amp;lt;code&amp;gt;Hourly.%i.LongDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=long date and time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.ShortDate|2=&amp;lt;code&amp;gt;Hourly.%i.ShortDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short date and time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Outlook|2=&amp;lt;code&amp;gt;Hourly.%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.OutlookIcon|2=&amp;lt;code&amp;gt;Hourly.%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.FanartCode|2=&amp;lt;code&amp;gt;Hourly.%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.WindSpeed|2=&amp;lt;code&amp;gt;Hourly.%i.WindSpeed&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind speed with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.WindDirection|2=&amp;lt;code&amp;gt;Hourly.%i.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction as a label, e.g. NW|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Humidity|2=&amp;lt;code&amp;gt;Hourly.%i.Humidity&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=humidity in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Temperature|2=&amp;lt;code&amp;gt;Hourly.%i.Temperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.DewPoint|2=&amp;lt;code&amp;gt;Hourly.%i.DewPoint&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=dew point as temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.FeelsLike|2=&amp;lt;code&amp;gt;Hourly.%i.FeelsLike&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=apparent temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Pressure|2=&amp;lt;code&amp;gt;Hourly.%i.Pressure&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=pressure with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Precipitation|2=&amp;lt;code&amp;gt;Hourly.%i.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those parameters are not localized autmatically so it&#039;s addon&#039;s responsibility&lt;br /&gt;
to localize them properly. Hourly items are 1-indexed, that is, they start from 1.&lt;br /&gt;
&lt;br /&gt;
=== Daily Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Term|1=Daily.%i.ShortDate|2=&amp;lt;code&amp;gt;Daily.%i.ShortDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short date|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.ShortDay|2=&amp;lt;code&amp;gt;Daily.%i.ShortDay&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short day label, e.g. Mon|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.HighTemperature|2=&amp;lt;code&amp;gt;Daily.%i.HighTemperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=high temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.LowTemperature|2=&amp;lt;code&amp;gt;Daily.%i.LowTemperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=low temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.Outlook|2=&amp;lt;code&amp;gt;Daily.%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.OutlookIcon|2=&amp;lt;code&amp;gt;Daily.%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.FanartCode|2=&amp;lt;code&amp;gt;Daily.%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.WindSpeed|2=&amp;lt;code&amp;gt;Daily.%i.WindSpeed&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind speed with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.WindDirection|2=&amp;lt;code&amp;gt;Daily.%i.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction as a label, e.g. NW|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.Precipitation|2=&amp;lt;code&amp;gt;Daily.%i.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those parameters are not localized autmatically so it&#039;s addon&#039;s responsibility&lt;br /&gt;
to localize them properly. Daily items are 1-indexed, that is, they start from 1.&lt;br /&gt;
&lt;br /&gt;
=== Additional Weather Properties ===&lt;br /&gt;
&lt;br /&gt;
Some skins, e.g. aeon.nox.silvo, may use the following properties (up to 7 days):&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Day%i.Title|2=&amp;lt;code&amp;gt;Day%i.Title&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=day of the week|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.HighTemp|2=&amp;lt;code&amp;gt;Day%i.HighTemp&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=high temperature for the day, in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.LowTemp|2=&amp;lt;code&amp;gt;Day%i.LowTemp&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=low temperature of the day, in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.Outlook|2=&amp;lt;code&amp;gt;Day%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the weather forecast|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.OutlookIcon|2=&amp;lt;code&amp;gt;Day%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon, as a filename|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.FanartCode|2=&amp;lt;code&amp;gt;Day%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those properties are 0-indexed.&lt;br /&gt;
&lt;br /&gt;
=== General Properties ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Location|2=&amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=location name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Location|2=&amp;lt;code&amp;gt;Current.Location&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=location name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=WeatherProvider|2=&amp;lt;code&amp;gt;WeatherProvider&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather addon name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=WeatherProviderLogo|2=&amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=path to the addon logo file, preferrabely in a banner format|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Weather.IsFetched|2=&amp;lt;code&amp;gt;Weather.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.IsFetched|2=&amp;lt;code&amp;gt;Current.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if current weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.IsFetched|2=&amp;lt;code&amp;gt;Hourly.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if hourly weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.IsFetched|2=&amp;lt;code&amp;gt;Daily.IsFetched &amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if daily weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The name of the window property set by the weather addon and the resulting window property for the skin will differ in a few scenarios:&lt;br /&gt;
* Current.OutlookIcon (addon) -&amp;gt; Current.ConditionIcon (skin)&lt;br /&gt;
* Current.Wind (addon) -&amp;gt; Current.WindSpeed (skin)&lt;br /&gt;
* Current.Wind / Current.WindDirection (addon) -&amp;gt; Current.Wind (skin)&lt;br /&gt;
Kodi combines the Wind and WindDirection properties into a Wind property with this format: &#039;From &amp;lt;wind dir&amp;gt; at &amp;lt;speed&amp;gt; &amp;lt;unit&amp;gt;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, several window properties set by the addon will be made available to the skin as infolabels:&lt;br /&gt;
* Current.Condition (addon) -&amp;gt; Weather.Conditions (skin)&lt;br /&gt;
* Current.Temperature (addon) -&amp;gt; Weather.Temperature (skin)&lt;br /&gt;
* Current.FanartCode (addon) -&amp;gt; Weather.FanartCode (skin)&lt;br /&gt;
&lt;br /&gt;
Finally, at the end of your script, you need to set the following window properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Location%i (the name of each weather location that has been configured by the user. for locations that are not configured, set an empty property.)&lt;br /&gt;
* Locations (the total number of locations that have been set up by the user. don&#039;t count the ones that have not been configured!)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the addon has finished, Kodi will make one additional infolabel available to the skin:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Weather.Location (the name of the current weather location)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The name of the weather addon, can be displayed by the skin using:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Weather.Plugin (the name of the weather addon)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Advanced weather info (optional)=&lt;br /&gt;
Besides the weather infolabels mentioned above, your addon can return many more, basically there are no limits.&lt;br /&gt;
Keep in mind though, that it requires skin support to display this additional information in Kodi.&lt;br /&gt;
&lt;br /&gt;
If you want to go this route, have a look at the infolabels provided by the Openweathermap and Wunderground addons:&amp;lt;br /&amp;gt;&lt;br /&gt;
* https://github.com/xbmc/repo-scripts/blob/krypton/weather.openweathermap.extended/README.txt&amp;lt;br /&amp;gt;&lt;br /&gt;
* https://github.com/xbmc/repo-scripts/blob/jarvis/weather.wunderground/README.txt&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The infolabels provided by those addons are reasonably well supported by a number of skins already,&lt;br /&gt;
so try if you can use the same infolabel names in your addon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Weather Codes=&lt;br /&gt;
Kodi ships with an icon pack that includes an icon for each weather condition.&amp;lt;br /&amp;gt;&lt;br /&gt;
(https://github.com/xbmc/xbmc/tree/master/addons/resource.images.weathericons.default)&amp;lt;br /&amp;gt;&lt;br /&gt;
Several additional weather icon packs are available through the official Kodi repository.&lt;br /&gt;
&lt;br /&gt;
The following condition-code table is used for the icon names:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 	tornado&lt;br /&gt;
1 	tropical storm&lt;br /&gt;
2 	hurricane&lt;br /&gt;
3 	severe thunderstorms&lt;br /&gt;
4 	thunderstorms&lt;br /&gt;
5 	mixed rain and snow&lt;br /&gt;
6 	mixed rain and sleet&lt;br /&gt;
7 	mixed snow and sleet&lt;br /&gt;
8 	freezing drizzle&lt;br /&gt;
9 	drizzle&lt;br /&gt;
10 	freezing rain&lt;br /&gt;
11 	showers&lt;br /&gt;
12 	showers&lt;br /&gt;
13 	snow flurries&lt;br /&gt;
14 	light snow showers&lt;br /&gt;
15 	blowing snow&lt;br /&gt;
16 	snow&lt;br /&gt;
17 	hail&lt;br /&gt;
18 	sleet&lt;br /&gt;
19 	dust&lt;br /&gt;
20 	foggy&lt;br /&gt;
21 	haze&lt;br /&gt;
22 	smoky&lt;br /&gt;
23 	blustery&lt;br /&gt;
24 	windy&lt;br /&gt;
25 	cold&lt;br /&gt;
26 	cloudy&lt;br /&gt;
27 	mostly cloudy (night)&lt;br /&gt;
28 	mostly cloudy (day)&lt;br /&gt;
29 	partly cloudy (night)&lt;br /&gt;
30 	partly cloudy (day)&lt;br /&gt;
31 	clear (night)&lt;br /&gt;
32 	sunny&lt;br /&gt;
33 	fair (night)&lt;br /&gt;
34 	fair (day)&lt;br /&gt;
35 	mixed rain and hail&lt;br /&gt;
36 	hot&lt;br /&gt;
37 	isolated thunderstorms&lt;br /&gt;
38 	scattered thunderstorms&lt;br /&gt;
39 	scattered thunderstorms&lt;br /&gt;
40 	scattered showers&lt;br /&gt;
41 	heavy snow&lt;br /&gt;
42 	scattered snow showers&lt;br /&gt;
43 	heavy snow&lt;br /&gt;
44 	partly cloudy&lt;br /&gt;
45 	thundershowers&lt;br /&gt;
46 	snow showers&lt;br /&gt;
47 	isolated thundershowers&lt;br /&gt;
na 	not available&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-on_development]]&lt;/div&gt;</summary>
		<author><name>Roman VM</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Weather_addons&amp;diff=253674</id>
		<title>Weather addons</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Weather_addons&amp;diff=253674"/>
		<updated>2024-10-28T12:08:26Z</updated>

		<summary type="html">&lt;p&gt;Roman VM: Add the current info about weather addon development&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Main|Weather}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|This page describes the development of Weather addons for Kodi. If you&#039;re interested in them from a user&#039;s perspective (where to get them, how to configure them, etc.), please use the link above.}}&lt;br /&gt;
&lt;br /&gt;
== addon.xml ==&lt;br /&gt;
Weather addons use the &#039;xbmc.python.weather&#039; extension point.&lt;br /&gt;
The basic layout of the addon.xml of a weather addon will look like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; line highlight=&amp;quot;6&amp;quot; style=&amp;quot;white-space: pre-wrap;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;addon id=&amp;quot;weather.name&amp;quot; name=&amp;quot;My Weather&amp;quot; version=&amp;quot;1.2.3&amp;quot; provider-name=&amp;quot;me&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;requires&amp;gt;&lt;br /&gt;
		&amp;lt;import addon=&amp;quot;xbmc.python&amp;quot; version=&amp;quot;3.0.0&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/requires&amp;gt;&lt;br /&gt;
	&amp;lt;extension point=&amp;quot;xbmc.python.weather&amp;quot; library=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;extension point=&amp;quot;xbmc.addon.metadata&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;summary lang=&amp;quot;en_GB&amp;quot;&amp;gt;&amp;lt;/summary&amp;gt;&lt;br /&gt;
		&amp;lt;description lang=&amp;quot;en_GB&amp;quot;&amp;gt;&amp;lt;/description&amp;gt;&lt;br /&gt;
		&amp;lt;language&amp;gt;&amp;lt;/language&amp;gt;&lt;br /&gt;
		&amp;lt;platform&amp;gt;&amp;lt;/platform&amp;gt;&lt;br /&gt;
		&amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
		&amp;lt;forum&amp;gt;&amp;lt;/forum&amp;gt;&lt;br /&gt;
		&amp;lt;website&amp;gt;&amp;lt;/website&amp;gt;&lt;br /&gt;
		&amp;lt;email&amp;gt;&amp;lt;/email&amp;gt;&lt;br /&gt;
		&amp;lt;source&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
	&amp;lt;/extension&amp;gt;&lt;br /&gt;
&amp;lt;/addon&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Things to know ==&lt;br /&gt;
There are a few things (quirks) you need to be aware of when creating a weather addon...&lt;br /&gt;
* A weather addon will be run automatically when the skins asks to display one of these weather-specific infolabels:&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Conditions&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Temperature&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;Weather.Location&amp;lt;/code&amp;gt;&lt;br /&gt;
* The weather addon will run at 30 minute intervals (as long the current skin window displays one of the above-mentioned infolabels)&lt;br /&gt;
* In the weather window, Kodi will automatically try to translate all the weather strings&lt;br /&gt;
* Kodi will also handle transformations between units (for instance, Celsius to Fahrenheit, km/h to mph)&lt;br /&gt;
&lt;br /&gt;
== Theory of operation ==&lt;br /&gt;
Kodi can run a weather addon in two modes:&lt;br /&gt;
&lt;br /&gt;
=== Weather location configuration ===&lt;br /&gt;
In order to set up a weather addon, you need to include a settings.xml file for your weather addon. It needs to have this structure:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; style=&amp;quot;white-space: pre-wrap;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;settings version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section id=&amp;quot;weather.name&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;category id=&amp;quot;locations&amp;quot; label=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;group id=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location1&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location1)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location2&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;32003&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location2)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
          &amp;lt;dependencies&amp;gt;&lt;br /&gt;
            &amp;lt;dependency type=&amp;quot;enable&amp;quot; operator=&amp;quot;!is&amp;quot; setting=&amp;quot;location1&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/dependencies&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
        &amp;lt;setting id=&amp;quot;location3&amp;quot; type=&amp;quot;string&amp;quot; label=&amp;quot;32004&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;level&amp;gt;0&amp;lt;/level&amp;gt;&lt;br /&gt;
          &amp;lt;default/&amp;gt;&lt;br /&gt;
          &amp;lt;constraints&amp;gt;&lt;br /&gt;
              &amp;lt;allowempty&amp;gt;true&amp;lt;/allowempty&amp;gt;&lt;br /&gt;
          &amp;lt;/constraints&amp;gt;&lt;br /&gt;
          &amp;lt;control type=&amp;quot;button&amp;quot; format=&amp;quot;action&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;data&amp;gt;RunScript(weather.name,location3)&amp;lt;/data&amp;gt;&lt;br /&gt;
          &amp;lt;/control&amp;gt;&lt;br /&gt;
          &amp;lt;dependencies&amp;gt;&lt;br /&gt;
            &amp;lt;dependency type=&amp;quot;enable&amp;quot; operator=&amp;quot;!is&amp;quot; setting=&amp;quot;location2&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/dependencies&amp;gt;&lt;br /&gt;
        &amp;lt;/setting&amp;gt;&lt;br /&gt;
      &amp;lt;/group&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can define as many weather locations as you want in your settings.xml file.&lt;br /&gt;
&lt;br /&gt;
When you&#039;re going to set up a location in the weather addon settings, Kodi will pass the argument(s) you&#039;ve defined in the RunScript() action above to your addon. For instance, if you set the &#039;Location 2&#039; entry active in the Weather settings, Kodi will pass &#039;Loc2&#039; to your addon.&lt;br /&gt;
&lt;br /&gt;
=== Retrieving weather data ===&lt;br /&gt;
When weather information needs to be retrieved, Kodi will pass the location number to your addon. For instance, if the weather for Location 4 is requested, Kodi will pass &#039;4&#039; to the weather addon.&lt;br /&gt;
&lt;br /&gt;
=== Required output ===&lt;br /&gt;
When a weather addon is asked to retrieve weather information, it needs to return this info to Kodi. This is done by making the various pieces of information available as window properties of the weather window.&lt;br /&gt;
&lt;br /&gt;
The basic python code needed to provide a window property:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
WINDOW = xbmcgui.Window(12600)&lt;br /&gt;
WINDOW.setProperty(name, value)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Kodi expects a weather addon to return these properties:&lt;br /&gt;
&lt;br /&gt;
=== Current Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Current.Condition|2=&amp;lt;code&amp;gt;Current.Condition&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the weather condition as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Temperature|2=&amp;lt;code&amp;gt;Current.Temperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=temperature in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Wind|2=&amp;lt;code&amp;gt;Current.Wind&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=windspeed in km/h|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.WindDirection|2=&amp;lt;code&amp;gt;Current.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction, NNE|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Humidity|2=&amp;lt;code&amp;gt;Current.Humidity&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=relative humidity as a percentage|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.FeelsLike|2=&amp;lt;code&amp;gt;Current.FeelsLike&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=feels-like temperature in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.UVIndex|2=&amp;lt;code&amp;gt;Current.UVIndex&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the UV-index as an integer|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.DewPoint|2=&amp;lt;code&amp;gt;Current.DewPoint&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=dewpoint in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Precipitation|2=&amp;lt;code&amp;gt;Current.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Cloudiness|2=&amp;lt;code&amp;gt;Current.Cloudiness&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=cloud cover in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.OutlookIcon|2=&amp;lt;code&amp;gt;Current.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon, as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.FanartCode|2=&amp;lt;code&amp;gt;Current.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Kodi will read those window properties and do unit conversions if needed, depending on the regional settings in Kodi.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hourly Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Hourly.%i.Time|2=&amp;lt;code&amp;gt;Hourly.%i.Time&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=hour time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.LongDate|2=&amp;lt;code&amp;gt;Hourly.%i.LongDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=long date and time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.ShortDate|2=&amp;lt;code&amp;gt;Hourly.%i.ShortDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short date and time|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Outlook|2=&amp;lt;code&amp;gt;Hourly.%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.OutlookIcon|2=&amp;lt;code&amp;gt;Hourly.%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.FanartCode|2=&amp;lt;code&amp;gt;Hourly.%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.WindSpeed|2=&amp;lt;code&amp;gt;Hourly.%i.WindSpeed&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind speed with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.WindDirection|2=&amp;lt;code&amp;gt;Hourly.%i.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction as a label, e.g. NW|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Humidity|2=&amp;lt;code&amp;gt;Hourly.%i.Humidity&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=humidity in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Temperature|2=&amp;lt;code&amp;gt;Hourly.%i.Temperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.DewPoint|2=&amp;lt;code&amp;gt;Hourly.%i.DewPoint&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=dew point as temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.FeelsLike|2=&amp;lt;code&amp;gt;Hourly.%i.FeelsLike&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=apparent temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Pressure|2=&amp;lt;code&amp;gt;Hourly.%i.Pressure&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=pressure with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.%i.Precipitation|2=&amp;lt;code&amp;gt;Hourly.%i.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those parameters are not localized autmatically so it&#039;s addon&#039;s responsibility&lt;br /&gt;
to localize them properly. Hourly items are 1-indexed, that is, they start from 1.&lt;br /&gt;
&lt;br /&gt;
=== Daily Weather ===&lt;br /&gt;
&lt;br /&gt;
{{Term|1=Daily.%i.ShortDate|2=&amp;lt;code&amp;gt;Daily.%i.ShortDate&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short date|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.ShortDay|2=&amp;lt;code&amp;gt;Daily.%i.ShortDay&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=short day label, e.g. Mon|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.HighTemperature|2=&amp;lt;code&amp;gt;Daily.%i.HighTemperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=high temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.LowTemperature|2=&amp;lt;code&amp;gt;Daily.%i.LowTemperature&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=low temperature with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.Outlook|2=&amp;lt;code&amp;gt;Daily.%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.OutlookIcon|2=&amp;lt;code&amp;gt;Daily.%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon as a filename (e.g. 34.png)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.FanartCode|2=&amp;lt;code&amp;gt;Daily.%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=condition code, as an integer (see Weather Codes section below)|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.WindSpeed|2=&amp;lt;code&amp;gt;Daily.%i.WindSpeed&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind speed with a unit|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.WindDirection|2=&amp;lt;code&amp;gt;Daily.%i.WindDirection&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=wind direction as a label, e.g. NW|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.%i.Precipitation|2=&amp;lt;code&amp;gt;Daily.%i.Precipitation&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=precipitation probability in %|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those parameters are not localized autmatically so it&#039;s addon&#039;s responsibility&lt;br /&gt;
to localize them properly. Daily items are 1-indexed, that is, they start from 1.&lt;br /&gt;
&lt;br /&gt;
=== Additional Weather Properties ===&lt;br /&gt;
&lt;br /&gt;
Some skins, e.g. aeon.nox.silvo, may use the following properties:&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Day%i.Title|2=&amp;lt;code&amp;gt;Day%i.Title&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=day of the week|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.HighTemp|2=&amp;lt;code&amp;gt;Day%i.HighTemp&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=high temperature for the day, in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.LowTemp|2=&amp;lt;code&amp;gt;Day%i.LowTemp&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=low temperature of the day, in degrees Celsius|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.Outlook|2=&amp;lt;code&amp;gt;Day%i.Outlook&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=the weather forecast|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.OutlookIcon|2=&amp;lt;code&amp;gt;Day%i.OutlookIcon&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather icon, as a filename|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Day%i.FanartCode|2=&amp;lt;code&amp;gt;Day%i.FanartCode&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather forecast as a string|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
Note that those properties are 0-indexed.&lt;br /&gt;
&lt;br /&gt;
=== General Properties ===&lt;br /&gt;
&lt;br /&gt;
{{Glossary}}&lt;br /&gt;
{{Term|1=Location|2=&amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=location name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.Location|2=&amp;lt;code&amp;gt;Current.Location&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=location name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=WeatherProvider|2=&amp;lt;code&amp;gt;WeatherProvider&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=weather addon name|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=WeatherProviderLogo|2=&amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=path to the addon logo file, preferrabely in a banner format|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Weather.IsFetched|2=&amp;lt;code&amp;gt;Weather.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Current.IsFetched|2=&amp;lt;code&amp;gt;Current.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if current weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Hourly.IsFetched|2=&amp;lt;code&amp;gt;Hourly.IsFetched&amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if hourly weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Term|1=Daily.IsFetched|2=&amp;lt;code&amp;gt;Daily.IsFetched &amp;lt;/code&amp;gt;}}&lt;br /&gt;
{{Defn|1=true if daily weather info is fetched|style=margin-left: 4em;}}&lt;br /&gt;
{{Glossary end}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The name of the window property set by the weather addon and the resulting window property for the skin will differ in a few scenarios:&lt;br /&gt;
* Current.OutlookIcon (addon) -&amp;gt; Current.ConditionIcon (skin)&lt;br /&gt;
* Current.Wind (addon) -&amp;gt; Current.WindSpeed (skin)&lt;br /&gt;
* Current.Wind / Current.WindDirection (addon) -&amp;gt; Current.Wind (skin)&lt;br /&gt;
Kodi combines the Wind and WindDirection properties into a Wind property with this format: &#039;From &amp;lt;wind dir&amp;gt; at &amp;lt;speed&amp;gt; &amp;lt;unit&amp;gt;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, several window properties set by the addon will be made available to the skin as infolabels:&lt;br /&gt;
* Current.Condition (addon) -&amp;gt; Weather.Conditions (skin)&lt;br /&gt;
* Current.Temperature (addon) -&amp;gt; Weather.Temperature (skin)&lt;br /&gt;
* Current.FanartCode (addon) -&amp;gt; Weather.FanartCode (skin)&lt;br /&gt;
&lt;br /&gt;
Finally, at the end of your script, you need to set the following window properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Location%i (the name of each weather location that has been configured by the user. for locations that are not configured, set an empty property.)&lt;br /&gt;
* Locations (the total number of locations that have been set up by the user. don&#039;t count the ones that have not been configured!)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the addon has finished, Kodi will make one additional infolabel available to the skin:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Weather.Location (the name of the current weather location)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The name of the weather addon, can be displayed by the skin using:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Weather.Plugin (the name of the weather addon)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Advanced weather info (optional)=&lt;br /&gt;
Besides the weather infolabels mentioned above, your addon can return many more, basically there are no limits.&lt;br /&gt;
Keep in mind though, that it requires skin support to display this additional information in Kodi.&lt;br /&gt;
&lt;br /&gt;
If you want to go this route, have a look at the infolabels provided by the Openweathermap and Wunderground addons:&amp;lt;br /&amp;gt;&lt;br /&gt;
* https://github.com/xbmc/repo-scripts/blob/krypton/weather.openweathermap.extended/README.txt&amp;lt;br /&amp;gt;&lt;br /&gt;
* https://github.com/xbmc/repo-scripts/blob/jarvis/weather.wunderground/README.txt&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The infolabels provided by those addons are reasonably well supported by a number of skins already,&lt;br /&gt;
so try if you can use the same infolabel names in your addon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Weather Codes=&lt;br /&gt;
Kodi ships with an icon pack that includes an icon for each weather condition.&amp;lt;br /&amp;gt;&lt;br /&gt;
(https://github.com/xbmc/xbmc/tree/master/addons/resource.images.weathericons.default)&amp;lt;br /&amp;gt;&lt;br /&gt;
Several additional weather icon packs are available through the official Kodi repository.&lt;br /&gt;
&lt;br /&gt;
The following condition-code table is used for the icon names:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 	tornado&lt;br /&gt;
1 	tropical storm&lt;br /&gt;
2 	hurricane&lt;br /&gt;
3 	severe thunderstorms&lt;br /&gt;
4 	thunderstorms&lt;br /&gt;
5 	mixed rain and snow&lt;br /&gt;
6 	mixed rain and sleet&lt;br /&gt;
7 	mixed snow and sleet&lt;br /&gt;
8 	freezing drizzle&lt;br /&gt;
9 	drizzle&lt;br /&gt;
10 	freezing rain&lt;br /&gt;
11 	showers&lt;br /&gt;
12 	showers&lt;br /&gt;
13 	snow flurries&lt;br /&gt;
14 	light snow showers&lt;br /&gt;
15 	blowing snow&lt;br /&gt;
16 	snow&lt;br /&gt;
17 	hail&lt;br /&gt;
18 	sleet&lt;br /&gt;
19 	dust&lt;br /&gt;
20 	foggy&lt;br /&gt;
21 	haze&lt;br /&gt;
22 	smoky&lt;br /&gt;
23 	blustery&lt;br /&gt;
24 	windy&lt;br /&gt;
25 	cold&lt;br /&gt;
26 	cloudy&lt;br /&gt;
27 	mostly cloudy (night)&lt;br /&gt;
28 	mostly cloudy (day)&lt;br /&gt;
29 	partly cloudy (night)&lt;br /&gt;
30 	partly cloudy (day)&lt;br /&gt;
31 	clear (night)&lt;br /&gt;
32 	sunny&lt;br /&gt;
33 	fair (night)&lt;br /&gt;
34 	fair (day)&lt;br /&gt;
35 	mixed rain and hail&lt;br /&gt;
36 	hot&lt;br /&gt;
37 	isolated thunderstorms&lt;br /&gt;
38 	scattered thunderstorms&lt;br /&gt;
39 	scattered thunderstorms&lt;br /&gt;
40 	scattered showers&lt;br /&gt;
41 	heavy snow&lt;br /&gt;
42 	scattered snow showers&lt;br /&gt;
43 	heavy snow&lt;br /&gt;
44 	partly cloudy&lt;br /&gt;
45 	thundershowers&lt;br /&gt;
46 	snow showers&lt;br /&gt;
47 	isolated thundershowers&lt;br /&gt;
na 	not available&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-on_development]]&lt;/div&gt;</summary>
		<author><name>Roman VM</name></author>
	</entry>
</feed>