Here are some Tips for iTach, IR and UI7

@JCH:
I suspect an error in the LUA-file. You might post it her (as an attchement) so it can be examined, or you can PM it to me and I’ll have a look.

@PrincessCleavage:
If I understand your need correctly I suggest you do not apply that logic into the LUA-file, but solve it before the LUA call. Two approaches:

  1. Add an IF-ELSE clause in the Scene Edit (where you call the ircommand’s). Then you can send the commands needed from the LUA file based on what’s inside the clause. You will need a virtual switch which tracks the status (ON/OFF). The IF-ELSE clause reads from this virtual switch. See http://wiki.micasaverde.com/index.php/Luup_Scenes_Events.

  2. This might be the simplest approach. Use the Program Logic Event plugin. As soon as you start using and understand this plugin you will see how to apply the solution to your problem.

[quote=“rostmo”]@JCH:
I suspect an error in the LUA-file. You might post it her (as an attchement) so it can be examined, or you can PM it to me and I’ll have a look.

@PrincessCleavage:
If I understand your need correctly I suggest you do not apply that logic into the LUA-file, but solve it before the LUA call. Two approaches:

  1. Add an IF-ELSE clause in the Scene Edit (where you call the ircommand’s). Then you can send the commands needed from the LUA file based on what’s inside the clause. You will need a virtual switch which tracks the status (ON/OFF). The IF-ELSE clause reads from this virtual switch. See http://wiki.micasaverde.com/index.php/Luup_Scenes_Events.

  2. This might be the simplest approach. Use the Program Logic Event plugin. As soon as you start using and understand this plugin you will see how to apply the solution to your problem.[/quote]
    Thanks for the tips rosmoto, can I have the virtual switch change each time I execute the scene ( as the avr has not network link to check on or off status).
    So far I have created several scenes for on or off of my RF devices and they all work as expected. Would it be possible to assist with the line of code that I should add to change the virtual switch and execute scene 1 or scene 2 (on or off for the AVr amp) please

OK, I created a script which monitor the “status” of my BENQ projector. (Because the projector will turn on if I by error try to turn it off when its already off).

You should be able to use it for your purpose. The virtual switch (plugin) has ID 100 in my installation. You will need to find the unique ID in your setup and adjust the line “LOCAL dID = 100”. The rest should work if you use the same addon as in my setup.

This code will NOT try to turn off the BENQ if it’s not ON. IF the projector is ON it will turn off and set the virtual switch to off.

[font=courier]require “ircommand”
local dID = 100
local sID = “urn:upnp-org:serviceId:VSwitch1”
local TEMP= luup.variable_get(sID, “Status”, dID)
if (TEMP == “1”) then
ircommand.benqoff()
luup.call_action(sID, “SetTarget”, {newTargetValue = “0”}, dID)
end
ircommand.screenup()[/font]

This is another scene for turning everything on:

[font=courier]require “ircommand”
local dID = 100
local sID = “urn:upnp-org:serviceId:VSwitch1”
luup.call_action(sID, “SetTarget”, {newTargetValue = “1”}, dID)
ircommand.screendown()
ircommand.benqon()
ircommand.stream()[/font]

I use two scenes in my case above, but you can combine the two actions into one scene so you can use the same physical button trigger the same scene and send different ircommands based on status like this:

[font=courier]require “ircommand”
local dID = 100
local sID = “urn:upnp-org:serviceId:VSwitch1”
local TEMP= luup.variable_get(sID, “Status”, dID)
if (TEMP == “1”) then
ircommand.benqoff()
luup.call_action(sID, “SetTarget”, {newTargetValue = “0”}, dID)
else
ircommand.benqon()
luup.call_action(sID, “SetTarget”, {newTargetValue = “1”}, dID)
end[/font]

[quote=“rostmo”]OK, I created a script which monitor the “status” of my BENQ projector. (Because the projector will turn on if I by error try to turn it off when its already off).

You should be able to use it for your purpose. The virtual switch (plugin) has ID 100 in my installation. You will need to find the unique ID in your setup and adjust the line “LOCAL dID = 100”. The rest should work if you use the same addon as in my setup.

This code will NOT try to turn off the BENQ if it’s not ON. IF the projector is ON it will turn off and set the virtual switch to off.

[font=courier]require “ircommand”
local dID = 100
local sID = “urn:upnp-org:serviceId:VSwitch1”
local TEMP= luup.variable_get(sID, “Status”, dID)
if (TEMP == “1”) then
ircommand.benqoff()
luup.call_action(sID, “SetTarget”, {newTargetValue = “0”}, dID)
end
ircommand.screenup()[/font]

This is another scene for turning everything on:

[font=courier]require “ircommand”
local dID = 100
local sID = “urn:upnp-org:serviceId:VSwitch1”
luup.call_action(sID, “SetTarget”, {newTargetValue = “1”}, dID)
ircommand.screendown()
ircommand.benqon()
ircommand.stream()[/font]

I use two scenes in my case above, but you can combine the two actions into one scene so you can use the same physical button trigger the same scene and send different ircommands based on status like this:

[font=courier]require “ircommand”
local dID = 100
local sID = “urn:upnp-org:serviceId:VSwitch1”
local TEMP= luup.variable_get(sID, “Status”, dID)
if (TEMP == “1”) then
ircommand.benqoff()
luup.call_action(sID, “SetTarget”, {newTargetValue = “0”}, dID)
else
ircommand.benqon()
luup.call_action(sID, “SetTarget”, {newTargetValue = “1”}, dID)
end[/font][/quote]
Thanks I will give it a try tomorrow morning and report back.

[quote=“rostmo”]OK, I created a script which monitor the “status” of my BENQ projector. (Because the projector will turn on if I by error try to turn it off when its already off).

You should be able to use it for your purpose. The virtual switch (plugin) has ID 100 in my installation. You will need to find the unique ID in your setup and adjust the line “LOCAL dID = 100”. The rest should work if you use the same addon as in my setup.

This code will NOT try to turn off the BENQ if it’s not ON. IF the projector is ON it will turn off and set the virtual switch to off.

[font=courier]require “ircommand”
local dID = 100
local sID = “urn:upnp-org:serviceId:VSwitch1”
local TEMP= luup.variable_get(sID, “Status”, dID)
if (TEMP == “1”) then
ircommand.benqoff()
luup.call_action(sID, “SetTarget”, {newTargetValue = “0”}, dID)
end
ircommand.screenup()[/font]

This is another scene for turning everything on:

[font=courier]require “ircommand”
local dID = 100
local sID = “urn:upnp-org:serviceId:VSwitch1”
luup.call_action(sID, “SetTarget”, {newTargetValue = “1”}, dID)
ircommand.screendown()
ircommand.benqon()
ircommand.stream()[/font]

I use two scenes in my case above, but you can combine the two actions into one scene so you can use the same physical button trigger the same scene and send different ircommands based on status like this:

[font=courier]require “ircommand”
local dID = 100
local sID = “urn:upnp-org:serviceId:VSwitch1”
local TEMP= luup.variable_get(sID, “Status”, dID)
if (TEMP == “1”) then
ircommand.benqoff()
luup.call_action(sID, “SetTarget”, {newTargetValue = “0”}, dID)
else
ircommand.benqon()
luup.call_action(sID, “SetTarget”, {newTargetValue = “1”}, dID)
end[/font][/quote]
Simple but Elegant!
Works great!
Thanks a million Rostmo
I used the below code with virtual switch app (Id 133) and substituted my IR calls for Rostmo IR calls:
require “ircommand”
local dID = 100
local sID = “urn:upnp-org:serviceId:VSwitch1”
local TEMP= luup.variable_get(sID, “Status”, dID)
if (TEMP == “1”) then
ircommand.benqoff()
luup.call_action(sID, “SetTarget”, {newTargetValue = “0”}, dID)
else
ircommand.benqon()
luup.call_action(sID, “SetTarget”, {newTargetValue = “1”}, dID)
end

[quote=“rostmo, post:23, topic:195673”]OK, I created a script which monitor the “status” of my BENQ projector. (Because the projector will turn on if I by error try to turn it off when its already off).

You should be able to use it for your purpose. The virtual switch (plugin) has ID 100 in my installation. You will need to find the unique ID in your setup and adjust the line “LOCAL dID = 100”. The rest should work if you use the same addon as in my setup.

This code will NOT try to turn off the BENQ if it’s not ON. IF the projector is ON it will turn off and set the virtual switch to off.

[font=courier]require “ircommand”
local dID = 100
local sID = “urn:upnp-org:serviceId:VSwitch1”
local TEMP= luup.variable_get(sID, “Status”, dID)
if (TEMP == “1”) then
ircommand.benqoff()
luup.call_action(sID, “SetTarget”, {newTargetValue = “0”}, dID)
end
ircommand.screenup()[/font]

This is another scene for turning everything on:

[font=courier]require “ircommand”
local dID = 100
local sID = “urn:upnp-org:serviceId:VSwitch1”
luup.call_action(sID, “SetTarget”, {newTargetValue = “1”}, dID)
ircommand.screendown()
ircommand.benqon()
ircommand.stream()[/font]

I use two scenes in my case above, but you can combine the two actions into one scene so you can use the same physical button trigger the same scene and send different ircommands based on status like this:

[font=courier]require “ircommand”
local dID = 100
local sID = “urn:upnp-org:serviceId:VSwitch1”
local TEMP= luup.variable_get(sID, “Status”, dID)
if (TEMP == “1”) then
ircommand.benqoff()
luup.call_action(sID, “SetTarget”, {newTargetValue = “0”}, dID)
else
ircommand.benqon()
luup.call_action(sID, “SetTarget”, {newTargetValue = “1”}, dID)
end[/font][/quote]

How would I join a call to http (to sleep my media PC) into code? I already have a WOL/Ping switch setup for the PC to monitor if it is ON or OFF, if the WOL/Ping sensor is ON then would need to call:
http://I.P address of PC:Port/suspend
If the WOL/Ping sensor is OFF then it would need to Turn ON WOL/Ping App (which would send a WOL call to the device)

I doesn’t have anything to test this on in my setup, so this is only a guide to point you in a direction.

See this post http://forum.micasaverde.com/index.php?topic=11745.0

And this for syntax on the wget function.
http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#Module:_luup.inet

Hope this helps.

Sent fra min E6653 via Tapatalk

Wow, this is exactly what I was looking for. I just need to control a few devices, mainly turning off and on via a scene. Seems the wife never turns off the TV, AV receiver, and Sat box when she goes to bed. It’s just one button on the remote, but I guess that’s too much work for her ;D

If anyone needs codes for the GlobalCache for your devices, check out http://irdb.globalcache.com. They have complete codesets for many devices already in GC format, so you don’t have to use the iLearn app.

I have had this working for sometime and something occurred where now I get the attached error when attempting to call my usual luup code IR command from apps/develop apps/test luup code. I am calling the following:
require “ircommand”
ircommand.airconcool()
And I get the below error

Not sure how to troubleshoot this?

Let’s try some simple things first.

Try this first (from step 3):
luup.reload()

If that doesn’t help confirm the Lua file is still in its location and is the correct version.

Also try a reboot on Vera.

[quote=“rostmo, post:30, topic:195673”]Let’s try some simple things first.

Try this first (from step 3):
luup.reload()

If that doesn’t help confirm the Lua file is still in its location and is the correct version.

Also try a reboot on Vera.[/quote]
I have already attempted several restarts and luup engine reload and also replacing/creating a simplified ircommand.lup file on the vera unit. I have my IR commands working again and I hope the system is now stable. In case this may help someone else below is what I believe ( but mostly luck ) that got my system working again:

  1. Enable notifications Users & Account Info → Notification Settings → and check; ?Notification Header?, then Update Notification Settings
  2. I then notice device 171 was stalling the Luup engine to load successfully (which I think Vera not so helpful support may of added)
  3. Then ran the below code to list all active devices
    local file = io.open(“/www/devlist.txt”, “w”)
    file:write("[DeviceNo / id] device names on " … os.date() … “\n”)

for deviceNo,d in pairs(luup.devices) do
if d.id ~= “” then
file:write(string.format(‘[%03d / %s] %s \n’, deviceNo, d.id, d.description))
end
end

file:close()
View your device list at - http://vera i.p/devlist.txt
4. I then compared the output of the above list to device listed under, create new scene goto advanced editor add new task and compare from the drop down selectable device list. Note any device ID that look safe to delete
5. Delete safe list made from step 4 using below code
http://vera i.p:3480/data_request?id=device&action=delete&device=deviceID
Then restarted the unit and tested IR codes which were working as expected. I then added all my IR scenes back as per normal operations.

Thanks for your time to make suggestions!

OK, first off, apologies if I hijacked this discussion, but this appears to be the most current thread I could find that is germane to what I’d like to accomplish.

I’ve got a Vera Lite running version 1.7.987 of the firmware.
I’m trying to get it to talk to my GC-100 so I can send RS232 commands. End goal is control of my Lutron Radio RA (not RA 2) system through the RS232 port on the Chronos System Bridge (I’ve got two, hence the two ports on the GC-100).
I’m pretty well versed with RS232 and IR communication as I have a slew of Global Cache devices running my entertainment systems via iRule.

