{{#Name=5 Day Forecast}} {{#Description=Displays the weather forecast for 5 days, used HS long/lat}} {{#Version=1.0}} {{#Author=HomeSeer}} {{#CanBeDeleted=False}} {{includefileraw Dashboards/Cards/Custom/Common/CommonHeader.html}} {{#get settings}} {{sections[index]="Settings"}} {{loc_long=get_value 'save_loc_long' (get_setting_text 'gLongitude') 'Location Longitude'}} {{loc_lat=get_value 'save_loc_lat' (get_setting_text 'gLatitude') 'Location Latitude'}} {{sections[index]="Title"}} {{title=get_value 'save_title' '' 'Name'}} {{title_size=get_value 'save_title_size' '25' 'Size'}} {{title_color=get_value 'save_title_color' '#000000' 'Color'}} {{sections[index]="Current Icon Size"}} {{current_icon_width=get_value 'save_current_icon_width' '50' 'Width'}} {{current_icon_height=get_value 'save_current_icon_height' '50' 'Height'}} {{sections[index]="Current Conditions"}} {{current_text_size=get_value 'save_current_text_size' '20' 'Size'}} {{current_text_color=get_value 'save_current_text_color' '#000000' 'Color'}} {{sections[index]="Current Temp"}} {{current_temp_size=get_value 'save_current_temp_size' '25' 'Size'}} {{current_temp_color=get_value 'save_current_temp_color' '#000000' 'Color'}} {{sections[index]="Current Humidity"}} {{current_humidity_size=get_value 'save_current_humidity_size' '25' 'Size'}} {{current_humidity_color=get_value 'save_current_humidity_color' '#000000' 'Color'}} {{sections[index]="Day"}} {{day_size=get_value 'save_day_size' '16' 'Size'}} {{day_color=get_value 'save_day_color' '#000000' 'Color'}} {{sections[index]="Day High Temp"}} {{day_temp_size=get_value 'save_day_temp_size' '16' 'Size'}} {{day_temp_color=get_value 'save_day_temp_color' '#FF8C00' 'Color'}} {{sections[index]="Day Low Temp"}} {{night_temp_size=get_value 'save_night_temp_size' '16' 'Size'}} {{night_temp_color=get_value 'save_night_temp_color' '#33c7ff' 'Color'}} {{sections[index]="Day Icon Size"}} {{icon_width=get_value 'save_icon_width' '40' 'Width'}} {{icon_height=get_value 'save_icon_height' '40' 'Height'}} {{#temp scale: empty string or "True" =F else C}} {{ch=get_setting_text 'gGlobalTempScaleF'}} {{temp_unit=''}} {{if ch=='' || ch=='True'}} {{temp_unit='&temperature_unit=fahrenheit'}} {{end}} {{weather_url='https://api.open-meteo.com/v1/forecast?latitude=' | string.append loc_lat | string.append '&longitude=' | string.append loc_long | string.append '&daily=weather_code,temperature_2m_max,temperature_2m_min¤t=temperature_2m¤t=is_day,temperature_2m,relative_humidity_2m,weather_code'}} {{weather_url=weather_url | string.append temp_unit}} {{if queries['fetch_weather_data']=='true'}} {{#we cache this request to limit the # of weather API requests}} {{#web_download_json_to_object url,useragent,cache_timeout(ms)}} {{obj=web_download_json_to_object weather_url "" 36000}} {{end}} {{if obj==null}}