Help with a macro

That worked! Thank you so much!!
OK, slight issue. If I go outside the BT range when I come back in range, the macro runs again, but it doesn't need to, as the program does not change. Is there any way to configure the macro to not always trigger? Also, I cloaned the macro and made two modifications to use when I get to church, I added a geo-fence trigger and day/time trigger. Is there a way to have the macro run the other macro once I leave the geo-fence area or specific day/time?
 

dhj49er

Well-known member
OK, slight issue. If I go outside the BT range when I come back in range, the macro runs again, but it doesn't need to, as the program does not change. Is there any way to configure the macro to not always trigger? Also, I cloaned the macro and made two modifications to use when I get to church, I added a geo-fence trigger and day/time trigger. Is there a way to have the macro run the other macro once I leave the geo-fence area or specific day/time?
Probably.....but needs a screenshot of your macros to suggest changes.
 

Dm114

Well-known member
1) Your 1st macro:
To prevent from firing when the "myPhonak" app is already running you could add a constraint Application Running > Not in Foreground, if this app remains in foreground when running. Otherwise, I'm wondering why this app should still run if your hearing aid is out of range...

2) Your 2nd macro:
- I would join it with the 1st one
- Add your Day/Time trigger and set a boolean variable "ReadyToConnect" to True
- Add your Geofence trigger with "ReadyToConnect" constraint to True (to avoid triggering if it's not time to). When it triggers, connect your BT device and let the rest of your macro do its job!

This should help you. Good luck
 
1) Your 1st macro:
To prevent from firing when the "myPhonak" app is already running you could add a constraint Application Running > Not in Foreground, if this app remains in foreground when running. Otherwise, I'm wondering why this app should still run if your hearing aid is out of range...

2) Your 2nd macro:
- I would join it with the 1st one
- Add your Day/Time trigger and set a boolean variable "ReadyToConnect" to True
- Add your Geofence trigger with "ReadyToConnect" constraint to True (to avoid triggering if it's not time to). When it triggers, connect your BT device and let the rest of your macro do its job!

This should help you. Good luck
OK, 1) The app runs in the background, opening it up simply brings it to the foreground, it runs regardless of the device being connected or not (once it has been opened the first time). 2)The BT would already be connected and on, it is simply a different program that I wish it to select on Sunday, could I still implement it somehow?
 

Dm114

Well-known member
OK, 1) The app runs in the background, opening it up simply brings it to the foreground, it runs regardless of the device being connected or not (once it has been opened the first time). 2)The BT would already be connected and on, it is simply a different program that I wish it to select on Sunday, could I still implement it somehow?
How do you select programs? I guess you'll have to use UI Interaction.
 

Dm114

Well-known member
Yes, once I select a program, it remains on that program until either the device is powered off, or I manually change it.
To manually change programs I suppose you have to select various options by pressing buttons or fields on the screen. To do that, you'll have to use UI Interaction action.
 
To manually change programs I suppose you have to select various options by pressing buttons or fields on the screen. To do that, you'll have to use UI Interaction action.
I already have MD doing that. All I want to accomplish now is preventing the macro from running each time I go out of BT range. I also want to know with the second macro, what do I need to do to have it open the app then select the program I want if the device is already connected.
 

Dm114

Well-known member
I already have MD doing that. All I want to accomplish now is preventing the macro from running each time I go out of BT range. I also want to know with the second macro, what do I need to do to have it open the app then select the program I want if the device is already connected.
Why is it so important not to run macro several time? How your hearing aid can be out of range? Maybe when you leave it. If so why wouldn't you close the app (and run it again when in range)?

To change the program, as I told you, I guess you'll have run your app in foreground and select the right program with UI Interaction.
 

mapriex

Active member
If so why wouldn't you close the app (and run it again when in range)?
i guess @jnelsoninjax wants to keep the state alive, when in sudden the bt connection gets lost. thats my understanding.

@jnelsoninjax
i suggest a "timeout" timer before the trigger can be used again. e.g. when you watering flowers outside a timeout between 5-15min should be fine, but if its just for short connection losses, i would set it the timed out time to max. 1 or 2 mins. it depends what case the macro is disturbing.
 

Dm114

Well-known member
i guess @jnelsoninjax wants to keep the state alive, when in sudden the bt connection gets lost. thats my understanding.

@jnelsoninjax
i suggest a "timeout" timer before the trigger can be used again. e.g. when you watering flowers outside a timeout between 5-15min should be fine, but if its just for short connection losses, i would set it the timed out time to max. 1 or 2 mins. it depends what case the macro is disturbing.
Hope you are right but I'm not sure it's the case @jnelsoninjax is facing. Otherwise it would be as simple as you suggested, using Macro invoked/Not invoked constraint.

I'm wondering whether @jnelsoninjax is not speaking about running the macro once a day only. Let him tell us the reasons and cases for us to find out a solution maybe.
 
Hope you are right but I'm not sure it's the case @jnelsoninjax is facing. Otherwise it would be as simple as you suggested, using Macro invoked/Not invoked constraint.

I'm wondering whether @jnelsoninjax is not speaking about running the macro once a day only. Let him tell us the reasons and cases for us to find out a solution maybe.
Honestly the situation is simple, if I go outside without the phone, I am suddenly out of range since the phone is inside, and when I come back inside/inside range then the macro runs since the trigger is device connected, and since the macro has already run once when I first turn on the device, it has already selected the program, and that does not change even if I am out of range. Perhaps it would be better if I simply programmed the macro to only run once a day, since I do not turn off the device except when I am going to bed.
 

Dm114

Well-known member
Honestly the situation is simple, if I go outside without the phone, I am suddenly out of range since the phone is inside, and when I come back inside/inside range then the macro runs since the trigger is device connected, and since the macro has already run once when I first turn on the device, it has already selected the program, and that does not change even if I am out of range. Perhaps it would be better if I simply programmed the macro to only run once a day, since I do not turn off the device except when I am going to bed.
I think it's the simplest and probably the only solution to solve this problem as it's not possible anymore to know if an app is running or not. The only state we can check is whether it is running in foreground or not but not running (in background) or not running.
 
I think it's the simplest and probably the only solution to solve this problem as it's not possible anymore to know if an app is running or not. The only state we can check is whether it is running in foreground or not but not running (in background) or not running.
It doesn't matter once it runs once, the app is a TSR (terminate, stay resident) so once it is opened the first time, it is running. So with that in mind, what do I need to add to the macro to have it only run once a day?
 

Dm114

Well-known member
It doesn't matter once it runs once, the app is a TSR (terminate, stay resident) so once it is opened the first time, it is running. So with that in mind, what do I need to add to the macro to have it only run once a day?
As far as I understand I think you just need to launch the app (and connect the device) once a day (at boot time for instance) and (re)connect the device every time it is disconnected.
 
As far as I understand I think you just need to launch the app (and connect the device) once a day (at boot time for instance) and (re)connect the device every time it is disconnected.
No, it does not need anything once it reconnects, since the app is running in the background it will still run, and as far as when I go outside the range, there is no change in the sound (the program does not change), so it does not need to run again. The macro would only need to run once as soon as the device is powered up, and the only other time that I would need to change anything would be on Sunday between 0930-1200 while at church, I need to different program running, which is what I have the second macro for, but you are suggesting that I could combine the second one into the first one, and I am fine in doing that as long as I can have it run, and then change back to the other program after noon.
 
Top