Author Topic: Voxcommando to control Android using ADB?  (Read 2401 times)

0 Members and 1 Guest are viewing this topic.

monkee

  • $upporter
  • Jr. Member
  • *****
  • Posts: 40
  • Karma: 4
    • View Profile
Voxcommando to control Android using ADB?
« on: December 06, 2022, 04:39:52 AM »
Hi, I'd like to use VC to control my Android device using ADB over my home network.  This should be possible but is broadcasting ADB commands over the network something Voxcommando can do?  Maybe with a plugin?

I'm using a Shield TV and want to control Play/Pause/rewind etc via voice.  I know how to do it, including using this handy app: Minimal ADB and Fastboot, (more info here and here) to send the ADB over the network and without rooting the android device too, but it would be much better to do it straight from VC. 

Thanks in advance!
Kevin

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Voxcommando to control Android using ADB?
« Reply #1 on: December 06, 2022, 03:06:24 PM »
I don't know much about sending ADB commands or the protocols involved but I  doubt it is something that you cando  directly from VC unless there is a python script that works in IronPython.

But if you are able to send commands using a command prompt then I woud try to initiate them from VC the way we do other command prompt actions.

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: Voxcommando to control Android using ADB?
« Reply #2 on: December 07, 2022, 02:23:51 PM »
I tried this a few years back and wasn't able to get it to work.

you could look into Join by joaoapps and tasker, I'm not sure how well it will work as a remote structure though.

Join has a rest Api so you can use it with VC, I use it for notifications, and tasker actions.

your work flow might be something like this:

VC (Join API(Tasker actions)) > Tasker (on Shield TV) > Tasker send ADB cmd.

Join and Tasker are paid apps, I paid $3.00 USD each I believe.


Join Actions group:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.3.0.3-->
<commandGroup open="False" name="Join - Notifications" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="746" name="Join Basic Notification" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1}= Device Name&#38;#xD;&#38;#xA;{2}=Title&#38;#xD;&#38;#xA;{3}=Text&#38;#xD;&#38;#xA;{4}=Icon&#38;#xD;&#38;#xA;{5}=Notification Bar Icon">
    <action>
      <cmdType>Tools.Encode.URI</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceNames={1}&amp;text={3}&amp;title={2}&amp;icon={M:JoinNotification.{4}}&amp;smallicon={M:JoinNotification.{4}Icon}&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Join.Notification</event>
  </command>
  <command id="809" name="Join Tasker Command" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1}= Device Name&#38;#xD;&#38;#xA;{2}= Tasker command (text)">
    <action>
      <cmdType>Tools.Encode.URI</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceNames={1}&amp;text={2}&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Join.Tasker</event>
  </command>
  <command id="810" name="Join Tasker (all Androids)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1}= Tasker command">
    <action>
      <cmdType>Tools.Encode.URI</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceId=group.android&amp;text={1}&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Join.Tasker.Group</event>
  </command>
  <command id="817" name="Join android App" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1}= Device Name&#38;#xD;&#38;#xA;{2}= App Name">
    <action>
      <cmdType>Tools.Encode.URI</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceNames={1}&amp;app={2}&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Join.Android.App</event>
  </command>
  <command id="846" name="Join Set Device Clipboard" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1} Device name&#38;#xD;&#38;#xA;{2} Tasker &quot;Event&quot;">
    <action>
      <cmdType>Tools.Encode.URI</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceNames={1}&amp;clipboard={2}&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Join.Clipboard</event>
  </command>
  <command id="812" name="Join Say" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1}= Device Name&#38;#xD;&#38;#xA;{2}= What to say">
    <action>
      <cmdType>Tools.Encode.URI</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceNames={1}&amp;say={2}&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Join.Say</event>
  </command>
  <command id="789" name="Join set volume Android Devices" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceId=group.android&amp;mediaVolume=100&amp;ringVolume=100&amp;alarmVolume=100&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
  </command>
  <command id="844" name="Join Link" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="NOTIFICATION&#38;#xD;&#38;#xA;{1}=Device Name&#38;#xD;&#38;#xA;{2}=Title&#38;#xD;&#38;#xA;{3}=Text&#38;#xD;&#38;#xA;{4}=Icon&#38;#xD;&#38;#xA;{5}=url">
    <action>
      <cmdType>Tools.Encode.URI</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceNames={1}&amp;text={3}&amp;title={2}&amp;url={5}&amp;dismissOnTouch=true&amp;icon={M:JoinNotification.{4}}&amp;smallicon={M:JoinNotification.{4}Icon}&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Join.Link</event>
  </command>
</commandGroup>

there are multpile commands in the group above they will all require your Join API key,

replace {M:apiKeys.Join} with your API Key

