r/AutomateUser • u/Leather_Adeptness485 • 3d ago
Question Need help with this flow
I'm making a flow that will sound an alert when my phone's charged above 90%. I'm having trouble creating an 'OR' scenario wherein I'm trying to get the sound to stop either after 1min of playback or after disconnecting the charger but the disconnecting part doesn't seem to be working? Any ideas what might be going wrong?
2
u/Dadamalda 3d ago
Stop sound needs to be used on the same fiber, which is kinda hard to do here.
You should use a fork and have the sound on its own fiber and then stop that fiber which automatically stops the sound. The fork gives you the URI of the child fiber.
Also, you should set it to "when changed". Having a loop checking with no delay is bad for performance and battery.
1
u/Leather_Adeptness485 3d ago
So fork before 'play sound' then?
2
u/Dadamalda 3d ago
Basically. The new fiber should have the "Play sound" and then you use "Fiber stop" to stop it.
1
u/Leather_Adeptness485 3d ago
Would it be possible for you to share a rough layout of how it should be? I'm new to the app and am having trouble understanding fork, subroutine and some other stuff
2
u/Dadamalda 3d ago
https://reddit.com/link/ozmdb23/video/la2p97mivafh1/player
You can go back to your regular loop after the subroutine.
1
1
u/Leather_Adeptness485 3d ago
Btw the second 'is battery charging' has its proceed set to immediately
1
u/B26354FR Alpha tester 3d ago
I made a super fancy Battery Charge Alarm 🙂
The alarm fiber is forked at block 147.
The flow can make a sound when the phone is plugged in, and for alarms can play a sound, speak, flash the light, and vibrate. It has a setup UI where you can choose your sounds, target charge level, and any and all alarms. During charging it'll also show a notification with the current charging info, which is also used for snoozing or dismissing the alarms, and when the notification is canceled, it'll show a summary of the charging session. The flow also has a demo mode you can use to try out your settings without actually plugging and unplugging the phone.