Constraint to Trigger or Multiple Constraints?

redmed

New member
I have a macro that I have been using to turn the volume of the ringer and notifications off when the church's WIFI is detected. Another macro turns the volume back up once the vehicle's bluetooth is detected. Recently the churches WIFI signal has become stronger, So whenever I drive past the church the churches WIFI is detected and the volumes are turned down. The volume stays down until I shut down the vehicle and restart it, sometimes I may drive for a hour or more with the volume off. I could add a macro that detects that Activity In Vehicle and a constraint of volume low to turn the volume back up. I have done this in the past but that causes that macro to continually poll. That's why I came up with the Vehicle bluetooth detected macro to turn the volume back up instead.

The existing macro to turn the volume off is:
Trigger=SSID in range(churches WIFI)
Action=Volume Change "Turn the ringer and notification volume off"
Constrant= volume on

I plan to add another constraint. Vehicle bluetooth NOT connected. Would it be better to add this constraint to the trigger OR have a multiple constraint? Volume On AND Vehicle bluetooth NOT connected? I'm trying to limit the amount of polling MacroDroid does.
 

Qarboz

Well-known member
I have a macro that I have been using to turn the volume of the ringer and notifications off when the church's WIFI is detected. Another macro turns the volume back up once the vehicle's bluetooth is detected. Recently the churches WIFI signal has become stronger, So whenever I drive past the church the churches WIFI is detected and the volumes are turned down. The volume stays down until I shut down the vehicle and restart it, sometimes I may drive for a hour or more with the volume off. I could add a macro that detects that Activity In Vehicle and a constraint of volume low to turn the volume back up. I have done this in the past but that causes that macro to continually poll. That's why I came up with the Vehicle bluetooth detected macro to turn the volume back up instead.

The existing macro to turn the volume off is:
Trigger=SSID in range(churches WIFI)
Action=Volume Change "Turn the ringer and notification volume off"
Constrant= volume on

I plan to add another constraint. Vehicle bluetooth NOT connected. Would it be better to add this constraint to the trigger OR have a multiple constraint? Volume On AND Vehicle bluetooth NOT connected? I'm trying to limit the amount of polling MacroDroid does.
You can edit the macro with bluetooth by adding an action that disables the "churches volume down" macro. Also add bluetooth disconnected trigger that start action enable "churches volume down" macro
 

redmed

New member
You can edit the macro with bluetooth by adding an action that disables the "churches volume down" macro. Also add bluetooth disconnected trigger that start action enable "churches volume down" macro
That was the first thing I tried and it did not work out. Because as I drove by it would drop the volume and by the time the drop volume macro ended it did not recognize the WIFI disconnected trigger to raise the volume again. That's why I had to start using constraints. The length of time I went in and out of WIFI was so short as I drove by.
 

dhj49er

Well-known member
In your original macro add a check of the wifi signal strength.
Put the signal strength in a variable using the magic text (wifi_strength).
When entering the church find the signal strength...typically it should be in the range -20dbm to -40dbm.
When driving past the church the value should be considerably lower, probably in the range -60dbm to -80dbm.
This can be a manual check and only needs to be performed once, unless the church increases its wifi signal again.
It's important that there a significance difference in the two readings.
If so, in the macro
If signal strength is >-40 set the vol etc.
Else if do nothing.
The do nothing could be changed to monitor the signal strength every x seconds to confirm the low level. This could be useful to use when driving to the church and parking. Initially the strength will be low and increase as you approach the church, allowing the macro to set the vol etc.
Rather than monitor every x seconds , this could be achieved with a wait for trigger on signal strength less than -40 and a time out (= to the time to drive past the church or park the car, whichever is longest).
Finally you can use the low signal strength when you leave the church to set the vol back on. No need for the bluetooth macro.
 
Last edited:

Dm114

Well-known member
I have a macro that I have been using to turn the volume of the ringer and notifications off when the church's WIFI is detected. Another macro turns the volume back up once the vehicle's bluetooth is detected. Recently the churches WIFI signal has become stronger, So whenever I drive past the church the churches WIFI is detected and the volumes are turned down. The volume stays down until I shut down the vehicle and restart it, sometimes I may drive for a hour or more with the volume off. I could add a macro that detects that Activity In Vehicle and a constraint of volume low to turn the volume back up. I have done this in the past but that causes that macro to continually poll. That's why I came up with the Vehicle bluetooth detected macro to turn the volume back up instead.

The existing macro to turn the volume off is:
Trigger=SSID in range(churches WIFI)
Action=Volume Change "Turn the ringer and notification volume off"
Constrant= volume on

I plan to add another constraint. Vehicle bluetooth NOT connected. Would it be better to add this constraint to the trigger OR have a multiple constraint? Volume On AND Vehicle bluetooth NOT connected? I'm trying to limit the amount of polling MacroDroid does.
If you only have 1 trigger you can either add a constraint (car BT not connected) at the trigger level or at the general macro level.
 

redmed