monkee

  • $upporter
  • Jr. Member
  • *****
  • Posts: 40
  • Karma: 4
    • View Profile
Re: Voxcommando to control Android using ADB?
« Reply #3 on: December 07, 2022, 04:10:56 PM »
I don't know much about sending ADB commands or the protocols involved but I  doubt it is something that you cando  directly from VC unless there is a python script that works in IronPython.

But if you are able to send commands using a command prompt then I woud try to initiate them from VC the way we do other command prompt actions.

Thanks James, if VC can't do it directly from a plugin, I was thinking I would interact with the app I linked to using batch files, triggered by VC, but it sounds like I can skip the batch files and interact with the command prompt directly from VC.  I'll have to look into that when I'm ready to give this a shot.  Thank you!

monkee

  • $upporter
  • Jr. Member
  • *****
  • Posts: 40
  • Karma: 4
    • View Profile
Re: Voxcommando to control Android using ADB?
« Reply #4 on: December 07, 2022, 04:13:03 PM »
I tried this a few years back and wasn't able to get it to work.

you could look into Join by joaoapps and tasker, I'm not sure how well it will work as a remote structure though.

Join has a rest Api so you can use it with VC, I use it for notifications, and tasker actions.

your work flow might be something like this:

VC (Join API(Tasker actions)) > Tasker (on Shield TV) > Tasker send ADB cmd.

Join and Tasker are paid apps, I paid $3.00 USD each I believe.


Join Actions group:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.3.0.3-->
<commandGroup open="False" name="Join - Notifications" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="746" name="Join Basic Notification" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1}= Device Name&#38;#38;#xD;&#38;#38;#xA;{2}=Title&#38;#38;#xD;&#38;#38;#xA;{3}=Text&#38;#38;#xD;&#38;#38;#xA;{4}=Icon&#38;#38;#xD;&#38;#38;#xA;{5}=Notification Bar Icon">
    <action>
      <cmdType>Tools.Encode.URI</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceNames={1}&amp;text={3}&amp;title={2}&amp;icon={M:JoinNotification.{4}}&amp;smallicon={M:JoinNotification.{4}Icon}&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Join.Notification</event>
  </command>
  <command id="809" name="Join Tasker Command" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1}= Device Name&#38;#38;#xD;&#38;#38;#xA;{2}= Tasker command (text)">
    <action>
      <cmdType>Tools.Encode.URI</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceNames={1}&amp;text={2}&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Join.Tasker</event>
  </command>
  <command id="810" name="Join Tasker (all Androids)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1}= Tasker command">
    <action>
      <cmdType>Tools.Encode.URI</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceId=group.android&amp;text={1}&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Join.Tasker.Group</event>
  </command>
  <command id="817" name="Join android App" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1}= Device Name&#38;#38;#xD;&#38;#38;#xA;{2}= App Name">
    <action>
      <cmdType>Tools.Encode.URI</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceNames={1}&amp;app={2}&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Join.Android.App</event>
  </command>
  <command id="846" name="Join Set Device Clipboard" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1} Device name&#38;#38;#xD;&#38;#38;#xA;{2} Tasker &quot;Event&quot;">
    <action>
      <cmdType>Tools.Encode.URI</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceNames={1}&amp;clipboard={2}&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Join.Clipboard</event>
  </command>
  <command id="812" name="Join Say" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1}= Device Name&#38;#38;#xD;&#38;#38;#xA;{2}= What to say">
    <action>
      <cmdType>Tools.Encode.URI</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceNames={1}&amp;say={2}&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Join.Say</event>
  </command>
  <command id="789" name="Join set volume Android Devices" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceId=group.android&amp;mediaVolume=100&amp;ringVolume=100&amp;alarmVolume=100&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
  </command>
  <command id="844" name="Join Link" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="NOTIFICATION&#38;#38;#xD;&#38;#38;#xA;{1}=Device Name&#38;#38;#xD;&#38;#38;#xA;{2}=Title&#38;#38;#xD;&#38;#38;#xA;{3}=Text&#38;#38;#xD;&#38;#38;#xA;{4}=Icon&#38;#38;#xD;&#38;#38;#xA;{5}=url">
    <action>
      <cmdType>Tools.Encode.URI</cmdType>
      <params>
        <param>https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceNames={1}&amp;text={3}&amp;title={2}&amp;url={5}&amp;dismissOnTouch=true&amp;icon={M:JoinNotification.{4}}&amp;smallicon={M:JoinNotification.{4}Icon}&amp;apikey={M:apiKeys.Join}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Join.Link</event>
  </command>
</commandGroup>

there are multpile commands in the group above they will all require your Join API key,

replace {M:apiKeys.Join} with your API Key

Thanks so much for the additional options, I'll let you know if I get it working, one way or another!