From what I’ve read the GC-100 Plugin and Lutron Plugins (there are two) are a time sink with no joy at the end and indeed I can find almost no doc on these and my efforts to get any of them to work were unsuccessful.

I have no problem coding up a text file and dumping it on the Vera, in fact I’d prefer to do it that way.

Is that the way to go. Are there any example files out there that have a GC-100 (both ports) working with a Vera Lite? How to I connect to the Vera via terminal, ssh? telnet? How do I push files to the Vera, scp? Where do I put them, is there a standard Posix type directory structure? How do I then get the code to run? Are there debugging tools?

After much digging I believe I’ve answered most of my own questions.

If I were to code up functions in a .lua file (which seems pretty straight forward), then drop the file in the /usr/lib/lua directory on the Vera, how to I associate the functions with the various aspects (ON / OFF for example) of a gui device in the devices tab. Or can I only associate those functions with scenes?

[quote=“rock”]After much digging I believe I’ve answered most of my own questions.

If I were to code up functions in a .lua file (which seems pretty straight forward), then drop the file in the /usr/lib/lua directory on the Vera, how to I associate the functions with the various aspects (ON / OFF for example) of a gui device in the devices tab. Or can I only associate those functions with scenes?[/quote]
I have an air conditioner unit that has one on/off button (same ir code for on off) in the lua file that I have uploaded to Vera the air conditioner ir line is ?airconcool? so I the created a scene called Aircon On/off and under advance section add the below code to ?also execute the following lup code? and set the triggers.

require “ircommand”
ircommand.airconcool()

Information is scattered but I believe there is an attachment at the start of one of the threads where you can use the attached files as a template to upload to Vera, also be sure to test your code in develop apps section as I have observed bad calls can introduce unpredictable delays into your system.
I hope this is of some help

I am not seeing the attachment here… Any help with posting it, or pointing me in the right direction. Thanks

I just can’t access vera to place the file, I’ve used a number of programs and have used root, IP, wifi password from the bottom of the unit and port 22 but I just can’t sign in to place the file.

Please help !

Thanks

Does any one know a code to control the relays on the GC100?

[quote=“Dacron, post:36, topic:195673”]I just can’t access vera to place the file, I’ve used a number of programs and have used root, IP, wifi password from the bottom of the unit and port 22 but I just can’t sign in to place the file.

Please help !

Thanks[/quote]

Have U try with winSCP ? (see attachment)

login : root
password : located on the label under your Vera unit assigned to “WiFI Pass”

It works for my VeraEdge

On Vera Lite’s, the root password isn’t printed on the bottom. So you need to access to the ‘Tech Support’ settings. Depending on your UI version, this is either under the Advanced tab, the Settings tab, or the Account tab. There will be an ‘enable’ button. Click that to turn on the tech support service. You will see a message like this:

Tech support full control enabled, access code 3000000-436969

The first number is your serial number, which is always printed on the bottom. The second number is a temporary password created for a user called “remote”. So, follow the same login instructions, but, instead of typing root for the login, type remote. And instead of using the normal password, use that temporary password, 436969 in this case. Once you have gotten in to the console, you can see the actual root password using this command: nvram show | grep pass

You’ll see something like this:

root@MiOS_30000000:~# nvram show | grep pass vera_wifipass=shade83forest

So in this case, shade83forest, is the actual root password. Write it down, and from now on login as ‘root’ as explained earlier, and use that password. The temporary password for the remote user will only be valid for 24 hours or until you click ‘Disable it’ on the tech support page.

Have just changed my IP address for my iTach. Prior to that it’s been working (as set up following this post) for months. Now the commands won’t run. If I paste the following in to “Apps | Develop apps | Test luup code (LUA)”

require “ircommand”
ircommand.LS1()

I get error messages ‘failed to test code please try again’. Similarly if I run a scene with similar code I get ‘Scene failed to run’.

I have double checked my IP address in my ircommand.lua file. The commands work if I use the iLearn sofware so I have the correct IP address.

Any suggestions would be gratefully received.

@Talisker, did you solve this?

If not, start with
1: confirming you actually have the latest version of the LUA-file in /usr/lib/lua. I have noticed it have been overwritten in my system once or twice with an older version (from the auto backup folder)
2: Make sure you execute step 3 from the original post: “luup.reload()”

If this didn’t help please tell, and I’ll try to look forther into it.