Hi Vinod_K, when you trigger your rule, do you get [" before and "] after the alert text? I am, and not sure what is causing the extraneous characters.
@josh any ideas how to fix the formatting that @T_Shoaf pointed out? I tried a couple different ways with the replace function but most I could do is get rid of the square brackets.
Originally, join() was being called as the last line in the expression, so the result of the join() method was being output as the result of the expression. In your current example, you’re calling join(), but not assigning the output of it anywhere, so it’s effectively a meaningless method call. You would want to assign the result of the join() method call to a variable and then reference that variable.
The only change I’ve made to your expression is in the second to last line to assign the output of the join() method call to the variable that you use later.
I thought all was well until Openweather told me I used 2000 API calls yesterday. I run a rule that should only execute every 10 minutes to update the weather info
I’ll preface this with a reminder that looping like this isn’t something we officially support, but there are some best-practices you can use to help with this sort of thing:
That being said, we are considering introducing a first class loop feature and are looking for feedback from the community on what use-cases they are using loops for (in general, event driven rules are preferred, but there are some use-cases where a loop makes sense)
Thanks @josh. I think I have it to only a single instance now with the Stays for xxx clause. This was a big deal because I was getting multiple thousand hits on OpenWeather API and it was starting to cost real money. This should take me from 2000+ pings daily to 72.
Hey Ken,
The multiple running is most likely caused by manually flipping your true/false AFTER it has already been started once. The second time triggers your rule while the first is still running. That will add another instance every time the variable is flipped.
With the updates trigger, that’s absolutely right. The state stays trigger helps deduplicate the events which is why it’s the first thing listed in the unofficial recommendations linked above.
Yup…it looked like Ken was using DELAY, not STAYS. I’ve had relatively few issues since changing mine to STAYS, but… it’s not perfect. About 4 or 5 times a week I’ll have to restart my 10 minute weather timer. No errors or clues as to why it stops. No real complaints, just waiting for the “First Class” timer!!! LOL
Is there a way to tell it has stopped? This is one of the reasons I had parallel rules running. I have a once a day rule that resets my variables. If it hasn’t failed, I will now have two running.