| HWimage Template Example 1 |
Hourly Template (hourly.txt)
The hourly template included in the HWimage build creates images that look similar to :

Below is an example of the template file that can be used with HWimage in advanced mode, with explanations of what each line is doing. This actual template is included in the build and can be used to create the zone forecast images seen in the basic mode.
For a complete list of the HWimage template commands visit the Template Command Page and for information about the general syntax of the HWimage templates visit the Template Syntax page.
Following the template you will find a line by line explanation. (Note: The coloring is added only for visibility):
# hourly HWimage template example size 166 175 textsize MEDIUM textat 2 1 "%%lcplace%%, %%lcstate%%" textsize SMALL # If the forecast is not available lets jump # to the not avail portions dounavail # Other wise lets continue textat 65 15 "%%hforecasttime%% " textat 65 30 "%%hsky%% " textat 65 45 "%%htempf%%°F" textat 65 60 "%%hwind%% " image 2 15 %%hicon_path%% end unavailstart textat 65 15 "Current Conditions Unavailable" SPACEWRAPLEFT end |
| Line | Description |
| # hourly HWimage template example | This is just a remark line, any line beginning with the pound sign (#) is just a remark and is ignored by HWimage. |
| size 166 175 | Set the initial image size to a width of 166 and height of 175 |
| textsize MEDIUM | Set the text size to medium (8x16) which is also bold. |
| textat 2 1 "%%lcplace%%, %%lcstate%%" | Tells HWimage to place the text 'place, state' in the image starting at position (2, 1). The %%lcplace%% and %%lcstate%% template variables will be replaced with the actual variables before the text is added. |
| textsize SMALL | Sets the text size to small (7x13). |
| dounavail | This tells HWimage that is the current conditions requested were unavailable then to skip down to the unavailstart command and begin parsing there. If the conditions were available then it continues with the next line in the template. This allows us to display a proper unavailable message. |
| textat 65 15 "%%hforecasttime%% " | Place the time of the current conditions starting at position (65, 15). The extra space in the line helps capture the chance that the template variable is empty. |
| textat 65 30 "%%hsky%% " | Place the current sky condition at position (65, 30). |
| textat 65 45 "%%htempf%%°F" | Place the temperature at position (65, 60). |
| textat 65 60 "%%hwind%% " | Place the wind speed and direction at position (65, 60). |
| image 2 15 %%hicon_path%% | Insert the current condition icon at position (2, 15). |
| end | End the current image. The end here also stops parsing before the Unavail commands start. |
| unavailstart | This command lets HWimage know where the weather info unavail commands start in the template and is accessed when the dounavail command is found. |
| textat 65 15 "Current Conditions Unavailable" SPACEWRAPLEFT | Display 'Current Conditions Unavailable' starting at position (65, 15). The text will be auto wrapped at each space, thus there will be three lines and each line will be left justified to the y position of 15. |
| end | End the current image. |
For a complete list of the HWimage template commands visit the Template Command Page and for information about the general syntax of the HWimage templates visit the Template Syntax page.