Is it possible to control an app automatically with macrodroid?!? Please help

rick86

New member
Hi,

I have a solar inverter app that only has one 'force charge' period (see attached - setting is self consumption charge time)

I would like to set up an automated process that will allow me to take advantage of free electricity in the early hours of the morning to charge my home battery.

For example tomorrow morning my energy will be free at these times but I will be asleep.

00.00-00.30

01.00-01.30

02.30-03.00

I can tell my inverter to charge between 00.00-00.30 before I go to sleep but I need an app or something to tell my inverter to charge again at the other two times. Is this possible?

Obviously I can manually do It but I need to sleep 😂

Kind regards,

Derick inbound9208961974513806746.png
 

Attachments

  • inbound2816090281662507135.png
    inbound2816090281662507135.png
    520.6 KB · Views: 9

Yogi

Member
Hi,
I am not an Android nerd just a little experienced in automation.
If the app to be automated has the possibility to receive a broadcast would be best - I think it could do the job also in background. So consult the programmer for this option.
The other option is with UI action. The phone has to be unlocked and screen on. This could be achieved through at least developer options "device screen on during loading".
You have to set the trigger for the times the macro should run.Then action application run and then the UI click actions for each step what you would do to achieve the desired action. A good idea is to set a wait action between the actions so it becomes reliable.
Hope it helps
Regards
Fritz
 

rick86

New member
Hi,
I am not an Android nerd just a little experienced in automation.
If the app to be automated has the possibility to receive a broadcast would be best - I think it could do the job also in background. So consult the programmer for this option.
The other option is with UI action. The phone has to be unlocked and screen on. This could be achieved through at least developer options "device screen on during loading".
You have to set the trigger for the times the macro should run.Then action application run and then the UI click actions for each step what you would do to achieve the desired action. A good idea is to set a wait action between the actions so it becomes reliable.
Hope it helps
Regards
Fritz
Hi Fritz,

Thanks for your response.

FYI, there is an app and also a web interface (desktop browser) where I can adjust the inverter settings, just incase that makes it more achievable. See attached.

I could install the app on an old phone and leave it permanently running (screen on) or we could use the desktop version?

How do you create a macro to tell the app what to do?

Kind regards,

Derick
 

Attachments

  • app interface.jpg
    app interface.jpg
    274.8 KB · Views: 7
  • desktop interface.png
    desktop interface.png
    160 KB · Views: 6

Yogi

Member
>>How do you create a macro to tell the app what to do?
Hi Derick,
Create the macro
Name the macro
add a trigger "Day/Time Trigger", check the days and the time you need it running
add an action "Launch Application" check "Force new" so it always starts from the beginning
add an action "Wait before next action" with about 2 (depends on our device) seconds to allow the app to be started

then you have to use the "UI Interaction->click" actions
Select the "Click" - first option in "UI Interaction"
Select the "Identify in app" option and press "OK"
you will get a MD notification you should click on if you are in the app
and in the right position to take the next manual click.
If you are there and click the notification ("Identify UI control")
it says you should now touch a control - you should do that with
a tap on the control - if the position you tapped is a control
you get a toast msg with the ID of the control (if no ID should be no
problem) and you should be back in MD. The action just created shows
e.g. "UI Interaction Click [id:xxxxx]
If no ID it stores the position.

Then again action "Wait before next action"
and repeat the steps till you are done.

You can add also Constraints like "Not in Call" etc.
in case the macro should not run in Calls, I know you
are sleeping at that time but who knows 😇

It could look like:

Screenshot_20231228-141241_MacroDroid.jpg

Regards,
Fritz
 

rick86

New member
Hi Fritz,

Thanks for your detailed response.

Can the macro be told to click on the 'charge set time' to enter for example 00.00 and then click on the 'charge end time' to enter for example 00.30 and then finally click on the button saying 'SETUP' to programme it?

It will need to do the above sequence MULTIPLE times a day BUT each time setting a different 'charge set time' and 'charge end time'. Each time set will also need the previous time to have elapsed to avoid overruling the set parameter.

I would need to be able to easily adjust the macro every morning to tell it which times to charge at (depending on when the rates are cheap)

Will this be suitable for me or too long winded?

Kind regards,

Derick
 

Yogi

Member
Hi Derick,
It depends...

Try the steps I wrote with the "UI Interaction->Click" and see if there is a text cursor
to put text in. If so you can take the
"UI Interaction->Paste->Custom Text" action with "Clear existing content" checked
and see if this works for you.

This steps I wrote is just a hint, you have to work out it with your app and see what happens
if you do 1 step, try and error.
if not ok, try a different way, if ok next step ...

If the UI problem is done then you can go for how you set the triggers and how you
keep the last valid time. In your first post you were supposed to sleep, now it seems
you like to have it all day ...
Regards
Fritz
 

rick86

New member
Hi Fritz,

I'm struggling to set up the macro.

I can get the macro to open the app but it seems to ignore recording the on screen button presses to navigate to the correct part of the app.

I must be doing something wrong, can you help?

I'm willing to donate to you via PayPal if you can set me up a usable macro :)

Kind regards,

Derick
 

Endercraft

Moderator (& bug finder :D)
Hi Fritz,

I'm struggling to set up the macro.

I can get the macro to open the app but it seems to ignore recording the on screen button presses to navigate to the correct part of the app.

I must be doing something wrong, can you help?

I'm willing to donate to you via PayPal if you can set me up a usable macro :)

Kind regards,

Derick
Don't worry, nobody ever asks for money here or accepts it (apart from someone who has received much criticism).
 

rick86

New member
Maybe in an hour, I'll take a closer look. In the meantime, what is your problem exactly?
Hi, sorry for the late reply.

I am trying to set up the macro, I can get it to open an app, however I need to get the macro to recognise gesture presses to reach a certain page where I need settings changing, I am struggling to get the macro to recognise me touching the screen to reach the correct page.
 

Endercraft

Moderator (& bug finder :D)
I wonder, what's the name of your inverter? There might be a simple way of automating changes without having to use any interaction.
 

Dhruv Chauhan

New member
Hi, sorry for the late reply.

I am trying to set up the macro, I can get it to open an app, however I need to get the macro to recognise gesture presses to reach a certain page where I need settings changing, I am struggling to get the macro to recognise me touching the screen to reach the correct page.
If you need to verify for the correct page, you can use read screen action to check for texts in variable for the specified screen, if there are some fixed titles in that screen. you can continue the process, if not repeat the process from first.

also If there is any api for your inverter to set up charge time, that would be a lot easier.
 

Yogi

Member
@All Thanks for jumping in
Everyone has a different background how to solve problems, different knowledge,
so it is a good idea to have help from more than one member.

I was helped in the past on different platforms so try also to give back a little bit.
As stated above it has nothing to do with money. Of course it is time which is valuable 😊

@Derick So if there is a problem which you encounter describe it at best also with a screenshot
and also a screenshot of the actions already tried.

Even if we have the same app running and have a working macro for it does not mean the macro
works on every phone 🙈

Good luck,
Regards
Fritz
 
Top