TL;DR
AutoInput does not click HTML buttons with an ID, even though EasySetup sees the ID and suggests it.
Background
I am making a HTML based board game timer, and I want to hook up a cheap bluetooth remote control to allow ending the current turn, passing a round etc. The remote sends VolumeUp, which I hope to capture using Tasker and AutoInput and redirect to a Click action on a button on my timer.
The Problem
The AutoInput click action times out. If I change it to find the button using the Text of the button and not the ID, then it works. Unfortunately, the 'action-play-pause' button changes the text depending on if the button is a 'Resume Game' button or 'Pause Game' button. (the id stays the same)
What I've tried so far
SGT PlayPause (this does not work)
A1: AutoInput Action [
Configuration:Type: Id
Value: action-play-pause
Action : Click Timeout (Seconds):1 Structure Output (JSON, etc):On Continue Task After Error:On
]
A2: Flash [ Text:%errmsg Long:Off ] If [ %errmsg Set ]
SGT Primary (this works)
A1: AutoInput Action [
Configuration:Type: Text
Value: End Turn
Action : Click Timeout (Seconds):1 Structure Output (JSON, etc):On Continue Task After Error:On
]
A2: Flash [ Text:%errmsg Long:Off ] If [ %errmsg Set ]
If you want to try this yourself, I've set up a very simple HTML page with these buttons here: https://parakoos.github.io/
All it is is buttons like these:
End Turn
Pass
Play Pause
The real strange thing is that the action configurations were set up using the EasySetup mode, where clicking the button correctly identifies the ID field and suggest I use it. Only, it then never actually finds it when I actually trigger the action.
Alternatives Considered
If I am unable to make Tasker click the buttons based on ID, is there a way I could get the current text of a button (based on the ID) and then use that in a variable for the click action?
Alternatively, if I could convert the VolumeUp commands to 'Enter' key presses, then I could listen to those in my app and react to them. (I already have that in place in fact.) But I don't know how to simulate Enter key presses using Tasker.
Can anyone shed some light on this situation? I'd be very grateful.