Assistance with Yahoo Weather

Now it says Weather is 26 (I guess it displays the temperature in Celcius).

Condition_Id is a number representing the conditions, not temperature. 26 indicates Cloudy.

It is likely that the “.” in Condition_Id’s label was causing the bracket problem. Does the temp display correctly now?

Are you using Designer? It will likely highlight syntax errors like this.

Ahh, got it. Why does it display a number instead of the value? I verified that I have “yahoo.weather.map” in the layouts directory and it does have a line saying a value of 26 is “Cloudy”.

I did remove the “.” and I still have the “]” in outside temperature and I still have the raw html showing with a few graphics once I select “weather is”.

I forgot to add that I am using Designer and none of the lines are showing an error or warning.

It needs to be in the configuration/transform directory.

Ignore the webview for now. One thing at a time.

I moved yahoo.weather.map to the transform directory and restarted openhab. I’m still getting Weather is 26 and Outside Temperature “88] F”.

Short of randomly changing things I don’t know what is wrong. See this thread for a number of working configurations. Maybe you can see either what is different with yours or copy and paste from there.

OK, looking at the examples, where do I put this?


Webview HTML:

<!DOCTYPE html>
<html>
<head>
        <meta http-equiv="Content-type" CONTENT="text/html; charset=utf-8">
        <link rel="stylesheet" type="text/css" href="weather-data/layouts/example.css" />
        <script type="text/javascript" src="weather-data/layouts/example.js"></script>
</head>

<body id="weather-body" onload="formatIframe()">
        <div id="weather-location-name">${config:name}, ${item:Weather_LastUpdate} Sunrise: ${item:Sunrise_Time} / Sunset: ${item:Sunset_Time}</div>

        <table id="weather-table">
                <tr>
                        <td rowspan="2"><img id="weather-icon" src="weather-data/images/${param:iconset}/${weather:condition.commonId}.png"/></td>
                        <td id="weather-temp">${item:Weather_Temperature.state}</td>
                        <td id="weather-temp-sign">°F</td>
                </tr>
                <tr>
                        <td colspan="2">
                                <table id="weather-table-details">
                                        <tr>
                                                <td>Humidity:</td>
                                                <td>${weather:atmosphere.humidity}%</td>
                                        </tr>
                                        <tr>
                                                <td>Pressure:</td>
                                                <td>${item:Weather_Pressure}</td>
                                        </tr>
                                </table>
                        </td>
                </tr>
        </table>

        <table id="weather-forecast-table">
                <tr>
                        <td>Today</td>
                        <td>${item:Weather_Forecast_Day_1}</td>
                        <td>${item:Weather_Forecast_Day_2}</td>
                </tr>
                <tr>
                        <td><img src="weather-data/images/${param:iconset}/${forecast(0):condition.commonId}.png"/></td>
                        <td><img src="weather-data/images/${param:iconset}/${forecast(1):condition.commonId}.png"/></td>
                        <td><img src="weather-data/images/${param:iconset}/${forecast(2):condition.commonId}.png"/></td>
                </tr>
                <tr>
                        <td class="temp-max">${item:Weather_Temp_Min} °F</td>
                        <td class="temp-max">${item:Weather_Temp_Min_1} °F</td>
                        <td class="temp-max">${item:Weather_Temp_Min_2} °F</td>
                </tr>
                <tr>
                        <td class="temp-min">${item:Weather_Temp_Max} °F</td>
                        <td class="temp-min">${item:Weather_Temp_Max_1} °F</td>
                        <td class="temp-min">${item:Weather_Temp_Max_2} °F</td>
                </tr>
        </table>

</body>

</html>

That is the webview. It is independent from your Items and Rules and sitemap and it is optional. I’d focus on getting the Items and persistence and charts to work first. Then start to try getting the Webview to work.

The full documentation of the webview is on the wiki page (near the bottom):

I quite using the webview many months ago and don’t remember everything you have to do to get it to work and don’t want to steer you wrong.

OK, I replaced Items, Rules and sitemap to match your comments from 1/13 and I’m still getting the same “Weather is 26” and Outside Temperature “90] F” and my screen looks similar to p0lar’s from 4/29.

I never was able to figure out what may have been wrong. Did you follow the instructions and download the files from the bottom of the wiki page? The one file I posted is the one file you need to change, but it is not the only file you need to make it work. NOTE: I’m making a big assumption that you are using OH 1.8.3 and not OH 2, is that correct?

Try commenting everything out of your sitemap except for the weather stuff. In particular make sure that there is nothing before your weather lines in the sitemap.

Make sure that the permissions on your map file are open to where the openhab user can read the file.

Yes and yes.

New sitemap:

