Author Topic: RS232 quad relay controller  (Read 21475 times)

Offline drag0n

  • Full Member
  • ***
  • Posts: 130
  • Karma: +1/-1
RS232 quad relay controller
« on: December 07, 2011, 08:17:59 am »
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
« Last Edit: July 30, 2012, 04:12:04 am by drag0n »
_____________________________________
Vera Lite, Remotec Z-URC 550, MiniMote, TKB TZ66D, TKB TZ-71, ZXT-120, ACT ZRP200 , SmartSwitch, Quad Relay, Poly Lock & Poly Pad, SQ Blaster & SQ Blaster+, HMS100, Everspring SF812, Current Cost EnviR, RFXtrx, RollerTrol , Flamingo FA20RF

Offline shady

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1327
  • Karma: +11/-0
  • This monkey knows his Window Coverings!
Re: RS232 quad relay controller
« Reply #1 on: December 07, 2011, 03:34:24 pm »
Well done! Thank you for this!
Vera3 1.5.346, Schlage (3)DB (2)Lever, Kwikset (1)Lever, RCS TZ43 Thermo, (2) Vizia RZI06-1LX 600W Dimmers, (17) Monster (Leviton) Dimmers (6) Monster (Leviton) IWC Scene Controllers (1) Etherrain-8, (3) HSM 100's (1)GE 3-Way set

Offline strangely

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3712
  • Karma: +33/-2
  • Vera 1,3 & V light
Re: RS232 quad relay controller
« Reply #2 on: December 07, 2011, 05:51:04 pm »
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 :D ???
Kwickset locks, HA01C, HA14C, HA02C, HA03C, HA05C, HA04C, HA07C, HA09C, Aeon HEM, GE 45604, 45606, 45609, ZDP100, VRF01-1LZ, WDTC-20, HA18WD, WDHA-12R, HRDS1, HM-TS001, AC1-ZW, TV-IP110, BL-C210A, LUUP control- EtherRain8, DSC Alarm, HDMI matrix, HR24-200, Panasonic TV, SQblaster

Offline shady

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1327
  • Karma: +11/-0
  • This monkey knows his Window Coverings!
Re: RS232 quad relay controller
« Reply #3 on: December 07, 2011, 06:16:49 pm »
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).
« Last Edit: December 07, 2011, 06:35:44 pm by shady »
Vera3 1.5.346, Schlage (3)DB (2)Lever, Kwikset (1)Lever, RCS TZ43 Thermo, (2) Vizia RZI06-1LX 600W Dimmers, (17) Monster (Leviton) Dimmers (6) Monster (Leviton) IWC Scene Controllers (1) Etherrain-8, (3) HSM 100's (1)GE 3-Way set

Offline drag0n

  • Full Member
  • ***
  • Posts: 130
  • Karma: +1/-1
Re: RS232 quad relay controller
« Reply #4 on: December 08, 2011, 02:43:52 am »
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. 
_____________________________________
Vera Lite, Remotec Z-URC 550, MiniMote, TKB TZ66D, TKB TZ-71, ZXT-120, ACT ZRP200 , SmartSwitch, Quad Relay, Poly Lock & Poly Pad, SQ Blaster & SQ Blaster+, HMS100, Everspring SF812, Current Cost EnviR, RFXtrx, RollerTrol , Flamingo FA20RF

Offline ian_vtec

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: RS232 quad relay controller
« Reply #5 on: April 05, 2012, 11:37:07 am »
I tried installing the plugin on Firmware Version 1.5.346, but failed.
Help please....

Offline drag0n

  • Full Member
  • ***
  • Posts: 130
  • Karma: +1/-1
Re: RS232 quad relay controller
« Reply #6 on: April 05, 2012, 02:09:04 pm »
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:
Quote
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
_____________________________________
Vera Lite, Remotec Z-URC 550, MiniMote, TKB TZ66D, TKB TZ-71, ZXT-120, ACT ZRP200 , SmartSwitch, Quad Relay, Poly Lock & Poly Pad, SQ Blaster & SQ Blaster+, HMS100, Everspring SF812, Current Cost EnviR, RFXtrx, RollerTrol , Flamingo FA20RF

Offline ian_vtec

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: RS232 quad relay controller
« Reply #7 on: April 05, 2012, 11:32:51 pm »
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!

Offline ian_vtec

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: RS232 quad relay controller
« Reply #8 on: April 05, 2012, 11:42:36 pm »
Hi DragOn,

I saw your plugin, https://apps.mios.com/plugin.php?id=2008
Tried installing but fail to install error message popped up.
Please advise and appreciate you help.

Thanks!

Offline drag0n

  • Full Member
  • ***
  • Posts: 130
  • Karma: +1/-1
Re: RS232 quad relay controller
« Reply #9 on: April 06, 2012, 04:25:07 am »
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
_____________________________________
Vera Lite, Remotec Z-URC 550, MiniMote, TKB TZ66D, TKB TZ-71, ZXT-120, ACT ZRP200 , SmartSwitch, Quad Relay, Poly Lock & Poly Pad, SQ Blaster & SQ Blaster+, HMS100, Everspring SF812, Current Cost EnviR, RFXtrx, RollerTrol , Flamingo FA20RF

Offline ian_vtec

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: RS232 quad relay controller
« Reply #10 on: April 06, 2012, 11:55:50 am »
Hi DragOn,

Its working perfectly!

Thanks for your kind effort in helping.

Cheers!

Offline drag0n

  • Full Member
  • ***
  • Posts: 130
  • Karma: +1/-1
Re: RS232 quad relay controller
« Reply #11 on: April 08, 2012, 03:14:40 am »
@MCV: I've submitted this plugin for approval (#2008).
Please help figure out why it fails to install through the marketplace with this error:
Quote
Error
Installation failed, reason: to install plugin
But works fine when installed manually.
_____________________________________
Vera Lite, Remotec Z-URC 550, MiniMote, TKB TZ66D, TKB TZ-71, ZXT-120, ACT ZRP200 , SmartSwitch, Quad Relay, Poly Lock & Poly Pad, SQ Blaster & SQ Blaster+, HMS100, Everspring SF812, Current Cost EnviR, RFXtrx, RollerTrol , Flamingo FA20RF

Offline shady

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1327
  • Karma: +11/-0
  • This monkey knows his Window Coverings!
Re: RS232 quad relay controller
« Reply #12 on: April 18, 2012, 10:53:28 am »
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
« Last Edit: April 18, 2012, 11:23:11 am by shady »
Vera3 1.5.346, Schlage (3)DB (2)Lever, Kwikset (1)Lever, RCS TZ43 Thermo, (2) Vizia RZI06-1LX 600W Dimmers, (17) Monster (Leviton) Dimmers (6) Monster (Leviton) IWC Scene Controllers (1) Etherrain-8, (3) HSM 100's (1)GE 3-Way set

Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: RS232 quad relay controller
« Reply #13 on: April 18, 2012, 11:09:22 am »
@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.

Offline shady

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1327
  • Karma: +11/-0
  • This monkey knows his Window Coverings!
Re: RS232 quad relay controller
« Reply #14 on: April 18, 2012, 11:30:22 am »
@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?

Vera3 1.5.346, Schlage (3)DB (2)Lever, Kwikset (1)Lever, RCS TZ43 Thermo, (2) Vizia RZI06-1LX 600W Dimmers, (17) Monster (Leviton) Dimmers (6) Monster (Leviton) IWC Scene Controllers (1) Etherrain-8, (3) HSM 100's (1)GE 3-Way set