How do you open a serial port to write to?

I want to be able to control my Edisio dimmer module from a SmartThings hub.

In order to talk to the edisio stuff you need a USB stick that behaves like a serial port to the host computer, I’ve mocked all this up in C# and it all works, the IO is pretty simple, just a few fire and forget message (on/off/toggle/up/down/set dimmer value).

So in order to make this work in SmartThings hub, I guess I plug the USB device in and it should read it as a new serial port, but how do I open this in the smart things environment? Also how do I know what port its been mapped to, is there a selection widget in the UI that would make this easy for a user to configure?

Finally I want to package all this up as a dimmer in the Smartthings UI, I don’t want to re-invent the wheel so is there a good example of a dimmer control that I can borrow all the UI and entry points from and just swap out the command sending parts?

Cheers Simon

There is no way to do this.

1 Like

I don’t think you can do this direct from the Hub - the USB ports are not currently enabled. Another way may be to connect the dimmer via serial to something like a Raspberry Pi and develop a lightweight web interface which the hub can talk to.

I was thinking the same thing. He could use an Arduino with the ThingShield, or even a Netduino with ThingShield, and use that as an interface. But, that’s a lot of hassle for the outcome…

1 Like

Yup - i’m often guilty of doing stuff because it can be done, rather than thinking about what the most pragmatic solution is - it might be worth looking at ‘what would the cost of replacing my existing stuff be compared with the hassle and cost of fudging it to work’

1 Like

Thanks for the quick replies.

I already have a PI controlling some heating stuff, so whats been suggested isn’t to much of a stretch - and I can run my existing code under mono, so that saves some time, I guess there is a simple interface for making HTTP GET calls on the ST Hub?

Also with regards to a skeletal dimmer device to copy, any suggestions?

Thanks Simon