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

Offline dforster

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: RS232 quad relay controller
« Reply #30 on: June 18, 2012, 03:47:31 am »
Hi dragOn,

I still am not having any joy. Is there any way you could remote into my unit and sort for me?

I tried doing a manual install, then creating a device to match as per the thread - but to no avail.

Cheers

Dan

Offline drag0n

  • Full Member
  • ***
  • Posts: 130
  • Karma: +1/-1
Re: RS232 quad relay controller
« Reply #31 on: June 18, 2012, 04:00:15 am »
@ dforster
Click on the wrench icon of the device you've created
Select advanced.
Post here the contents of the following fields from the advanced tab:  device_type, device_file, impl_file
_____________________________________
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 dforster

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: RS232 quad relay controller
« Reply #32 on: June 19, 2012, 06:19:30 am »
Hi,

Sorry about this, it makes me feel such a birk...

Please see attached grabs...

device_type    (as its obscured)   urn:ProjectorScreen-com:device:blinds:1

Cheers

Dan

Offline drag0n

  • Full Member
  • ***
  • Posts: 130
  • Karma: +1/-1
Re: RS232 quad relay controller
« Reply #33 on: June 19, 2012, 06:49:06 am »
Dan - it seems that your device file field has D_quadrelay.xml instead of D_quadrelay1.xml
Fix the name and reload vera a couple of times.
Also, verify in Apps/Develop Apps/Luup files that D_quadrelay1.xml and I_quadrelay1.xml were properly uploaded.
_____________________________________
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 dforster

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: RS232 quad relay controller
« Reply #34 on: June 19, 2012, 12:56:54 pm »
Hi,

IT WORKS - excellent - now I can move to Z-Wave from X10 completely - wonderful (these relays will control my heating and cooling system).

What excellent help - cant thank you enough.

I took the plugin out, uploaded the latest xml files (the early ones hang vera) - restarted and created a new device, associated with the RS232 and it sprung into life.

From a pleased man.

Dan ;-)

Offline TommyE

  • Full Member
  • ***
  • Posts: 141
  • Karma: +0/-0
Re: RS232 quad relay controller
« Reply #35 on: July 18, 2012, 01:19:23 pm »
Hello

I'm wondering if it would be possible to use the relays for something else than blinds/screens?

I have installed the plugin, and it works great, except that I would love to have four screens with each screen representing the various relays with on/off next to it.

Also how can one change the graphics from a windows to eg. an on/off switch or a relay or whatever.


Regards
TommyE




Offline drag0n

  • Full Member
  • ***
  • Posts: 130
  • Karma: +1/-1
Re: RS232 quad relay controller
« Reply #36 on: July 19, 2012, 02:04:29 pm »

I'm wondering if it would be possible to use the relays for something else than blinds/screens?
It's certainly possible to use the quad relay to turn on/off 4 separate devices, however it requires a significant rewrite of the plugin code.    You can give it a try...
_____________________________________
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 TommyE

  • Full Member
  • ***
  • Posts: 141
  • Karma: +0/-0
Re: RS232 quad relay controller
« Reply #37 on: July 19, 2012, 02:28:19 pm »

I'm wondering if it would be possible to use the relays for something else than blinds/screens?
It's certainly possible to use the quad relay to turn on/off 4 separate devices, however it requires a significant rewrite of the plugin code.    You can give it a try...

Hehe, yepp I'm trying.

I first tried to look at your code, but having no experience with LUA I found the Somfy example on micaseverde.com instead.
The problem with that is that there is a lot of references to old stuff, UI4, that I've only read about. (Beeing a Vera owner on my 5. day now.)
I'm finding out new stuff as I go :)

Now I'm struggling abit with what I think is problems opening the serialport right. It is there somewhere, as your plugin worked nicely :)

Also I would love to read from the serialport to get the status from the relayboard, does your code do this, or do you rely on what is set thru Vera?


Regards
TommyE

Offline TommyE

  • Full Member
  • ***
  • Posts: 141
  • Karma: +0/-0
Re: RS232 quad relay controller
« Reply #38 on: July 24, 2012, 12:40:53 pm »

I'm wondering if it would be possible to use the relays for something else than blinds/screens?
It's certainly possible to use the quad relay to turn on/off 4 separate devices, however it requires a significant rewrite of the plugin code.    You can give it a try...

Hello

I have now by created a plugin for the relay board.

It shows up as four on/off powerswitches. I can turn on or off individual relays, and the icons gets updated with a nice and shining light when on.

