Author Topic: VC Companion Android App (Caller ID and More)  (Read 4583 times)

0 Members and 1 Guest are viewing this topic.

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
VC Companion Android App (Caller ID and More)
« on: May 19, 2018, 02:52:39 AM »
Requires VoxCommando's TCP plugin: How to Enable



This app allows you to use VC as a Caller Id and more, for android devices, Tested on 5.1.1 and higher

the app can be locked with a password up to 8 digits long (this is only used to prevent accidental changes to settings)

the app contains the following actions

    ~Basic Actions~ all basic actions trigger an event in VC except those marked with *

Missed Call           
Missed Call Speak* uses your phones default voice to say "Missed Call From Callers Name or Unsaved Number"
Incoming Call
Call Ended
Calling Out
New Text (SMS)
New Text Speak*   uses your phones default voice to say "New Text from Senders Name or Unsaved Number"
Battery Level 10%
Battery Level 20%
Battery Level 30%
Battery Level Speak* uses your phones default voice to say "Your Battery is now at 10% or 20% or 30%" can only be used if one of the other battery level actions is enabled


     ~AutoRemote~ these actions all require that you have AutoRemote Pro installed


Theater On - Turns on vibrate mode and sets media volume to 0
Code: [Select]
T^E^
Theater Off - Turns vibrate mode off and sets your media volume back to your previous level
Code: [Select]
TE^off
Ring Me -Turns your media volume to max and then shows a button that says "You Found Me" helping you to find your device, in order to use this action you will need to add "Ring Me.mp3" to /storage/emulated/0/Music/ (use your own mp3 file just rename it to "Ring Me.mp3")
Code: [Select]
Ring Me
VC to Phone Talk - This uses your phones default voice to say what ever you send your phone with AutoRemote
Code: [Select]
VCSay=:=The text you want VC Companion to say

    ~AutoVoice~  Requires AutoVoice Pro to be installed
AutoVoice Integration -  With this enabled when you launch VC Companion it will launch AutoVoice Google intergration (Microphone), If you want to change some settings while this is enabled say "Show Companion Settings" and it will show VC Companion, all other voice commands are passed to VC as android phrases.

when issuing a Voice command to VC there is an extra event triggered before the voice command "VC.COMPANION" with payload 1 being the device name

to use Kodi notifications with pictures you will need to create a folder and sub folder in your VC Folder:  VC Folder\XbmcImages\CallerID
 

The size of some text and windows may change size compared to other devices

Installation:
in order to install this app you will need to make sure you check "Unknow sources" in your security Settings on your phone (More info here)

Download the app to your android device, and click install


Change Log:
5/30/18 Fixed: on some phones New Text event was triggering for group messages with no text body, blocked event for empty text body (group messages)
« Last Edit: May 30, 2018, 12:49:18 PM by PegLegTV »

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: VC Companion Android App (Caller ID and More)
« Reply #1 on: May 19, 2018, 03:06:13 AM »
This is an example group of how I use these actions in my VoxCommando setup, if you have any questions let me know

