What type of device integration would be appropriate for audio amp?

I have an old Xantech 8-zone/8-source audio amplifier that I resurrected some time ago. I currently use a Raspberry Pi that hosts a webapp written in Flask that can

  • turn each zone on/off
  • select each zone’s source (Pandora, Apple TV, Plex, Tuner, etc).
  • control each zone’s volume

Actions within the webapp fire serial protocol commands that are sent from the Pi to the Xantech’s serial port.

I would like to build a device integration so that I have the same type of control via SmartThings (so I can control zones in routines, and have at least basic control within the ST app).

I’m having trouble determining what type of integration would be best. I have an older ST hub that controls other devices in my house - running controller v.2.3.27-8 - but the Xantech’s RPi is also connected to the ethernet LAN, so a direct-connected or cloud-connected device could make sense. Can I do everything I want to do using the Rules API, or do I need to go to the full SmartThings API? Or is that not the right solution at all?

It’s just such an odd duck, I’m having trouble trying to figure out how to even start using ST’s ecosystem.

For more context, here’s the GitHub of what is currently running on the Pi to control the Xantech amp.

Any pointers in the right direction would be appreciated.

Tagging @taustin

Your amps use a serial connection, which wouldn’t be able to be supported directly from a SmartThings driver running on the SmartThings hub. So that means you’d need to repurpose your Pi app to become kind of a server to process commands from SmartThings and do the necessary interfacing with the amp. You probably already know all this…

One option, which could avoid any kind of custom Edge driver altogether, might be to have your Pi app use the SmartThings RESTful API to monitor some virtual device states to control you amps. The downsides of that is a convoluted set of virtual devices within the SmartThings app (no convenient single interface), and your Pi app would actually need to to poll the API, which is usually not a great design.

Another option could be to set up your Pi to run a native SmartThings SmartApp (typically in nodeJS). This would allow you to ‘subscribe’ to SmartThings device states and have a nice way to trigger commands to the amp. But this requires a lot of setup, an internet connection, and this also doesn’t address your need of having a customized device within SmartThings to interact with. And you’d still be faced with the work of implementing an Edge driver to actually implement the SmartThings device - unless you come up with some combination of virtual devices to achieve your needs.

Another option is to implement a direct-connected device on your Pi. It takes a bit of setup, and also requires an internet connection. I used to have a github project to enable this, but it is no longer needed, as Pi support is now built into the Core SDK for direct connected devices. One advantage of this approach is that you avoid having to do an Edge driver and the learning curve that would entail.

Creating a custom Edge driver would allow you to optimize a SmartThings device specific to your needs. But you still have the need to interface to your Pi app from the hub. You could implement your own HTTP-based API, or use something like MQTT if you don’t mind installing the Mosquitto MQTT broker on your Pi (a fairly simple thing to do). Using MQTT could alleviate you from a lot of headaches of implementing a custom communication interface.

You mentioned the Rules API: no, that’s not going to help you. That’s just a slightly more sophisticated method of creating automations.

So all things considered, I’d say if you don’t mind depending on an internet connection, then a direct connected device may be the best fit for you. If keeping everything running on your local LAN is a priority, then implementing a custom Edge driver and using MQTT might be a way to go.

There are other third party tools like Action Tiles or Node Red that might help you, but I’m not familiar enough with them to comment.

1 Like

Thank you, this is amazing! I think I’ll take a deeper look at direct-connected devices, this gives me a great jumping off point.

Thanks again!

1 Like

In going through the Direct-Connected Devices docs, it doesn’t look like there’s a toolchain available for the RPi. Is that true, or am I missing something?

There is - the documentation just hasn’t been updated. Follow the link to the Core SDK and you’ll find there is a BSP for Raspberry Pi.

Toolchain is not applicable to Pi-based devices.

1 Like