[quote=“IslandMan54, post:1, topic:200438”]Good Morning,
I use World Weather to turn on a heater in a rainfall sensor on my weather station. I’m unsure about the Condition input, weather it should be “equals” or “contains” as it’s a string variable. It wasn’t clear in the help files as all it mentions for the Condition input are “y”, “yes”, “t” or “true”. This is what I have programmed:
WeatherConditions (#224)
Version 2.1547549739 01/15/19 05:55:39
Message/status: Not tripped
Group #1 false as of 05:44:47
=f (service) World Weather (85) urn:upnp-micasaverde-com:serviceId:Weather1/ConditionGroup contains “Freezing Rain/Sleet” [false/false as of 05:44:47/05:44:47; clear at 05:44:47]
Group #2 false as of 05:45:34
=f (service) World Weather (85) urn:upnp-micasaverde-com:serviceId:Weather1/ConditionGroup contains “Snow” [false/false as of 05:45:34/05:45:34; clear at 05:45:34]
Thanks,
Dave[/quote]
Dave, I think you’re on the right track. For some devices/plugins, if the range of possible values for a variable isn’t published (and correct), you may have to watch the plugin’s behavior to observe what relevant values you want to test for. But in a string like this, using “contains” is often a better choice than “is” because it allows for some flexibility in the text, in case the message changes slightly as the plugin evolves, or if it goes through permutations that you’d want to handle equally (e.g. “Rain”, “Rain/Light”, “Rain/Heavy”, “Rain/Biblical” can all be caught by “starts with Rain” or “contains Rain”).
I’m not sure where that plugin gets those strings. I’m just getting moving this morning, but when I’m settled at my desk, I’ll install the plugin and take a squiz at the code and see if it’s something it sets, or if it’s just passing through from a remote API. If the former, I can tell you exactly what you might want to test for. If the latter, we can move on to look at the API documentation and see if exposes the possible values. But if there’s no definitive list, you’re just going to have to watch it and learn what it gives you, and adjust your tests accordingly.
Also, would you mind going to the Tools page on your ReactorSensor, and in the “Submit Device Data” area, select your World Weather plugin and send it up? I don’t have data for that yet in the enhancement database.