I have a question that I hope you maybe can lead me in the right direction for.

If I power off and on the relay module then the status information will be out of sync.

The relay module is capable of showing it status by sending the right commands, it also reports back directly after a command.

The question is, how can I read the status from the relay board at intervals defined.

Regards
TommyE

Offline zoot1612

  • Hero Member
  • *****
  • Posts: 594
  • Karma: +19/-1
Re: RS232 quad relay controller
« Reply #39 on: July 25, 2012, 08:41:27 pm »
One way of doing it, not necessarily correct :)


All incoming data should be available from device here: -

I_quadrelay1.xml
Code: [Select]
<incoming>
<lua>incomingData(lul_data)</lua> --points to function incomingData--
</incoming>

In either I_quadrelay1.xml or L_quadrelay1.lua
Code: [Select]

local HADEVICE_SID = "urn:micasaverde-com:serviceId:HaDevice1"
local HAD_POLL = "Poll"
--------------------------------------------------------------------------------
function pollModule()

local poll = luup.variable_get(HADEVICE_SID,HAD_POLL,lul_device)
luup.call_timer("pollModule", 1, poll, "", "")

--put commands to poll device here--

end
--------------------------------------------------------------------------------
function incomingData(lul_data)

--Incoming data handler.
--Place code here to interrogate device and update status etc.

end
--------------------------------------------------------------------------------

--This section goes into device startup function--
if((luup.variable_get(HADEVICE_SID,HAD_POLL,lul_device))==nil ) then
luup.variable_set(HADEVICE_SID,HAD_POLL,"2m",lul_device)
end

luup.call_delay("pollModule", 15, "")

--------------------------------------------------------------------------------

cheers

Zoot

Offline cokeman

  • Jr. Member
  • **
  • Posts: 88
  • Karma: +0/-0
Re: RS232 quad relay controller
« Reply #40 on: July 27, 2012, 08:03:20 am »
Hello

I have now by created a plugin for the relay board.

It shows up as four on/off powerswitches. I can turn on or off individual relays, and the icons gets updated with a nice and shining light when on.

I have a question that I hope you maybe can lead me in the right direction for.

If I power off and on the relay module then the status information will be out of sync.

The relay module is capable of showing it status by sending the right commands, it also reports back directly after a command.

The question is, how can I read the status from the relay board at intervals defined.

Regards
TommyE

I'm looking forward to seeing your plugin on apps.mios.com :-D

/Regards

Cokeman

Offline xbmcnut

  • Full Member
  • ***
  • Posts: 111
  • Karma: +1/-0
Re: RS232 quad relay controller
« Reply #41 on: July 29, 2012, 09:43:03 pm »
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 drag0n. Thanks for the great plugin. I purchased the quad relay and serial/USB adapter from eBay and updated the lupp files with the versions attached here. I see I now have a device called ProjectorScreen and two blinds; Blind #01 and Blind #02. However, when I click on either device and select anything (e.g. Open), I get a warning pop-up appear stating "No implementation". Am I missing something? I'm running 1.5.408.
« Last Edit: July 29, 2012, 09:44:57 pm by xbmcnut »

Offline drag0n

  • Full Member
  • ***
  • Posts: 130
  • Karma: +1/-1
Re: RS232 quad relay controller
« Reply #42 on: July 30, 2012, 02:31:12 am »
@xbmcnut:
Seems like the Impl_file wasn't properly uploaded / installed.
Try the manual install again.
If it doesn't help, post here a snapshot of your advanced tab (see posts #32-33 above)
_____________________________________
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 xbmcnut

  • Full Member
  • ***
  • Posts: 111
  • Karma: +1/-0
Re: RS232 quad relay controller
« Reply #43 on: July 30, 2012, 03:31:25 am »
@drag0n,

Thanks for the prompt reply. When you say manual install, all I did was install through the App store then update the two files attached in this thread. Was that correct? Device_type = urn:ProjectorScreen-com:device:blinds:1 and screenshot shows other settings.


Offline xbmcnut

  • Full Member
  • ***
  • Posts: 111
  • Karma: +1/-0
Re: RS232 quad relay controller
« Reply #44 on: August 05, 2012, 06:50:41 am »
@drag0n,

Thanks for the prompt reply. When you say manual install, all I did was install through the App store then update the two files attached in this thread. Was that correct? Device_type = urn:ProjectorScreen-com:device:blinds:1 and screenshot shows other settings.

Any thoughts?