Dim screen then wakeup with a touch of the screen

Andy-in-Ireland

New member
I am pretty rubbish at this at the moment.

Scenario , to make my screen 'always on' - so I downloaded an always on app from the android play store and it has a facility to'Dim' the screen after a while but it wont do that on my phone for some reason ... well the app wont.

So I decided to have a go at writing a macro to do it :

1706824215099.png

so wait 5 seconds - wait 5 second until brightness , that part seems to work OK . But then I am stuck on how to wake it back up to either 50% brightness or auto brightness if I press the screen (is it an 'if clause' I have to use? ) and then continue to dim screen after 5 seconds again to 5%

Any ideas please what commands/trigger/actions I should be using?

Thanks,
Andy.
 

mapriex

Active member
am i understand you right that you want with a touch on the screen that it goes on normal brightness and after 5 sec low brightness?
 

Andy-in-Ireland

New member
am i understand you right that you want with a touch on the screen that it goes on normal brightness and after 5 sec low brightness?

Yes thats right - screen on always (until I disable/lock the phone manually) and go dim after 5 seconds so screen is still on but faint, but as soon as I touch screen 50% Brightness or auto brightness - then when I stop pressing screen after 5seconds screen goes dim again until I touch screen again.

Useful for keeping phone screen on when I want to , but going dim to save burn-in on screen and save battery power - whilst having phone unlocked and ready to go
 

LF0

Member
You can try using this app to protect your screen, and it can be used as a plugin in macrodroid

Or you can try using the UI click trigger, setting it to work in all apps, and setting the text that needs to be matched to "*"

The macro will be triggered when you click on any interactable text on the screen
You can use it to brighten the screen and add constraints to prevent it from repeating triggers
 

Andy-in-Ireland

New member
You can try using this app to protect your screen, and it can be used as a plugin in macrodroid

Or you can try using the UI click trigger, setting it to work in all apps, and setting the text that needs to be matched to "*"

The macro will be triggered when you click on any interactable text on the screen
You can use it to brighten the screen and add constraints to prevent it from repeating triggers


Thanks for the answer - tried blackr and it no good for what i want to achieve.

So getting back to macrodroid I cannot find a trigger for UI click trigger. Is it supposed to be here?:

1707494858779.png
 

Andy-in-Ireland

New member
This is where I am at this morment and it works!

1707512776340.png

However I need (well not need, Like) it to go to normal brightness screen as soon as I touch the screen ... and then when I finish touching the screen to wait 1mnute and then set the screen to 7% brightness.

I would have thought it could be as easy as

Trigger - if screen touched then
Brightness Auto
wait 1 minute
Brightness 7%
 

Wibbly

Active member
Rather than touching the screen maybe using the proximity sensor as a trigger will be a workable solution.
 

Wibbly

Active member
So I have now implemented a screen saver that works the way you want. Dims the screen after a delay and wakes it up when I touch it. I used the Floating Text action to create a large surface to touch to clear the dimmed screen. Just fill it with random text and make it transparent. You can make it execute a macro when touched to restore the screen brightness and clear the Floating Text.

My use case is a screen saver for when using the phone in the car and my macro(s) also integrate automatically waking the screen when approaching a turn using Google Maps, or when popping up the next track details when Spotify is playing (also with Floating Text), so a bit more than you're trying to achieve. How close to the next turn is related to my current speed, and the screen goes darker if it's particularly bright when the delay is over and screen is dimmed again

The only issue is the max size of Floating Text is limited so, in effect, you can't touch the edges of the screen to wake it up. Fortunately in practice this doesn't seem to affect the user experience much as it's natural to go for the centre of the screen to wake it up.

I tried using the proximity sensor to also manually wake the screen when moving my hand towards the sensor, which was effective, but I was getting some false triggers when it was hot and cool air was blowing around the phone (from the aircon in the car).

Asks would be:
- allow the size of Floating Text to extend to the whole screen
- allow the Spotify trigger to write the album cover art to a file
- allow Floating Text to include an image file (perhaps via its html feature). I would then display the track details including the album cover art when a new track is played 👍

Anyway, I hope the above helps.
 
Last edited:

Wibbly

Active member
I used only MD in the end. To get the screen very near blank and be able to tap to restore the screen, I used 3 actions

1000007778.png
The Floating Text (which I made as big as MD allows and has zero opacity) has an 'invoke macro on click' feature that I configured run another macro that reverses the Dim Screen and System Settings actions you see. Various conditions, triggers and a stopwatch timer control automatic dimming and wake up of the screen too.

In my case this was all to dim the screen between turns when using Google Maps, by acting on the Google Maps notification and monitoring the current speed.
 

polyworksgames

New member
Hi. OK. I have MD now and am working to figure it out. Would you mind sharing screen shots of the triggers and actions for both of the macros that you're using? That would help a lot.
 

Wibbly

Active member
I'm not sure it will help as they're intimately tied up with the Google Maps features. Is they what you're trying to do too (dim screen between turns when using Google Maps)?

The flows are all undocmented too.
 

polyworksgames

New member
Oh. No. I have a tablet that's being used for IoT control of a room. I'd like to have two macros: one that dims the screen after n seconds and then one that restores the brightness on touch. My questions are:
  • What is the trigger for the dimming macro that you have above? Is it simply "Screen on"?
  • For the macro that TouchToCancel triggers, what are the trigger(s) used? That's the main point that I have a disconnect on
  • I'm able to enter the Floating Text, but the OK button is always disabled. What setting am I missing in it? (it's a hair-pull because I feel like I'm missing something obvious, but am just not seeing it) nm: was missing the identifier.
Also, I'm able to test macros, but after leaving the app, they don't seem to be active. They are enabled in the Macros list. Is there something that I'm missing?

Thanks for the help!
 
Last edited:

polyworksgames

New member
@Wibbly OK. I think I mostly have it working. See screenshot. When running "test macro" on the "Dim" macro it all seems to operate as-expected. The only piece I'm missing is how to activate this once leaving the MD app.

md-macros.jpeg
 

polyworksgames

New member
@Wibbly never mind on the previous question. I got it all working by adding a trigger to the Brighten macro that starts the Dim macro again. Thanks for the help! It's functioning (though "brightness 0%" is far from zero.
 
Top