Difficult automation. Missing feature?

ball

New member
Hi. I'm trying to automate turning on my heater at a select time. Ideally with the finished process I would click a button (home screen?), it would prompt me for a time of day, and it would turn on the heater at that time, once.

The difficulty is the way the (Android) heater app works. First you launch the app, then the app searches for the Bluetooth device and connects to it, then to turn on the heater you have to looooong press the start button, then you have to set the strength of the heater by tapping another button several times until the visual que is where you want it. I think with this last one you can click less a dozen times to bottom it out then click more a discrete number of times to make things predictable.

OK, so the other task app "Automate" has the ability to check if a Bluetooth device is connected by selecting the device by its MAC address. Macrodroid seems far less sophisticated in that you can only select paired devices. The Bluetooth heater is never paired with Android so Macrodroid's Bluetooth trigger seems unusable here, otherwise I think I could:
launch app
wait until trigger -> Bluetooth device connected
looooong press start button
press down a bunch of times to set to minimum
press up desired number of times

Of course this is less than ideal because to set the time I would have to edit the initial trigger manually each time, which is lame, but even this flow isn't possible in Macrodroid because the Bluetooth trigger isn't available. I guess I could insert a minute long delay then have it launch a minute earlier?

Any suggestions welcome
 

ball

New member
I'm losing hope that I can automate this app.

I did an adb logcat and there are no intents for this app.

I tried creating a UI interaction long press and that didn't work.

I'm starting to feel like the only way to automate this is to decompile the app
 

mapriex

Active member
I tried creating a UI interaction long press and that didn't work.
i haven't read the full post, but if you can turn on the heater with the featured app. you can automate, also time related actions, with macrodroid. especially with ui interactions.
 

ball

New member
I'm really lost, here. With Tasker AutoInput I can wait for a UI element to show up before attempting gestures. I don't see how to do this in Macrodroid
 

RSF

Well-known member
Couple options you could pursue:
  1. Use the Wait until Trigger action, with a trigger of Screen Content (specifying in that trigger which content to look for, and the heater-control app you want to look in)
  2. Call AutoInput from MacroDroid -- AutoInput is supported as a "Tasker/Locale Plugin" in MacroDroid automatically, if AutoInput's installed on your phone. This might be a good approach if you've already got actions defined within AutoInput.
 

ball

New member
I tried that, actually. I used a simple one-word term and tried all the options like overlays, view id, etc. Nothing worked.

The problem with AutoInput is its flaky otherwise I wouldn't be looking for an alternative
 

RSF

Well-known member
Try the attached, to see how that app appears to MacroDroid. The app makes a floating button appear, which, when tapped, captures the contents of the currently-visible app into a MacroDroid variable. Try it, and then look at the contents of the scrn_contents variable in the macro, to see if the UI element you're looking for appears in that variable. If it does, you could create a manual loop doing a screen-read every few seconds, looking for that value...
 

Attachments

  • Read_screen_contents_.macro
    2.6 KB · Views: 2

RSF

Well-known member
Here's a screen shot, in case the import doesn't work. Note that the Read Screen Contents action is relatively new, so for that reason as well, you'll want to be on the current version of MacroDroid.

1711314201816.png
 
Top