sitemap home label="Highwood Place"
{

//	Frame {
//		Group item=Lights label="All Lighting" icon="hue"
//		Group item=Master_Bedroom label="Master Bedroom" icon="bedroom"
//		Group item=Master_Bathroom label="Master Bathroom" icon="bath"
//		Group item=Office label="Office" icon="office"
//		Group item=Theater label="Theater" icon="video"
//		Group item=Living_Room label="Living Room" icon="sofa"
//		Group item=Kitchen label="Kitchen" icon="kitchen"
//		Group item=Hallway label="Hallway" icon="corridor"
//		Group item=Peggy_Bedroom label="Peggy Bedroom" icon="parents"
//		Group item=Peggy_Office label="Peggy Office" icon="terrace"
//		Group item=Patio label="Patio" icon="sun_clouds"
//		Group item=Peyton_Bedroom label="Peyton Bedroom" icon="boy4"
//		Group item=Outside label="Outside" icon="garden"
//		Group item=Presence label="Presence" icon="present"


//	}
	
// Weather
                Text item=Condition_Id icon="yahoo_weather" {
                        Frame {
                            Webview url="/weather?locationId=home&layout=example&iconset=colorful" height=13

                                Text item=Weather_LastUpdate visibility=[Weather_LastUpdate>30] valuecolor=[Weather_LastUpdate>120="orange", Weather_LastUpdate>300="red"]
                                Text item=Weather_Temperature valuecolor=[Weather_LastUpdate=="Uninitialized"="lightgray",Weather_LastUpdate>90="lightgray",>77="orange",>60="green",>40="aqua",<=40="blue"]{
                                Frame {
                                        Text item=Weather_Temp_Max valuecolor=[>77="orange",>60="green",>40="aqua",<=40="blue"]
                                        Text item=Weather_Temp_Min valuecolor=[>77="orange",>60="green",>40="aqua",<=40="blue"]
                                }
                                Frame {
                                        Switch item=Weather_Chart_Period label="Period" mappings=[0="Hour", 1="Day", 2="Week"]
                                                Image url="http://user:password@localhost:8080/rrdchart.png?items=Weather_Temperature,Weather_Temp_Max,Weather_Temp_Min&period=h" refresh=6000 visibility=[Weather_Chart_Period==0, Weather_Chart_Period=="Uninitialized"]
                                                Image url="http://user:password@localhost:8080/rrdchart.png?items=Weather_Temperature,Weather_Temp_Max,Weather_Temp_Min&period=D" refresh=30000 visibility=[Weather_Chart_Period==1]
                                                Image url="http://user:password@localhost:8080/rrdchart.png?items=Weather_Temperature,Weather_Temp_Max,Weather_Temp_Min&period=W" refresh=30000 visibility=[Weather_Chart_Period==2]
                                }
                            }
                            Text item=Weather_Humidity {
                                Frame {
                                        Switch item=Weather_Humidity_Chart_Period label="Period" mappings=[0="Hour", 1="Day", 2="Week"]
                                                Image url="http://user:password@localhost:8080/rrdchart.png?items=Weather_Humidity&period=h" refresh=6000 visibility=[Weather_Humidity_Chart_Period==0, Weather_Humidity_Chart_Period=="Uninitialized"]
                                                Image url="http://user:password@localhost:8080/rrdchart.png?items=Weather_Humidity&period=D" refresh=30000 visibility=[Weather_Humidity_Chart_Period==1]
                                                Image url="http://user:password@localhost:8080/rrdchart.png?items=Weather_Humidity&period=W" refresh=30000 visibility=[Weather_Humidity_Chart_Period==2]
                                }
                            }
                            Text item=Weather_Pressure {
                                Frame {
                                        Switch item=Weather_Pressure_Chart_Period label="Period" mappings=[0="Hour", 1="Day", 2="Week"]
                                                Image url="http://user:password@localhost:8080/rrdchart.png?items=Weather_Pressure&period=h" refresh=6000 visibility=[Weather_Pressure_Chart_Period==0, Weather_Pressure_Chart_Period=="Uninitialized"]
                                                Image url="http://user:password@localhost:8080/rrdchart.png?items=Weather_Pressure&period=D" refresh=30000 visibility=[Weather_Pressure_Chart_Period==1]
                                                Image url="http://user:password@localhost:8080/rrdchart.png?items=Weather_Pressure&period=W" refresh=30000 visibility=[Weather_Pressure_Chart_Period==2]
                                }
                            }
                            Text item=Sunrise_Time
                            Text item=Sunset_Time
                            Text item=Twilight_Time
                        }

                }
 
}

All I see is the “Weather is 26” and the same issues with the outside temperature.

How do I verify that?

ls -l /etc/openhab/configurations/transform/yahoo_weather_code.map

Make sure the permissions are such that the openhab user can read it.

NOTE: I just noticed you called this file “yahoo.weather.map” above. If that is what you really named the file, then you must use the filename exactly as it is, including case.

"Weather is [MAP(yahoo.weather.map):%.s]"

Yay! Now I get “Weather is Cloudy”.

I still have the outside temperature as “88] degree F”

Simplify.

Use this sitemap.

sitemap home label="Highwood Place"
{
    Text item=Condition_Id icon="yahoo_weather"
    Text item=Weather_Temperature
}

If that works, gradually add back Items and lines to the sitemap. Add dynamic stuff like charts and valuecolor last.

It must be in the line below, because I’m still getting the “]” and there are only 2 lines in my sitemap. :slight_smile:

Number          Weather_Temperature     "Outside Temperature [%.0f] °F" <temperature>   (gWeather_Chart)        { weather="locationId=home, type=temperature, property=current, unit=fahrenheit" }

Yay, I found it! Below is the correct format:

Number          Weather_Temperature     "Outside Temperature [%.0f °F]" <temperature>   (gWeather_Chart)        { weather="locationId=home, type=temperature, property=current, unit=fahrenheit" }

Thank you for your help! Now, I’ll slowly add back!

Glad you found it. I’ll be honest, a quick scan on my phone and I don’t see the difference between the lines.

OK, even closer now! I’ve added back everything except for the line below. This is the line causing the html code to show up in my viewer.

                           Webview url="/weather?locationId=home&layout=example&iconset=colorful" height=13

The other issue is that the “Last Update date/time” shows “Tue 2:36PM” instead of Eastern timezone. My Pi is correctly displaying the correct time, so I’m not sure where it is getting this update time.

I’ve also added the Astro Binding for Sunset and Sunrise time and it shows incorrect times as well.

I’m not sure I’m going to be much help with the webview. My openHAB 1.x is broken as I’m transitioning to OH 2 and the webview is not supported with OH 2. And I’ve not used the webview in quite some months.

For the time, make sure the system is configured with the correct time zone. Search the forum for timezone and you will find several threads with people who have solved similar problems.

OK, thanks for all of your help!