RS232 quad relay controller

I have created a plugin that uses an RS232 quad-relay to control my wired projector screen motor.

The relay is available from ebay from seller r32190:
http://www.ebay.com/sch/r32190/m.html?_nkw=relay&_sacat=0&_odkw=relay&_osacat=0&_trksid=p3911.c0.m270.l1313

Each quad relay can control up to 2 screens/window blinds.
The plugin is based on the somfy plugin code, with adaptation to this particular relay’s command set as detailed in this document: https://docs.google.com/document/d/1XtO0Z6RytXgoOUks6W0QdVszueB60ekZ9-OiA5Nvhb4/edit?authkey=COf8lCc

The code is based on the following wiring:
relay port 1: screen 1 up
relay port 2: screen 1 down
relay port 3: screen 2 up
relay port 4: screen 2 down

For installation and usage instructions, see the somfy plugin instructions here: http://wiki.micasaverde.com/index.php/Somfy_Plugin, (skip step 5 which is not relevant).

See plugin files attachment in post #6 below

Well done! Thank you for this!

That’s really good value for money. Not sure what I could use this for, but the HA geek in me says buy one!

@shady, what else can I do with that old somfy motor I got for my awning :smiley: ???

Exactly, lets buy one first and find a use later.

I have been wanting to play with motorizing a few windows using tubular shade motors. Using either a gear and rack config or cables and pulleys or screw drive. I have seen people create linear actuators from these motors, but it probably makes more sense to buy linear actuators. You could try to build one of those framed artwork covers for your flatscreen. I have always wanted a hidden door (motorized possibly), to what I have no idea, but I can dream can’t I.

This relay board is a great solution for turning PC’s on/off remotely, among many other things.

EDIT: I just went to get one and I am a little confused by the sellers package deals or optional parts. I see it doesn’t come with a power supply, but I can get a small board to run it off of USB 5V. If I click on the picture of the USB to 12V board it takes me to a PIR sensor, where it mentions “Combo purchase of quad relay module, bidding this item will get a USB power to quad relay power converter. Free gift: ABS housing. (NO mounting screw)”. Does this mean if I buy a $5 PIR sensor with it I get a bunch of free stuff? @drag0n what did you purchase exactly? He’s got some interesting stuff (NAS/BT box, etc).

I just purchased the quad relay for $18.5 and added a note to the seller that I want to add an enclosure for additional $7.
I then used my own 12v power supply that I already had hanging around.
Actually, I didn’t notice the PIR sensor deal - the seller is very responsive, you can contact him for clarification.

I tried installing the plugin on Firmware Version 1.5.346, but failed.
Help please…

I’ve attached the latest version of my plugin, which works fine with UI5 v 1.5.346.
I think the only change I’ve made is to account for:

The Lua files must be terminated with a newline character, i.e the last code line shouldn't be the last line in the file.
I plan to have it published at the Mios marketplace for easier installation

Hi drag0n,

Possible to publish and share the plugin link in Mios MarketPlace?
I tried using your D & I file to create my plugin in MarketPlace and install but it doesnt seem to be able to install.

Thanks for your prompt reply, cheers!

Hi DragOn,

I saw your plugin, MiOS Apps
Tried installing but fail to install error message popped up.
Please advise and appreciate you help.

Thanks!

The attached files work for me with manual installation - with UI5, select APPS, develop apps, luup files, upload the 2 attached files and check Restart Luup after upload.
If it doesn’t work for you, please be more specific regarding the error messages you get.
I still couldn’t get the app to install through the marketplace. It’s my first plugin, so I’m still figuring this out

Hi DragOn,

Its working perfectly!

Thanks for your kind effort in helping.

Cheers!

