Number to String

btw I’m from Milan, Italy :slight_smile: I was just using some locations around Europe with at least 2 alerts to test the solution :slight_smile:

I’m not sure I’m understanding what you are saying. Idea is to use a Rule to troubleshoot better?

LOL

found the issue :slight_smile:

the right syntax is:

{ http="<[WuAlertsCache:300000:JSONPATH($.alerts[0].wtype_meteoalarm_name)]" }

it was missing the “<”

:slight_smile:
now it works like a charm

thanks
Andrea

Still a problem here :frowning: Sorry for bothering you again :slight_smile:

I’ve change location with my location, where are not alerts currently.

The issue is: when there are no alerts, meteoalarm reply is like this:

{
“response”: {
“version”:“0.1”,
“termsofService”:“http://www.wunderground.com/weather/api/d/terms.html”,
“features”: {
“alerts”: 1
}
}
,“query_zone”: “999”,
“alerts”: [
]
}

So the path is not ok and the items are not cleared as I would like:

2018-03-26 16:50:50.264 [DEBUG] [ab.binding.http.internal.HttpBinding] - updating cache for ‘MeteoalarmCache’ (‘http://api.wunderground.com/api/xxxxxx/alerts/q/zmw:00000.465.16080.json’)
2018-03-26 16:50:51.450 [WARN ] [ab.binding.http.internal.HttpBinding] - Transformation ‘JSONPATH($.alerts[3].wtype_meteoalarm_name)’ threw an exception. [response=
{
“response”: {
“version”:“0.1”,
“termsofService”:“http://www.wunderground.com/weather/api/d/terms.html”,
“features”: {
“alerts”: 1
}
}
,“query_zone”: “999”,
“alerts”: [
]
}
]
org.openhab.core.transform.TransformationException: Invalid path ‘$.alerts[3].wtype_meteoalarm_name’ in ’
{
“response”: {
“version”:“0.1”,
“termsofService”:“http://www.wunderground.com/weather/api/d/terms.html”,
“features”: {
“alerts”: 1
}
}
,“query_zone”: “999”,
“alerts”: [
]
}

at org.openhab.core.transform.TransformationHelper$TransformationServiceDelegate.transform(TransformationHelper.java:67) [189:org.openhab.core.compat1x:2.3.0.201803231044]
at org.openhab.binding.http.internal.HttpBinding.execute(HttpBinding.java:194) [223:org.openhab.binding.http:1.12.0.201803230213]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:144) [189:org.openhab.core.compat1x:2.3.0.201803231044]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:166) [189:org.openhab.core.compat1x:2.3.0.201803231044]
2018-03-26 16:50:51.457 [DEBUG] [ab.binding.http.internal.HttpBinding] - transformed response is ’
{
“response”: {
“version”:“0.1”,
“termsofService”:“http://www.wunderground.com/weather/api/d/terms.html”,
“features”: {
“alerts”: 1
}
}
,“query_zone”: “999”,
“alerts”: [
]
}

2018-03-26 16:50:51.460 [TRACE] [ab.binding.http.internal.HttpBinding] - Couldn’t find matching binding provider [itemName=Http_Wunderground_MeteoAlarm4, command=CHANGED]
2018-03-26 16:50:51.472 [DEBUG] [ab.binding.http.internal.HttpBinding] - item ‘Http_Wunderground_MeteoAlarm3’ is fetched from cache
<…>

Any suggestion how to solve this issue?
thanks

Andrea

Hi Andrea,

I’m afraid you can’t. Unfortunatelay there’s no alerts for Italy as there is no for Germany…

Why? It was working like a charm till 2 years ago. Meteoalarm is working really good also for Italy. Now there are alerts in Sardegna and Calabria.

Also Germany is covered.
Why you are saying differently?

I can confirm. Germany is working fine.

Check Kreis Ravensburg:

https://www.meteoalarm.eu/en_UK/0/0/DE344-Kreis%20Ravensburg.html

http://api.wunderground.com/api/xxxxx/alerts/q/zmw:00000.379.10935.json

or Bonn:

https://www.meteoalarm.eu/en_UK/0/0/DE289-Bundesstadt%20Bonn.html

http://api.wunderground.com/api/xxxxx/alerts/q/zmw:00000.163.10518.json

Mmmmm …

@binderth

I think you are right. Wunderground blocked in API all alerts from Meteoalarm. And AccuWeather is asking money for those alerts.

Question: any chance to use the rss directly from meteoalarm.eu?

this is an example (2 alerts, city of Troms in Norway).

Any chance to parse in this xml text this piece? alt=“awt:9 level:4” The icon is reflecting the alert. There is also “today” and “tomorrow” for current and forecast.

Any suggestion?

Andrea

rss.pdf (14.9 KB)

I would consider a javascript transform for this one.
Javascrpit has tool to transform xml into json or javascript objets that make it very easy to manipulate thereafter.

Can’t confirm these, no alerts at all in Germany…
I use DWD for alerts - just parse this JSON - you can adress multiple locations in one call:
https://app-prod-ws.warnwetter.de/v16/warningOverview?points=10.2101|49.9913%2C8.4182|54.8624%2C8.9989|48.2372

(only available in Germany, I’m afraid!)

Guys,

I’ve found a way to receive the meteoalarm info via REGEX … but I don’t know how to manage the array with a REGEX instead of a JSONPATH

the string for the item is something like:

Number Http_Meteoalarm_TodayTest "MeteoAlarm [%d]" { http="<[https://www.meteoalarm.eu/en_UK/0/0/AT002-Vorarlberg.html/:5000:REGEX(.*aw.*?([0-9]+[0-9]+).*.?)]"}

but in this way I can see only the last value of the array (in case I have 2+ alerts).

How to do something like [0], [1] … in different items?

Any suggestion will be appreciated

thanks
Andrea