VC Companion Group:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.4.0-->
<groupCollection open="True" name="VC Companion">
  <commandGroup open="False" name="Basic Actions" enabled="True" prefix="" priority="0" requiredProcess="" description="">
    <command id="784" name="Missed Call" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1}Caller Name (or Unsaved Number)&#xD;&#xA;{2}Caller Number&#xD;&#xA;{3}Device Name">
      <if ifBlockDisabled="False" ifNot="False">
        <ifType>(A)Contains(B)</ifType>
        <ifParams>Test Phone Peglegs Phone&amp;&amp;{3}</ifParams>
        <then>
          <action>
            <cmdType>VC.TriggerEvent</cmdType>
            <params>
              <param>Kodi Pause</param>
            </params>
            <cmdRepeat>1</cmdRepeat>
          </action>
          <action>
            <cmdType>TTS.Speak</cmdType>
            <params>
              <param>excuse me {M:VCCompanion.{3}} you have a missed call from {1}</param>
            </params>
            <cmdRepeat>1</cmdRepeat>
          </action>
        </then>
        <else />
      </if>
      <action>
        <cmdType>Results.RegEx</cmdType>
        <params>
          <param>(\d\d\d)(\d\d\d)(\d\d\d\d)$</param>
          <param />
          <param>{2}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>VCCaller</param>
          <param>{Match.1.1}{Match.1.2}{Match.1.3}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>VC.TriggerEvent</cmdType>
        <params>
          <param>Kodi Notification</param>
          <param>CallerID\{Var.VCCaller}.jpg</param>
          <param>{M:VCCompanion.{3}}-Missed Call</param>
          <param>{1} @ ({Match.1.1}) {Match.1.2}-{Match.1.3} </param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <event>VC.Companion.MissedCall</event>
    </command>
    <command id="807" name="Incoming Call" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1}Caller Name (or Unsaved Number)&#xD;&#xA;{2}Caller Number&#xD;&#xA;{3}Device Name">
      <if ifBlockDisabled="False" ifNot="False">
        <ifType>(A)Contains(B)</ifType>
        <ifParams>Test Phone Peglegs Phone&amp;&amp;{3}</ifParams>
        <then>
          <action>
            <cmdType>VC.TriggerEvent</cmdType>
            <params>
              <param>Kodi Pause</param>
            </params>
            <cmdRepeat>1</cmdRepeat>
          </action>
          <action>
            <cmdType>TTS.Speak</cmdType>
            <params>
              <param>excuse me {M:VCCompanion.{3}} you have an incoming call from {1}</param>
            </params>
            <cmdRepeat>1</cmdRepeat>
          </action>
        </then>
        <else />
      </if>
      <action>
        <cmdType>Results.RegEx</cmdType>
        <params>
          <param>(\d\d\d)(\d\d\d)(\d\d\d\d)$</param>
          <param />
          <param>{2}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>VCCaller</param>
          <param>{Match.1.1}{Match.1.2}{Match.1.3}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>VC.TriggerEvent</cmdType>
        <params>
          <param>Kodi Notification</param>
          <param>CallerID\{Var.VCCaller}.jpg</param>
          <param>{M:VCCompanion.{3}}-Caller ID</param>
          <param>{1} @ ({Match.1.1}) {Match.1.2}-{Match.1.3} </param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <event>VC.Companion.PhoneCall</event>
    </command>
    <command id="808" name="Call Ended" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1}Device Name">
      <if ifBlockDisabled="False" ifNot="False">
        <ifType>(A)Contains(B)</ifType>
        <ifParams>Test Phone Peglegs Phone&amp;&amp;{1}</ifParams>
        <then>
          <action>
            <cmdType>VC.TriggerEvent</cmdType>
            <params>
              <param>Kodi Play</param>
            </params>
            <cmdRepeat>1</cmdRepeat>
          </action>
        </then>
        <else />
      </if>
      <event>VC.Companion.CallEnded</event>
    </command>
    <command id="809" name="Calling Out" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1}Device Name">
      <if ifBlockDisabled="False" ifNot="False">
        <ifType>(A)Contains(B)</ifType>
        <ifParams>Peglegs Phone Test Phone&amp;&amp;{1}</ifParams>
        <then>
          <action>
            <cmdType>VC.TriggerEvent</cmdType>
            <params>
              <param>Kodi Pause</param>
            </params>
            <cmdRepeat>1</cmdRepeat>
          </action>
        </then>
        <else />
      </if>
      <event>VC.Companion.Calling</event>
    </command>
    <command id="810" name="New Text (SMS)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1}Texter Name (or Unsaved Number)&#xD;&#xA;{2}Texter Number&#xD;&#xA;{3}Text Body&#xD;&#xA;{4}Device Name">
      <action>
        <cmdType>Results.RegEx</cmdType>
        <params>
          <param>(\d\d\d)(\d\d\d)(\d\d\d\d)$</param>
          <param />
          <param>{2}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>VCCaller</param>
          <param>{Match.1.1}{Match.1.2}{Match.1.3}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>VC.TriggerEvent</cmdType>
        <params>
          <param>Kodi Notification</param>
          <param>CallerID\{Var.VCCaller}.jpg</param>
          <param>To {M:VCCompanion.{4}} From {1}</param>
          <param>{3}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <event>VC.Companion.TEXTMSG</event>
    </command>
    <command id="815" name="Battery Level" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Place Battery.png image in XbmcImages folder&#xD;&#xA;&#xD;&#xA;{1}Device Name&#xD;&#xA;{2}Batttery Levek [10, 20, 30]">
      <action>
        <cmdType>VC.TriggerEvent</cmdType>
        <params>
          <param>Kodi Notification</param>
          <param>Battery.png</param>
          <param>[COLOR red]Battery Warning[/COLOR]</param>
          <param>{1} Battery is at [COLOR yellow]{2}%[/COLOR]</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <event>VC.Companion.Battery</event>
    </command>
    <command id="562" name="Kodi OSD Notification" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
      <action>
        <cmdType>XJson.Raw/</cmdType>
        <params>
          <param>GUI.ShowNotification</param>
          <param>"image":"{Path.VC}\XbmcImages\{1}","title":" {2} ","message":" {3} "</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <event>Kodi Notification</event>
    </command>
    <command id="524" name="Kodi Play" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
      <action>
        <cmdType>XJson.Raw</cmdType>
        <params>
          <param>Player.GetActivePlayers</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.RegEx</cmdType>
        <params>
          <param>"playerid": (.*?),</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>XJson.Raw</cmdType>
        <params>
          <param>Player.PlayPause</param>
          <param>"playerid":{Match.1},"play":true</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <event>Kodi Play</event>
    </command>
    <command id="520" name="Kodi Pause" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
      <action>
        <cmdType>XJson.Raw</cmdType>
        <params>
          <param>Player.GetActivePlayers</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.RegEx</cmdType>
        <params>
          <param>"playerid": (.*?),</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>XJson.Raw</cmdType>
        <params>
          <param>Player.PlayPause</param>
          <param>"playerid":{Match.1},"play":false</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <event>Kodi Pause</event>
    </command>
    <command id="583" name="Create VCCompanion Map Table" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Key= Device name&#xD;&#xA;Value= what you woul like Voxcommando to show or say instead of device name">
      <action>
        <cmdType>Map.CreateTable</cmdType>
        <params>
          <param>VCCompanion</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Map.Set</cmdType>
        <params>
          <param>VCCompanion</param>
          <param>Peglegs Phone</param>
          <param>PeglegTV</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Map.Set</cmdType>
        <params>
          <param>VCCompanion</param>
          <param>Bob's Phone</param>
          <param>Bob</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </command>
  </commandGroup>
  <commandGroup open="False" name="AutoRemote" enabled="True" prefix="" priority="0" requiredProcess="" description="">
    <command id="1434" name="AutoRemote Map Setup Example" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
      <action>
        <cmdType>Map.CreateTable</cmdType>
        <params>
          <param>AutoRemote</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Map.Set</cmdType>
        <params>
          <param>AutoRemote</param>
          <param>your phone</param>
          <param>Your AutoRemote API Key for your device Goes HERE</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Map.Set</cmdType>
        <params>
          <param>AutoRemote</param>
          <param>other AutoRemote Device</param>
          <param>Your AutoRemote API Key for other device Goes HERE</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </command>
    <command id="1059" name="Theater On" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Replace {M:AutoRemote.{1}} with your api key, or use a map called AutoRemote with your device names and AutoRemote API keys &#xD;&#xA;&#xD;&#xA;I found that sending a blank AutoRemote message first, makes the messages less likely to fail&#xD;&#xA;&#xD;&#xA;T^E^ = Theater On">
      <action>
        <cmdType>Scrape</cmdType>
        <params>
          <param>https://autoremotejoaomgcd.appspot.com/sendmessage?key={M:AutoRemote.{1}}&amp;message= </param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Scrape</cmdType>
        <params>
          <param>https://autoremotejoaomgcd.appspot.com/sendmessage?key={M:AutoRemote.{1}}&amp;message=T^E^</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </command>
    <command id="1060" name="Theater Off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Replace {M:AutoRemote.{1}} with your api key, or use a map called AutoRemote with your device names and AutoRemote API keys &#xD;&#xA;&#xD;&#xA;I found that sending a blank AutoRemote message first, makes the messages less likely to fail&#xD;&#xA;&#xD;&#xA;TE^off = Theater Off">
      <action>
        <cmdType>Scrape</cmdType>
        <params>
          <param>https://autoremotejoaomgcd.appspot.com/sendmessage?key={M:AutoRemote.{1}}&amp;message= </param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Scrape</cmdType>
        <params>
          <param>https://autoremotejoaomgcd.appspot.com/sendmessage?key={M:AutoRemote.{1}}&amp;message=TE^off</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </command>
    <command id="1061" name="Ring Me" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Replace {M:AutoRemote.{1}} with your api key, or use a map called AutoRemote with your device names and AutoRemote API keys &#xD;&#xA;&#xD;&#xA;I found that sending a blank AutoRemote message first, makes the messages less likely to fail&#xD;&#xA;&#xD;&#xA;Ring Me = Ring Me (Find Device)">
      <action>
        <cmdType>Scrape</cmdType>
        <params>
          <param>https://autoremotejoaomgcd.appspot.com/sendmessage?key={M:AutoRemote.{1}}&amp;message= </param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Scrape</cmdType>
        <params>
          <param>https://autoremotejoaomgcd.appspot.com/sendmessage?key={M:AutoRemote.{1}}&amp;message=Ring Me</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </command>
    <command id="623" name="Ring Me (device found)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>Congratulations {1} has been found</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <event>RingMe.Found</event>
    </command>
    <command id="1062" name="VC to Phone Talk" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Replace {M:AutoRemote.{1}} with your api key, or use a map called AutoRemote with your device names and AutoRemote API keys &#xD;&#xA;&#xD;&#xA;I found that sending a blank AutoRemote message first, makes the messages less likely to fail&#xD;&#xA;&#xD;&#xA;VCSay=:= -- VC to Phone Talk">
      <action>
        <cmdType>Scrape</cmdType>
        <params>
          <param>https://autoremotejoaomgcd.appspot.com/sendmessage?key={M:AutoRemote.{1}}&amp;message= </param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Scrape</cmdType>
        <params>
          <param>https://autoremotejoaomgcd.appspot.com/sendmessage?key={M:AutoRemote.{1}}&amp;message=VCSay=:=What you want VC Companion to Say</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </command>
  </commandGroup>
  <commandGroup open="False" name="AutoVoice (Extras Not Required)" enabled="True" prefix="" priority="0" requiredProcess="" description="">
    <command id="1057" name="VC.COMPANION (Sender)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>Sender</param>
          <param>{1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>VC.SetEventTimer</cmdType>
        <params>
          <param>30s</param>
          <param>VC.COMPANION.Reset</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <event>VC.COMPANION</event>
    </command>
    <command id="1058" name="Sender Reset" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>Sender</param>
          <param>PC</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <event>VC.COMPANION.Reset</event>
    </command>
  </commandGroup>
</groupCollection>

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: VC Companion Android App (Caller ID and More)
« Reply #2 on: May 20, 2018, 09:17:57 AM »
Very cool PegLeg.

It's nice that we can use this for sending events to VoxCommando without even having Tasker installed.  I don't have the pro versions of AutoRemote or AutoVoice so can't test those functions...

...but the events to announce incoming messages work great and it's super easy to set up.

Great work!

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: VC Companion Android App (Caller ID and More)
« Reply #3 on: May 20, 2018, 04:43:37 PM »
Thanks jitterjames  ::banana, I was making this to make it easier on me when setting up new devices for my family and I.

Instead of having to export it from Tasker on another device then Importing on the new device and then having to change the device name on all the actions, I decided to make it into an app so it would be a lot simpler, and then thought if I add in the IP and Port field other people could use it as well  ::wiggle

JonPeyton

  • $upporter
  • Jr. Member
  • *****
  • Posts: 36
  • Karma: 3
    • View Profile
Re: VC Companion Android App (Caller ID and More)
« Reply #4 on: January 28, 2022, 01:13:57 PM »
Excellent usage.(Further justifies my having AV and AR Pro also  :biglaugh )
Thanks for this.

JP