Lots of good information in the entire posting! Being a noobe, I did figure out how to get OpenWeatherMap installed and setup along with the transform file for the wind direction. I guess since I have a free license I can only get the current weather information. The only other thing I’m looking for is how to change the wind speed from km\h to miles per hour.
You can get forecasts too. Set forecastHours to 120 (or however many you’d like in increments of 3) and forecastDays to 0. 120 forecastHours gives you 5 days of forecasts. This will require >600 Items, so you may want to check out…
No need… the binding does it for you in the Condition Item. The ConditionID does not have much use. It looks like your Condition Item is setup for the ConditionID.
I’m using this binding, but I’m having an issue using the temperature in a rule. Can someone please point me in the correct direction?
item file:
Number:Temperature localCurrentTemperature "Current temperature [%.1f %unit%]" <temperature> (Weather) { channel="openweathermap:weather-and-forecast:c5e7a131:local:current#temperature" }
Number:Temperature localDailyForecastTodayMinTemperature "Minimum temperature for today [%.1f %unit%]" <temperature> (Weather) { channel="openweathermap:weather-and-forecast:c5e7a131:local:forecastToday#min-temperature" }
Number:Temperature localDailyForecastTodayMaxTemperature "Maximum temperature for today [%.1f %unit%]" <temperature> (Weather) { channel="openweathermap:weather-and-forecast:c5e7a131:local:forecastToday#max-temperature" }
Rules:
rule "Summertime"
when
Item localCurrentTemperature changed
then
val localTemp = localCurrentTemperature.state as DecimalType
if(localTemp as Number > 79) {
sendCommand(Summer, ON)
logInfo("Summer", "It is hot outside!")
}
else sendCommand(Summer, OFF)
end
Error log:
2019-02-19 15:53:31.209 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Summertime': Could not cast 85.424 °F to org.eclipse.smarthome.core.library.types.DecimalType; line 736, column 18, length 44
I would really like to use the max daily temp to drive my virtual switch, but my understanding is that those only return on paid accounts.
If you are using an Items file, then forget about about Simple Mode. Your Item is linked to the proper Channel for the currrent condition, so you must have some other Item with the same label that is linked to conditionId.
I’ll have to go back and look in the Paper UI. I just updated the screen and it changed back to 800 again!! Thanks for point me in the right direction!!
5iver
Sorry about removing the reply. I thought I found the problem. In digging into this deeper, I started looking into these two lines in the Items file.
The first line that includes the <sun_clouds> always displays the sun_clouds icon no matter what the weather is. It is the second line that displays the current weather icon and is displayed like this with the current weather icon one line below. As I have been checking the Paper UI settings and the Items file, I have seen the current number number change between the current number and the text it represents and back again.
I have checked the variables as you suggested before and double checked the Paper UI settings and didn’t see any duplicate settings there. Any other ideas or suggestions to fix this?
This is normal. It will be static, but the Icon Item will change. The Icon will take up two rows, but that is a limitation of the Basic and Classic UIs. Look into Habpanel if you want something prettier.
Take a look at the ConditionID Channel in Paper UI> Configuration> Things> your OWM weather and forecast Thing. Check if your localCurrentCondition Item might be linked to that Channel. If not, maybe @cweitkamp would have an explanation how this could be occurring. You’re using OH 2.4 stable?
The Thing files in the doc are just examples, for those who want to use files. Much easier, IMO, to create/manage Things in Paper UI. It’s good that you have learned how to make unmanaged Things though! I still do my Items this way.