Can I control a USB switcher from KM?

I know the chances of this are slim to none, but I have this USB switcher that lets me share a USB drive between my PS5 and my Mac:

image

I know that I probably can't control this exact switch, because there's not programmatic interface to it.

But I was wondering if anyone's come across a USB switcher that actually can be accessed programmatically, hopefully in a way that KM can use. As many of you know, I know a lot about JXA and other semi-eclectic things, so complexity doesn't necessarily bother me.

I believe there may be some switches that can use hotkeys to switch the device, but I think they assume the device you're sharing is a keyboard.

I'm thinking someone, somewhere, must have kludged up something like this, even if it's not KM that controls it.

Anyone? Thanks.

Maybe describe what you’re trying to accomplish at a high level by even having the USB stick in a switched hub. Folks might come up with a creative way to accomplish what you want without needing the switch?

1 Like

Thanks, that's a good idea.

There are times when I need to take a screenshot of a particular screen on my PS5, then transfer that screenshot to my Mac.

The screenshot shows my current status in Gran Turismo 7, which I then import into a program on my Mac, so I can keep track of my racing stats. If you want the details, you can check out my app GranTracker, but the details aren't that important.

Originally I grabbed the screenshot using the "PS Remote" program on my Mac - and I used KM to automate that. But the screenshot quality isn't as good as what I can get with a direct screenshot on the PS5, and in this case, the quality matters.

So this is what I do now:

  1. I take the screenshot on my PS5, and save it to an external thumb drive.
  2. I press the button on the aforementioned USB Switcher, and presto - the thumb drive is now available on my Mac.
  3. KM sees the newly-mounted thumb drive, and automates the rest of the process, launching GranTracker and importing the race results.
  4. When I'm done, I delete the files on the thumb drive, and unmount it.
  5. Assuming I remember, I switch the USB switcher back to the PS5.

But I regularly forget to switch the switcher back to the PS5, so I thought it would be cool if I could do that automatically, using KM.

I completely admit that this is overkill. I am being a total geek here. But I don't mind - it's what I am.

Possible Solution:

I think I have a possible solution. I found a few USB Switches that include an IR Remote.

I found this software, RemoteBuddy, that in theory allows me to attach an IR Transmitter to my Mac (most likely a Flirc, which I use with my home theater setup, so I'm familiar with it), and transmit remote codes via a command-line utility.

So I think this would work. But I wouldn't mind other thoughts on the subject.

And again, I admit this is overkill. But... it's cool.

Your photo is very grainy. Is that a circular, pressable button in the black area? If so, attaching one of these for $20 might solve your problem...

Screenshot 2024-05-05 at 01.46.19

Some of these devices are Homekit compatible.

1 Like

Yes it is a button in the middle. And that's an awesome idea! The downside is that there's only one button to toggle between the two USB ports, so there's no way to know which port it's on.

HOWEVER, there are probably a few switches that have dedicated buttons, so your switch would work with them. It could also be rigged up to press buttons on a remote, which usually has dedicated buttons.

Thanks for the great suggestion!

Couldn't your macros just check to see if the drive is active on the Mac side first? That would tell you where the switch is? That should just take a one-liner shell script.

-rob.

1 Like

Well duh - do you think I'm an idiot? (You'd be right if you thought so.)

I was thinking about the drive in the context of how I currently script it, but yes, of course you're right. I won't bother explaining my logic, or lack thereof, but I appreciate you resetting my mind, so to speak.

image

1 Like

Super interesting use case. That little USB Key switch is a pretty creative solution too.

Down the road, you might consider some kind of HDMI capture device such as Elgato Capture -- to feed your PS5 directly to your Mac. You could then automate the screen captures directly from your mac.

1 Like

Thanks. I actually have an Elgato. I'm not sure I want to have it running, though.

But that brings my mind back around to why I stopped using the PS Remote app in the first place.

I parse the screenshot to turn an on-screen progress bar into a numeric equivalent, and the quality of the screenshot from PS Remote wasn't good enough.

Long story short, that was before I learned more about the progress bar being used. I hadn't realized at the time that the progress bar represents exactly 100 different positions. But now that I know that, I might be able to use a screenshot from PS Remote after all.

And if that's true, there's other things I could automate - navigating GT7 on the PS5 to the correct screen before grabbing the screenshot, etc.

Thanks for shaking my mind up some more! This is why I love communities. When we work in a bubble, we don't always see outside said bubble.