I don't know if I should start a new topic or if I can use this one, which is kind of similar to my current situation.
My goal is the following: I want that, under some conditions (being at home and having the phone muted), when I receive a phone call my lights start blinking in a given color (blue). If the call gets missed, then the lights should start blinking in a different color (red), but if I answer or reject the call, the lights should stop blinking.
To achieve this, I did the following:
1) I created 4 flows called "Ringing" (the only one that has to be manually started at the beginning), "Missed", "Answered" and "Rejected".
2) When "Ringing" is initiated, the 1st thing it does is stopping the other 3 flows (the reason is explained later on at point 5) and then waits for an incoming ringing call.
3) Once this ringing state is detected - and if all the conditions are met - it triggers the blue blinking lights. If the conditions are not met the flow goes back to the "when ringing in-call" block
4) And finally, before ending the flow, it starts the other 3: "Missed", "Answered" and "Rejected"
=> Everything works fine up to this point. The "Ringing" flow is terminated, the other 3 are running, and the lights are blinking in blue.
5) The 3 new flows are practically identical to each other: They wait for an "When xxxxx in-call" (where xxxxx is either "missed", "answered" or "hung up"), then they should either trigger the new lights blinking in red (in the "Missed" flow) or turn off the lights (in the "Answered" and "Rejected" flows), and last but not least, they should initiate again the "Ringing" flow. The idea is that no matter which of these 3 flows captures the "When xxxxx in-call", by starting again the "Ringing" flow as last action, the other two will also be terminated (refer to point 2).
And it's at this point where I have my problem, because it does "not" work (or not as I would like). I'll try to make myself clear. If I eliminate the "Answered" and "Rejected" flows from the whole equation, the "Missed" one then works as expected (the lights blink in red and the "Missed" flow ends after calling the "Ringing" one again, which awaits for another ringing in-call). But I have the impression that if I launch 3 different flows in parallel, each one with a "When xxxxx in-call", only one of the 3 blocks/flows - probably the last one to be called - is really able to capture the in-call thread. Can this be confirmed? Any suggestion - even a completely different approach - will be more than welcome.
PS: I gave a look to the "call state?" block, but I think - I may be wrong - it's not useful for what I need.
PS: In case someone wonders how I do the lights thing, I use the "send broadcast" block to communicate with another app (Hue Essentials), which is the one that really triggers the corresponding scene or turns off the lights.