Great. I thought about too. But to heavy for me.Iām newbie and in my former live i was an accountant (i only know āExcelā and a bit of ERP-Software). So i think itās not that easy as it seems, as the daily time sections are sliding.
No, I will not do a research for such a solution inside the binding because bindings are meant to transfer and prepare data from a specific API towards the framework. They should not contain business logic. Therefore we have other tools like groups, rules or transformations. Maybe powerful profiles in the future.
If I should make a proposal I would say create some groups, use the power of the group arithmetical functions (MIN,MAX,AVG), and stuff all items of the hourly forecast into them. Easy without much effort.
For other edge cases you can use rules or transformations.
Sorry, I was just kidding about that.
It just was an idea of me and i understand the aspects that drives you when developing a binding.
I hope the time will come, when i can handle the binding better. And then i will thinking about tunings.
hi Christoph,
thanks for the binding.
Unless Iāve misunderstood, are you saying that the binding doesnāt support the 5-day forecast?
Iām slightly confused, as the api will return the 5-day forecast, eg:-
https://api.openweathermap.org/data/2.5/forecast?APPID=yourapikey&q=London,uk
Hello guys,
IĀ“d like to merge the items winddirection an windspeed into one item. What I did is:
String Wind_Geschw_und_Richtung
Number Windrichtung { channel="openweathermap:weather-and-forecast:9ee44fae:local:current#wind-direction" }
Number Windgeschwindigkeit { channel="openweathermap:weather-and-forecast:9ee44fae:local:current#wind-speed" }
rule "Windgeschwindigkeit und Richtung"
when
Item Windgeschwindigkeit changed or
Item Windrichtung changed
then
var Number wg = (((Windgeschwindigkeit.state as DecimalType).floatValue)*3.6)
var wr = transform("SCALE", "wind.scale",Windrichtung.state.toString)
var String Ausgabe = String::format("%1$.0f km/h aus " +wr, wg)
Wind_Geschw_und_Richtung.postUpdate(Ausgabe)
end
(thx to M. Spiller for that)
That is working quite well. But I had to create those two items āWindgeschwindigkeitā und āWindrichtungā. Instead I would like to use the two items from the demo.items that I already have:
Number:Speed localCurrentWindSpeed "Current wind speed [%.1f km/h]" <wind> { channel="openweathermap:weather-and-forecast:9ee44fae:local:current#wind-speed" }
Number:Angle localCurrentWindDirection "Current wind direction [%d %unit%]" <wind> { channel="openweathermap:weather-and-forecast:9ee44fae:local:current#wind-direction" }
Those two items wonĀ“t work with my rule because of the additions āSpeedā and āAngleā respectively. How do I have to change my rule so I can get rid of those two extra items?
Thanks a lot.
I quoted my opening post. The current weather and the 5 days forecast (in 3 hour steps) are available for everyone. The 16 days forecast (in daily intervals) is restricted to users owning a paid account (Startup minimum). The weather-and-forecast
Thing provided by the bindings has different channel groups. One for current weather, a user-defined number (between 0 and 120 in 3 hour steps) of hourly forecast channel groups and a user-defined number (between 0 and 16 in 1 day steps) of dayly forecast channel groups. The daily forecast channel groups are removed automatically if the configured key belongs to an unpaid account.
To answer your question directly: The binding supports the 5 days forecast. But only in 3 hour steps unless you own a non-free account.
just fyi: I am going to get a cool HABPanel widget going for thisā¦ more news soon
Hi Leif,
from my point of view it can be done in this way. Please be aware of typos I wrote this down in a second:
rule "Windgeschwindigkeit und Richtung"
when
Item localCurrentWindSpeed changed or
Item localCurrentWindDirection changed
then
Wind_Geschw_und_Richtung.postUpdate((localCurrentWindSpeed.state as QuantityType<Speed>).toString + " aus " + transform("SCALE", "wind.scale", localCurrentWindDirection.state.toString))
end
Thats it. IĀ“ve changed the then-part to:
then
Wind_Geschw_und_Richtung.postUpdate((localCurrentWindSpeed.getStateAs(QuantityType).toString) + " aus " + transform("SCALE", "wind.scale", (localCurrentWindDirection.state as QuantityType<Number>).doubleValue.toString))
end
Otherwise VSC displayed an error saying that āSpeed cannot be resolved to a typeā and scale said: āCould not transform ā60.0 Ā°ā with the file āwind.scaleā : Scale can only be used with numeric inputsā.
Now itĀ“s working fine and I wonĀ“t need my additional ādimensionlessā items any more. Thank you very much for leading me to the right direction.
Best regards
ahh, thank you. Iāve set the forecast hours to 120, and am now getting all the forecasts.
Iām interested in this binding, but is not present in my Paper UI bindings section. Iāve a standard openHab 2.3 installation.
How can I install it ?
Mirko
You will need to upgrade openHAB to the M6 release:
Follow the instructions here:
Choose the Testing Release Option
Iāam testing this Binding but have a refresh issue karaf console says Iāam using 0.10.0.201811281422 of the Eclipse SmartHome OpenWeatherMap Binding.
I first added outdoor temperature using the example from the demo.items.
The value was filled. but isnāt being updated (refresh interval is 10 minutes).
I also added timestamp of last measurement. the log states the items file is successfully renewed but thereās no value getting retrieved.
The value is only updated if it changes.
@vzorglub that seems logical but the current temperature value hasnāt been updated in 5 hours.
When I just looked again I saw this error which happened a few minutes ago.
2018-11-29 20:09:58.081 [hingStatusInfoChangedEvent] - 'openweathermap:weather-and-forecast:aaa3d98d:local' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Internal error: 500001
2018-11-29 20:09:58.088 [hingStatusInfoChangedEvent] - 'openweathermap:weather-api:aaa3d98d' changed from ONLINE to OFFLINE
Yes, does that to me too and it comes back online
Before I tried this binding, I used the OH1 weather binding for OWM.
With that binding, there I are some more values available. At least I had those before:
{weather="locationId=home, type=temperature, property=feel"}
{weather="locationId=home, type=atmosphere, property=pressureTrend"}
Is it planned to add them also to this new binding?
Does anyone know if the Channel openweathermap:weather-and-forecast:api:local:current#time-stamp
pulls info into the DateTime Item in UTC or local TZ?
edit: found itā¦ added %1$tz
and saw that it is using local (the default set in my i18n)ā¦ good
Hi Ulrich,
Boot is not. Because those information are not delivered by the OWM API but calculated by the weather binding itself. I do not want to implement calculations inside the OWM binding. If you really need them I suggest to setup a rule for it.
IIRC an experimental binding for weather calculations is available via the Eclipse Marketplace.
Yes the binding transforms every DateTime information to your local timezones.