I have blinds that go up and down certain number of times during the day. For example, when turning the TV on, the blinds in that room will go down.
There are days when the TV goes on and off throughout the day, particularly on weekends. To save battery, I would prefer some kind of stop action and just leave the blind at the last position (whether open or closed), and I would like the count to reset each morning. In the first draft of my workflow I’m targeting just the lowering action.
Not sure how to go about this, but so far I’ve created two numeric variables:
Max Blind Lower Target = 3 (so, don’t lower more than 3 times)
Max Blind Lower Current = x (holds the current value, should reset each day)
Point where I’m stuck: #1. How do we reset the value back to zero? #2. I have a logiblock set to automatically evaluate to send a Stop Blinds action through IFTTT. I think this is the way to go, but have to fix #1 first.
First, you need to find out the Webhook (URL) to set your numeric variable to zero. Open your variable settings and click on the “Set value” icon to get the URL in the clipboard.
Finally, create a new logicblock and choose this condition, so the logicblock will be run everyday at 8:00. Then add an action for the “positive result” case, which should be type “Webhook”. Enter the webhook from step 1 (it should be in the clipboard) in the Webhook URL field and don’t forget to add 0 at the end (so the variable is set to zero)
Super, thanks @teknofilo and @pebneter. Now that I have counter resetting resolved, I think something is off on the action execution itself. Here’s what I have so far:
Numeric Variable “MaxBlindLower” to hold the current number of times the blinds have been lowered so far (within the 24 hour window).
If I understand this correctly, I would reverse the logic:
Name: “movements_reached”
Variable: MaxBlindLower (as is)
Compare reference: MaxBlindLowerTarget (as is)
Compare type: “more than”
Timeout/Delay: empty
Then in the logicblock, you add the stopping action to the positive actions.
Can you try?
But still no go. The auto trigger service (lightning bolt) is confirmed working on Apilio’s side, correct? I’m noticing that the auto trigger for the cycling workflow seems to have stopped working this week as well - but was going to revisit that after solving this in case they are related.
For good measure here is the current condition status:
Hi @qdmt ,
I quickly checked the log entries (the same as you see on the dashboard and on the logicblock page).
I think the event was correctly triggered after the count was set to 4.
Maybe the URL for IFTTT is not correct?
(btw. are you aware that you can trigger IFTTT applets directly without using webhooks?)
You’ll notice no activity past 12:24:58. If my understanding is correct, it should have also fired at 12:31, 33, and 46.
I thought about using an IFTTT applet, but my tier level with IFTTT won’t allow an OR in the StopBlinds applet that I already have (i.e., if receive Webhook OR if receive Apilio Action). I would have to create a new StopBlinds applet that would house the Apilio/IFTTT action (unless I’m mistaken).
Ah yes, now I get it.
It doesn’t trigger anymore because the condition (x > 4) was and keeps being true.
You can trick this by adding a timeout of 10 seconds (10 is the minimum).
Ah hah - that’s what’s happening on the cycling side as well. The weather has been consistently above the target threshold, so it keeps being true there and also never reset.
The 10 second trick worked well! Very cool, thanks again.