@MCV: I’ve submitted this plugin for approval (#2008).
Please help figure out why it fails to install through the marketplace with this error:

Error Installation failed, reason: to install plugin
But works fine when installed manually.

I installed through Mios Apps and it seemed to install correctly and create the device. The device created was nameless and I see it in the drop down list for assignment in the serial port config. I double checked the device number and I seem to have it correctly assigned to the serial port. I have restarted Luup and refreshed many times, but I still have an uncontrollable blank device.

I recently reinstalled my monoprice HDMI switch and had some issue with the serial port failing to connect, but I don’t see those error messages here. My HDMI plugin also took a long time (days) to configure and fix itself. Adding some of these serial devices just doesn’t seem to be as straight forward as it should be. I think I am patient enough and I try to wait for Vera to drop a working device in my UI, but you get to the point where you consider talking to Vera and/or going out in the backyard and chanting to the sky while waving a stick, hoping the Vera Gods will grant you a device.

I think I’ll try installing the files manually.

Edit: installing manually didn’t seem to help

@Shady,
How are you powering all these USB-based devices, are they Bus-powered or on a Powered USB-Hub? Not sure if this is your Vera2 or Vera3 unit, but the Vera3 units aren’t capable of driving too much out of their USB Ports as the power supply is under-spec’d.

If it’s a Vera 3, then you can either use a powered USB hub, or a power supply that can dole out more current. I have the latter, and it works a lot better.

The symptom of the low power will be failing USB devices, ones that don’t always register and/or show up and/or work.

@guessed

Thank you, I thought about the power problem, but I only have two USB to Serial cables plugged in and that is it, no hubs. The HDMI switch and the Quad Relay board. I could try a powered hub later today and see if that helps.

This early version of Vera3 has a builtin serial port, but it isn’t active as far as I can tell. I’d like it to be though.

Do you have any experience with why the serial adapter for the HDMI switch returned IO errors for a few days then started working w/o errors? Maybe the USB port can barely handle one serial adapter?

Right on the money…

USB Ports are spec’d to deliver 5v @500mA ea. I wasn’t able to get get them to power one Bus-powered USB Hub with a single USB-Serial attached to it… Each of these was well below that line, ~150mA ea, and it wasn’t able to provide stable power to them. @CJ looked at the errors I was seeing, and traced them back to USB power issues.

Once I connected the Vera3 to a better 12v power rail everything came good again. My guess is that the power supply provided isn’t rated for the total load that it’s expected to deliver (Vera 3 + 5v @1A total)

The Vera2, and it’s power supply, was able to do this so you could consider hijacking it’s wall-wart to see if that gets you further… or just break open the closet-o-wall warts and find a bigger one.

My VeraLite also had trouble powering 2 serial devices and a USB-UIRT, but with a powered USB hub it can reliably control 3 serial devices and the USB-UIRT.

That being said, the empty device problem seems unrelated to the power issue. The plug-in should display a warning message after reload if a serial device is not configured.
Try a manual install using the xml files posted in post #6 above.

I also tried to power a dual port WIZnet IP to serial adapter from my V3 USBs over the weekend during a rewiring/tidy up effort, and it wouldn’t work! This IP/serial adapter has been fine when powered from by my DirecTV receivers USB port!

I’m going to re-try it from the V3 again as I’ve also gotten mine up and running with a dedicated 12V DC power supply/UPS since.

Thank you all, I have read the posts about USB power issues but didn’t understand how bad it really was, plus having had different experiences with previous Vera’s which successfully ran a serial adapter plus a couple USB sticks ( I know I am preaching to the choir here ).

@Drag0n, I did try to manually upload the files from post 6 and they uploaded OK and it restarted Luup OK, but it didn’t change the device which still blank/unconfigured. I will try adding a powered USB hub and report back tonight.

Adding the powered USB hub didn’t do anything to configure the device, I tried restarting Luup, etc. I even tried uninstalling the device/plug-in and reinstalling, but ended up with the same unconfigured device. So I uninstalled and uploaded both sets of files to Vera manually (projections and quadrelay) and manually created a device using the quadrelay files and after I restarted Luup it seemed to configure properly. i deleted the projector files as it turns out they weren’t needed. I think the plug-in still needs to be installed manually.

It creates a Projector Parent device and 2 child (Window) Blind devices. The child devices don’t expose controls, you have to go into setting on the device to use the controls. This works, but it doesn’t expose the device in SQ Remote as far as I can tell. Any suggestions?