Two devices with same IP and port endpoint for hubaction?

(j w) #1

I have a device I’m sending messages to via hubaction. In this case, the device controls two different relays. I want to have a button device for each relay. But then each device would be talking to the same IP and port, and just sending different messages. It seems this isn’t possible since the device id needs to be set to the ip and port. I just want to confirm: it is absolutely impossible to have two different devices talking to the same ip address and port, correct?

(Patrick Stuart [@pstuart]) #2

correct, a smartapp is the better way to do this and create 2 virtual devices relaying their commands through the “connect” smartapp.

(j w) #3

Thanks. That sounds good… um, do you have a short and sweet example of something like this? I’ve search the ST docs, but it’s hard to find anything in those… thx!

(Patrick Stuart [@pstuart]) #4

Plenty of examples out there. Hue, Sonos, Ecobee, etc.

Create virtual DTH for each relay, basic capability handling
link capability to “” assuming on/off is the function you are calling in smartapp
Create simple smartapp to connect to device via hubaction, process response from device, UI asks for ip and port.
On Install of smartapp, check if devices are installed, if not, create child devices
create smartapp functions “on and off” for handling the DTH “” requests to send to lan device via hubaction.

Agreed the docs should be better, but hey that’s a long list of things that should be better.

Browse the github repo for SmartThingsCommunity and there are a lot of great examples.

(Convinced ST will never be unbroken…) #5