Homey Community Forum

Homeyduino get weather info

Hello. I’m working on displaying temperatures in my rooms, time and weather using ESP8266.
Everything is working fine except getting info about weather (sunny,rain,cloudy,thunderstorm etc.). I’m using openWeatherMap.

It’s easy for me receiving temperature because it’s float and temperature = Homey.value.toFloat() works good. But I’m lost when I received text.

Here are my functions homeyduino - Pastebin.com

Thanks!

btw this is how it looks:

2 Likes

When you receive a String, you don’t have to convert it into a String.

1 Like

Thank you. So…how should be looks like my function if I want to print it on the Serial Monitor? Because this doesn’t works:

String weatherDescription

void onReceivedWeatherDescription(){
weatherDescription = Homey.value;
Serial.printf(“weather description %s \n” , weatherDescription);
}

I get this: weather stat is ,#⸮?

Not sure you can do the print and the formatting in 1 command.

First try simple: Serial.print(“weather description =” + weatherDescription);

1 Like

it works! Thanks

1 Like

That looks very nice :+1:t2:
Is there a chance I can use your code to set this up?
Perhaps you can post the code and the hardware list to Github, so that I and others can use it and maybe make it better :grinning:

Thank you :pray: