PDA

View Full Version : Help needed for G5 migration off Homeseer



jwilson56
April 28th, 2007, 09:51 AM
Ok I need some help being a total LUA newbie.

I will describe a small example of what I do to demonstrate.

Right now for my 5 zone audio equipment using Slink-e, hsGirder and Homeseer setup I set a variable in Netremote when I select the zone to control. For instance when I hit the 'Den' button I use:

NRBasic Set variable to value (TA.Value2,2)

then on my main play screen when I hit the volume up button I use

Girder Send Event to Girder (nrMCJ.volup.{TA.Value2})

This gets sent to the hsGirder plugin for Homeseer which essentially runs a script called nrMCJ (based on the first section of the payload) where the payload gets parsed out. The second part of the payload is used in a case statement and executes the 'volup' case. The third part of the payload selects which receiver to send the IR command to:

nrMCJ script (abbreviated)

Function NetRemoteIn(parms)
dim hsg, hParm, Plist
dim dd
dim ZoneAtIP, ZoneAtIPCurrent, icon1, icon2, icon3

hParm = split(parms,"~") ' split up the input parameter string
nrIPAddr = hParm(0) ' The IP address of the NetRemote client
nrName = hParm(1) ' NetBios name, not guaranteed, of the NetRemote client
nrEvent = hParm(2) ' The Event name passed
nrPayload = hParm(3) ' The Payload as passed by NetRemote client

Set hsg = hs.Plugin("hsGirder") ' get addressability to the plugin
' hs.writelog "nrEvent? =", nrEvent
' hs.writelog "nrPayload? =", nrPayload
plist = split(nrEvent,".") ' event is period '.' delimited

imagepath = ".\data\hsGirder\"

select case lcase(plist(1))
case "volup"
Select Case lcase(plist(2))
Case 1
for xx=1 to 10
hs.sendir "Sony80ES,vol+"
next
Case 2
hs.sendir "technics,v_up"
Case 3
hs.sendir "technics_2,v_up"
Case 4
hs.sendir "technics_3,v_up"
Case 5
hs.sendir "technics_4,v_up"
End Select

case else
hs.writelog "nrMCJ","Invalid command received: " & nrevent
end select
end function


So I need to duplicate this basic function for Girder 5. Trouble is I have no idea where to start. I understand VBS basics but am not familiar enough with G5 or LUA to tackle this. Can anyone give me some ideas as to where to start.

I plan on using SteveV's SLinkEx - IR TX/RX plugin.

Any help would be appreciated (remember I am a total newbie for LUA and Girder)

Thanks

John

Promixis
April 28th, 2007, 10:07 AM
Hi John,

On G5, would you copy and paste the log output so I can see exactly what the event looks like?

Lua is different from VBS but the concepts are really similar. So transitioning will not be too hard. www.lua.org is a great place to start. And just ask here :D

There is no case statement in lua.

Once you show the output here, I will help you parse the event, and then we can work on sending the IR output to the right place.

Rob H
April 28th, 2007, 04:25 PM
There is no case statement in lua.
But you can of course fake one using tables

jwilson56
May 2nd, 2007, 05:22 PM
Everything is migrated over to G5 now... Homeseer has been shutdown. The Slink-e plugin is working great. Its very quick and stable.

John