FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: homer am 08 Mai 2013, 09:50:42

Titel: Getting weather information using "weather" and "get"
Beitrag von: homer am 08 Mai 2013, 09:50:42
Hello All,

This is a very basic question but I don't know the syntax to get weather details from the "weather" function. I have:

define Forecast Weather 26429775 1800

I would like to extract values such as current temp (temp_c) and humidity (humidity) from Weather and show them as dummy variables on my webpage. How do I use the "get" format? For example, I tried this:

define WeatherCheck at +*00:01:00 {\
my CurrentTemp=ReadingsVal("Forecast", "temperature", 0)");;\
}

Which didn't work. I'm sure I'm making it more difficult than it needs to be!

Thanks
Homer
Titel: Aw: Getting weather information using "weather" and "get"
Beitrag von: MisterEltako am 08 Mai 2013, 11:03:39

define Temperature dummy

define WeatherCheck at +*00:01:00 {\
my $CurrentTemp=ReadingsVal("Forecast", "temperature", 0)");;\
fhem("set Temperature $CurrentTemp");;\
}

MfG, MisterEltako.
Titel: Aw: Getting weather information using "weather" and "get"
Beitrag von: homer am 08 Mai 2013, 13:58:01
Ahh, great. That's working. Thank you!