Help with a macro

I haven't seen your macro but I suppose this boolean variable is set to False when hearing aid is NOT connected. It's the reason why I made this suggestion to set this variable accordingly to the connection.

If this variable reflects the BT state, wouldn't it be possible to test this state instead?

I don't want to interfere with your macro so if my suggestions are not useful, don't take them into account.
I am going to leave it alone for now, as @dhj49er said. It should reset tonight and be OK for tomorrow, it was just a minor upset to have to manually switch to the different programs, as I was expecting the macro to take over.
The whole reason for doing the macro this way is to prevent it from triggering each time the device state changes back to connected, as sometimes I go outside with the phone and therefor am out of the BT range, and when I would come back in, it would always run again.
 

dhj49er

Well-known member
@dhj49er The macro did not run this morning. What could be causing this problem
Have you looked at the System Log?

Examining the system log after a macro has run is essential, even if the macro works and especially if the macro doesn't work.

The log will show you what MD has done and importantly what it hasn't done, which might be something you were expecting a macro to do.

When viewing the system log make sure the constraints box is ticked.

What to look for?
What happened yesterday when you went to church - did the macro run?
(I wrote the macro assuming you would be going to church every day. If this is not the case, you will need to either specify the day(s) of the week you go to church in the 12:00 and 15:00 triggers or just delete these triggers and rely on Geofence to determine when you are at Church)
Did the macro run last night at 22:00?
Was the variable HAC set to false?
Is the HA connected trigger present this morning?
if so, was the screen on or off when it fired?
If not, check the phone settings.
 
OK, I only go to church on Sunday, and the log shows: Did not invoke because the constraint failed. Yes, it ran at 2200 yesterday. Is there a way to program the macro so it fires even if the screen is off?
 

dhj49er

Well-known member
OK, I only go to church on Sunday, and the log shows: Did not invoke because the constraint failed. Yes, it ran at 2200 yesterday. Is there a way to program the macro so it fires even if the screen is off?
Change the day/time triggers for 12:00 and 15:00 to Sunday only (untick all the other days)

Did not invoke because the constraint failed....is this the first trigger?

If so, look in the log and find when the HAC variable is being set true - between 22:00 the previous night and in the morning when it didn't invoke.

Are you sure you aren't accidentally connecting the hearing aids before the screen is on, as this would cause the problem you are seeing.

The triggers in the macro will fire with the screen off. The issue is the use of UI actions to set the HA program, that needs the screen on.

Next bit is off (macro) topic.

I have Oticon hearing aids with a few programs. When they are switched on, the default program is always selected. I do not need to change programs.

Do your Phonaks do the same?

If so, why are you changing program at the start of each day?

I have macros that change HA program and they all use UI actions. I wouldn't try to trigger these macros in the way you are doing. I prefer to manually invoke the macros, as the phone has to be on anyway for the macros to run.

If you aren't using the MD Drawer, I would strongly suggest you look to using it. You can add macros and when the drawer is opened and the macro name touched, the macro runs. Very easy and very convenient
 
Change the day/time triggers for 12:00 and 15:00 to Sunday only (untick all the other days)

Did not invoke because the constraint failed....is this the first trigger?

If so, look in the log and find when the HAC variable is being set true - between 22:00 the previous night and in the morning when it didn't invoke.

Are you sure you aren't accidentally connecting the hearing aids before the screen is on, as this would cause the problem you are seeing.

The triggers in the macro will fire with the screen off. The issue is the use of UI actions to set the HA program, that needs the screen on.

Next bit is off (macro) topic.

I have Oticon hearing aids with a few programs. When they are switched on, the default program is always selected. I do not need to change programs.

Do your Phonaks do the same?

If so, why are you changing program at the start of each day?

I have macros that change HA program and they all use UI actions. I wouldn't try to trigger these macros in the way you are doing. I prefer to manually invoke the macros, as the phone has to be on anyway for the macros to run.

If you aren't using the MD Drawer, I would strongly suggest you look to using it. You can add macros and when the drawer is opened and the macro name touched, the macro runs. Very easy and very convenient
So I did change the days to just Sunday. I'll share a screenshot of the log, and the Phonak hearing aid automatically chooses a default program that the audiologist would've programmed, and it is too loud (too much background noise) that it what the custom program does, it changes the focus of the hearing aid so that the background noises are filtered out.
Screenshot_20240122-130645.png
 
It tells me that it did not run because of the constraint. The constraint is Day of Week Sunday. Can I disable or remove the constraint, if I read the rest of the macro correctly, on Sunday it should trigger due to the Geo-fence, which according to the log, it does recognize the geo-fence and triggers as it is supposed to. Otherwise, everything else ran as it is supposed to, the only error was due to the constraint.
 

dhj49er

Well-known member
What is the state of the variable HAC?

Open the macro in edit screen and you'll find it in the variables tab at the bottom.
 

dhj49er

Well-known member
Look in the system log ...search for HAC to see when it changes state.

I assume the 22:00 day/time trigger has yet to happen.

You can change the state to false manually or wait for the trigger.

In the morning before connecting your HA, check HAC state in the macro. It needs to be false.
 
Look in the system log ...search for HAC to see when it changes state.

I assume the 22:00 day/time trigger has yet to happen.

You can change the state to false manually or wait for the trigger.

In the morning before connecting your HA, check HAC state in the macro. It needs to be false.
So at 2200 yesterday it shows HAC Updated value from true to false, then at 2206 it shows HAC Updated value from false to true
 
Yes, that is exactly what happened, I was outside and traveled outside the BT range. I am going to adjust that time to 2300 just to prevent that from happening
 
Top