V_FORECAST
-
Where can I find out the format of the data sent by V_FORECAST?
I assumed it was an int or byte containing a pointer to the index of an array with the various weather states in - but seems not to work for me....Any ideas or info please?
@skywatch I've never used V_FORECAST, but the documentation at https://www.mysensors.org/download/serial_api_20#set,-req might be useful.
EDIT: https://github.com/mysensors/MySensors/blob/6ffe29cb5fcfa33fa83133044c2d16ee45c66697/core/MyMessage.h#L108 suggests it is a string.
-
@skywatch I've never used V_FORECAST, but the documentation at https://www.mysensors.org/download/serial_api_20#set,-req might be useful.
EDIT: https://github.com/mysensors/MySensors/blob/6ffe29cb5fcfa33fa83133044c2d16ee45c66697/core/MyMessage.h#L108 suggests it is a string.
@mfalkvidd Thank you! - That explains why I have had trouble getting it to work......
Time to re-write that bit of code I think ;)
-
@mfalkvidd Thank you! - That explains why I have had trouble getting it to work......
Time to re-write that bit of code I think ;)
This seems to work for anyone who needs it.......
void receive(const MyMessage &message) { if (message.sensor == CHILD_ID_GETFORECAST && message.type == V_FORECAST) { forecast = (message.getString()); if (forecast == "stable"){ Index = 0;} else if (forecast == "sunny"){ Index = 1;} else if (forecast == "cloudy"){ Index = 2;} else if (forecast == "unstable"){ Index = 3;} else if (forecast == "thunderstorm"){ Index = 4;} else if (forecast == "unknown"){ Index = 5;} }
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login