Hi All,
OH3 build 2322 here.
I’ve a strange issue, I hope you can help me.
I’ve created a things file to grab some information from Meteoalarm.eu website
Thing http:url:meteoalarmtoday "MeteoAlarm Today" [
//baseURL="http://www.meteoalarm.eu/en_UK/0/0/IT003-Lombardia.html",
baseURL="http://www.meteoalarm.eu/en_UK/0/0/IT001-Calabria.html",
timeout=5000,
refresh=600] {
Channels:
Type number : aw1 "Wind" [ stateTransformation="REGEX:.*aw1([1-4]+).*.?" ]
Type number : aw2 "Snow/Ice" [ stateTransformation="REGEX:.*aw2([1-4]+).*.?" ]
Type number : aw3 "Thunder" [ stateTransformation="REGEX:.*aw3([1-4]+).*.?" ]
Type number : aw4 "Fog" [ stateTransformation="REGEX:.*aw4([1-4]+).*.?" ]
Type number : aw5 "High Temp" [ stateTransformation="REGEX:.*aw5([1-4]+).*.?" ]
Type number : aw6 "Low Temp" [ stateTransformation="REGEX:.*aw6([1-4]+).*.?" ]
Type number : aw7 "Coastal" [ stateTransformation="REGEX:.*aw7([1-4]+).*.?" ]
Type number : aw8 "Forest Fire" [ stateTransformation="REGEX:.*aw8([1-4]+).*.?" ]
Type number : aw9 "Avalanches" [ stateTransformation="REGEX:.*aw9([1-4]+).*.?" ]
Type number : aw10 "Rain" [ stateTransformation="REGEX:.*aw10([1-4]+).*.?" ]
Type number : aw11 "Flood" [ stateTransformation="REGEX:.*aw11([1-4]+).*.?" ]
Type number : aw12 "Rain Flood" [ stateTransformation="REGEX:.*aw12([1-4]+).*.?" ]
}
here my items:
Number Http_Meteoalarm_Today1 "MeteoAlarm: [MAP(meteoalarm-wind.map):%s]" <meteoalarm_wind> (gOutdoor, gWeather) { channel="http:url:meteoalarmtoday:aw1" }
Number Http_Meteoalarm_Today2 "MeteoAlarm: [MAP(meteoalarm-snowice.map):%s]" <meteoalarm_snowice> (gOutdoor, gWeather) { channel="http:url:meteoalarmtoday:aw2" }
Number Http_Meteoalarm_Today3 "MeteoAlarm: [MAP(meteoalarm-thunder.map):%s]" <meteoalarm_thunder> (gOutdoor, gWeather) { channel="http:url:meteoalarmtoday:aw3" }
Number Http_Meteoalarm_Today4 "MeteoAlarm: [MAP(meteoalarm-fog.map):%s]" <meteoalarm_fog> (gOutdoor, gWeather) { channel="http:url:meteoalarmtoday:aw4" }
Number Http_Meteoalarm_Today5 "MeteoAlarm: [MAP(meteoalarm-hightemp.map):%s]" <meteoalarm_hitemp> (gOutdoor, gWeather) { channel="http:url:meteoalarmtoday:aw5" }
Number Http_Meteoalarm_Today6 "MeteoAlarm: [MAP(meteoalarm-lowtemp.map):%s]" <meteoalarm_lowtemp> (gOutdoor, gWeather) { channel="http:url:meteoalarmtoday:aw6" }
Number Http_Meteoalarm_Today7 "MeteoAlarm: [MAP(meteoalarm-coastal.map):%s]" <meteoalarm_coastal> (gOutdoor, gWeather) { channel="http:url:meteoalarmtoday:aw7" }
Number Http_Meteoalarm_Today8 "MeteoAlarm: [MAP(meteoalarm-forestfire.map):%s]" <meteoalarm_forestfire> (gOutdoor, gWeather) { channel="http:url:meteoalarmtoday:aw8" }
Number Http_Meteoalarm_Today9 "MeteoAlarm: [MAP(meteoalarm-avalanches.map):%s]" <meteoalarm_avalanches> (gOutdoor, gWeather) { channel="http:url:meteoalarmtoday:aw9" }
Number Http_Meteoalarm_Today10 "MeteoAlarm: [MAP(meteoalarm-rain.map):%s]" <meteoalarm_rain> (gOutdoor, gWeather) { channel="http:url:meteoalarmtoday:aw10" }
Number Http_Meteoalarm_Today11 "MeteoAlarm: [MAP(meteoalarm-flood.map):%s]" <meteoalarm_flood> (gOutdoor, gWeather) { channel="http:url:meteoalarmtoday:aw11" }
Number Http_Meteoalarm_Today12 "MeteoAlarm: [MAP(meteoalarm-rainflood.map):%s]" <meteoalarm_rainflood> (gOutdoor, gWeather) { channel="http:url:meteoalarmtoday:aw12" }
The problem is: if, for example, today aw1 is “2” and the others are “NULL”, I see correctly “2” in Http_Meteoalarm_Today1. But if another day I have only aw2 set, for example, “3”, I see correctly Http_Meteoalarm_Today2 with “3”, but I still see “2” in aw1.
The debug is saying correctly
Transformation ChannelStateTransformation{pattern='.*aw1([1-4]+).*.?', serviceName='REGEX'} returned empty result when applied to
but Http_Meteoalarm_Today1 is reporting “2” instead of the expected “NULL”.
Uff … I know I’m doing something wrong, but … not able to see.
last but not least, example of map file (meteoalarm-wind.map):
2=WIND
3=WIND
4=WIND
=
Any help?
Andrea
edit: just to clarify the map file. The website is reporting the image filename structured in this way:
aw[1-12][1-4]
1-12 is the type of alarm
1-4 is the level of alarm