New member
In your original macro add a check of the wifi signal strength.
Put the signal strength in a variable using the magic text (wifi_strength).
When entering the church find the signal strength...typically it should be in the range -20dbm to -40dbm.
When driving past the church the value should be considerably lower, probably in the range -60dbm to -80dbm.
This can be a manual check and only needs to be performed once, unless the church increases its wifi signal again.
It's important that there a significance difference in the two readings.
If so, in the macro
If signal strength is >-40 set the vol etc.
Else if do nothing.
The do nothing could be changed to monitor the signal strength every x seconds to confirm the low level. This could be useful to use when driving to the church and parking. Initially the strength will be low and increase as you approach the church, allowing the macro to set the vol etc.
Rather than monitor every x seconds , this could be achieved with a wait for trigger on signal strength less than -40 and a time out (= to the time to drive past the church or park the car, whichever is longest).
Finally you can use the low signal strength when you leave the church to set the vol back on. No need for the bluetooth macro.
Thanks, This is probably the answer to ignore the signal from the street!
 

redmed

New member
If you only have 1 trigger you can either add a constraint (car BT not connected) at the trigger level or at the general macro level.
That is my original question. What is the difference between a constraint at the trigger or a macro constraint?
 

redmed

New member
In your original macro add a check of the wifi signal strength.
Put the signal strength in a variable using the magic text (wifi_strength).
When entering the church find the signal strength...typically it should be in the range -20dbm to -40dbm.
When driving past the church the value should be considerably lower, probably in the range -60dbm to -80dbm.
This can be a manual check and only needs to be performed once, unless the church increases its wifi signal again.
It's important that there a significance difference in the two readings.
If so, in the macro
If signal strength is >-40 set the vol etc.
Else if do nothing.
The do nothing could be changed to monitor the signal strength every x seconds to confirm the low level. This could be useful to use when driving to the church and parking. Initially the strength will be low and increase as you approach the church, allowing the macro to set the vol etc.
Rather than monitor every x seconds , this could be achieved with a wait for trigger on signal strength less than -40 and a time out (= to the time to drive past the church or park the car, whichever is longest).
Finally you can use the low signal strength when you leave the church to set the vol back on. No need for the bluetooth macro.
How do I do that? How do I query the wifi signal strength?
 

dhj49er

Well-known member
Create a new integer variable - global if you need to use it in more than 1 macro.

After inputting the variable name, set the value to expression. Click on the block to the right and a scrollable list of variables and magic texts will appear. Select wifi signal strength.

The result should be like the attached screenshot - note I've created a local variable and run test action to get the signal strength.
 

Attachments

  • Screenshot_20230702_175722_MacroDroid.jpg
    Screenshot_20230702_175722_MacroDroid.jpg
    224.1 KB · Views: 8
Last edited:

redmed

New member
Create a new integer variable - global if you need to use it in more than 1 macro.

After inputting the variable name, set the value to expression. Click on the block to the right and a scrollable list of variables and magic texts will appear. Select wifi signal strength.

The result should be like the attached screenshot - note I've created a local variable and run test action to get the signal strength.
I have been working with variables and found MacroDroid options I did not know existed. Was trying to figure out how to load the variable with the WiFi signal strength value when I thought that may not be much different than another avenue I was pursuing. I was constraining the action while the vehicles Bluetooth was present. This works to stop the action (turning off the volume) but once inside the church the trigger (SSID in range) was already triggered and the rest of the time in the church not triggered again, because the SSID was already in range. But while in the church I noticed that it did not trigger again and had a idea. Just put a 5 minute wait before the action. I made the change and drove back to the church again and it worked. The WiFi in range caused the macro to start and the first thing it did was wait 5 minutes. After the wait the the action (volume change) worked even though the vehicle Bluetooth constraint was still on. But by then I was already out of the vehicle. So aperrantly the constraint works on the action not at the time of trigger. I still have to drive by the church and see if the wait I added will cause the action when I'm 5 minutes down the road to be constrained by the vehicle Bluetooth.
 

dhj49er

Well-known member
Have you established what the wifi signal strength is near the church and in the car?

if so, what are the values?
 

redmed

New member
No. I was playing with the syntax by getting the signal strength of my home WiFi . I have not figured out the syntax yet. While doing this I thought about adding a constraint of the presence my vehicle's Bluetooth and that would produce a similar result of testing the signal strength. So I setup a macro triggered by the churches WiFi coming into range and two constraints 1: the volume level > 70 and 2: the presence of the vehicle's Bluetooth. So if the churches WiFi is initially detected the volume are reduced only if the volume is on and I'm not in the car. That is what it did, but what I didn't think of was that the initial WiFi detection only happens once. That's when I thought of delaying the action (Wait 5 minutes) until I'm inside the church. That worked as I hoped and I think the 5 minute wait will also stop the volume drop as I'm 5 minutes down the road with the vehicle's Bluetooth on. I'm going to test passing the church tomorrow. While I'm there I'll get the signal strength in the churches parking lot and driving by. As I'm writing this I'm thinking the signal strength may not be that much different between driving by and the parking lot. I need to measure the signal strength inside the church, something I have to wait until Sunday to do. I want to pursue loading the signal strength value into a variable to increase my knowledge of how MacroDroid functions and testing the signal strength could be useful. I already found out that the constraint's are linked to the action not the trigger.
 

Endercraft

Moderator (& bug finder :D)
If the constraint of the car's Bluetooth is on the volume action after the wait it should work fine.
 
Top