Here are some Tips for iTach, IR and UI7

rostmo,

I fixed it… It would appear that my LUA-file in /usr/lib/lua was somehow replaced with an older version. I replaced it with the correct file and it is now working OK.

Thanks.

I have been unable to get this to work, any help would be appreciated.

I am using a Vera3 running UI7. I also have a GC-100 rack mounted device (GC-100-18R). Module 1 and 2 are for the serial ports, thus module 4 is the correct module when using the code for this device. I use the Global Cache learner attached to the 1st serial port and can pull the code using iLearn. Using iTest I can send the command and the projector responses. I can send the command using repeat 2 and it turns the projector off.

Additionally, the IP address is correct as I can visit the Global Cache GC-100 UI. I also set the device to maintain a static IP address (so it never changes).

I have created the ircommand.lua file and it is located in the proper location (usr/lib/lua) and has to proper name ircommand.lua
the Lua file itself is as followed:

[code]module(“ircommand”, package.seeall)

local cmd

function epsonon()
cmd = ‘sendir,4:1,0,38000,1,1,340,168,22,62,22,62,22,20,22,20,22,20,22,20,22,20,22,62,22,62,22,20,22,62,22,20,22,62,22,20,22,62,22,20,22,20,22,20,22,20,22,20,22,62,22,20,22,20,22,62,22,62,22,62,22,62,22,62,22,20,22,62,22,62,22,20,22,3800’
sendir(cmd)
end

function epsonoff()
– Epson needs the On/Off button to be pressed two times.
cmd = ‘sendir,4:1,0,38000,1,1,340,168,22,62,22,62,22,20,22,20,22,20,22,20,22,20,22,62,22,62,22,20,22,62,22,20,22,62,22,20,22,62,22,20,22,20,22,20,22,20,22,20,22,62,22,20,22,20,22,62,22,62,22,62,22,62,22,62,22,20,22,62,22,62,22,20,22,3800’
sendir(cmd)
sendir(cmd)
end

function sendir(commandtosend)
commandtosend = commandtosend … ‘,\r’
local socket = require(“socket”)
c = assert(socket.connect(“192.168.1.253”, 4998))
c:settimeout(5)
local sres, serr = c:send(commandtosend)
local data, rerr = c:receive(5)
c:close()
end
[/code]

When I reloaded the luup and attempt to test on the test luup code (lua) under Apps/Develop Apps in Vera UI7 I use the following code.

require "ircommand" ircommand.epsonon()

I get the code successfully sent. However, no action is done by the project. Where am I messing up? Again, any help is appreciated.

Thank you.

Try swap 4:1,0 with 4:1,1

Sent fra min E6653 via Tapatalk

Thank you for a swift reply. I appreciate the assistance.

However, I switched the 0 to a 1 and it still did not work. I also reloaded Luup after making the changes.

sendir,4:1,0,38000,1,1,340,168,22,62,22,62,22,20,22,20,22,20,22,20,22,20,22,62,22,62,22,20,22,62,22,20,22,62,22,20,22,62,22,20,22,20,22,20,22,20,22,20,22,62,22,20,22,20,22,62,22,62,22,62,22,62,22,62,22,20,22,62,22,62,22,20,22,3800

and

sendir,4:1,1,38000,1,1,340,168,22,62,22,62,22,20,22,20,22,20,22,20,22,20,22,62,22,62,22,20,22,62,22,20,22,62,22,20,22,62,22,20,22,20,22,20,22,20,22,20,22,62,22,20,22,20,22,62,22,62,22,62,22,62,22,62,22,20,22,62,22,62,22,20,22,3800

both work as codes using iTest (and turns on/off the projector).
Vera stats the code sent was successful, but not luck in getting it to work.

Originally I had similar issues and the best way I found to move forward was to go back to the original lua example file posted in this thread and just change the code and the name description on one of his items (as a test) then upload and test. Usually I will find that it works and I slowly modify and test from that working point (I.e usually an error on my part but buggered if I could see it).

That is exactly what I did. I used the original file in the first post and only changed the cmd string to match that used in iTest (for my device) and the last 3 digitals of the IP address. I followed the directions outlined on this post, but have not had much luck. I have not even added other devices, just the projector at this moment.

Decided to try it all over again and deleted the ircommand.lua file and recreated it using the template provided in the first post. Still no luck :frowning:

Vera Logs show the following:

08 10/06/18 17:34:17.883 JobHandler_LuaUPnP::HandleActionRequest device: 0 service: urn:micasaverde-com:serviceId:HomeAutomationGateway1 action: RunLua <0x2f91a680> 08 10/06/18 17:34:17.884 JobHandler_LuaUPnP::HandleActionRequest argument id=lu_action <0x2f91a680> 08 10/06/18 17:34:17.884 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1 <0x2f91a680> 08 10/06/18 17:34:17.885 JobHandler_LuaUPnP::HandleActionRequest argument action=RunLua <0x2f91a680> 08 10/06/18 17:34:17.885 JobHandler_LuaUPnP::HandleActionRequest argument Code=require "ircommand" ircommand.screenon() <0x2f91a680>

I don’t get this. …

I also changed epsonon to screenon and that doesn’t work. iTest works with the remote code pulled from the GC serial learner, but vera is not executing the Lua command, but it is recognizing it and executing it.

Perhaps a file problem?

I have the projector responding using the GC Plugin. I converted the code to Pronto and created a scene with the plugin. I wish I did have to go this route and could have used your method, but using the plugin also gives me access to the serial ports and the three relays so either way its a win-win.

This also might be of interest for delayed actions in the lua file:

http://forum.micasaverde.com/index.php/topic,118117.0.html