Sorry but I have to ask a dumb question. I just got code from a Vera developer to check my Vera’s up time.
He said that I could run the code below in this area to get the up time information: MiOS Developers >> Test Luup code
local fh = io.popen(“uptime”) – Execute command.
if (fh ~= nil) then
local data = fh:read(“*a”) – Capture the output of the executed command.
fh:close()
luup.task(tostring(data), 4, “Uptime”, -1)
else
luup.task(“failed to get the uptime.”, 2, “Uptime”, -1)
end
So I did exactly that and it says “Message successfully sent” I put a 0 in the device number or take it out and have nothing in there and it does the same thing.
My problem is… Where the heck does it output the information I’m looking for?
Thanks,
Thank you Chixxi for the reply, I didn’t know about that logging interface. Unfortunately I couldn’t see that output there. I saw the code when I ran it but none of the output was shown. I attached a picture of what I saw.
Brilliant! That worked! It’s now showing up in the status box in the top right corner where the time usually is.
Thank you oTi@!
Now I can validate that my scheduled event to reboot the Vera 2 box daily at 3am works! Vera Support rocks!
I’m happy to share how I have the Vera reboot daily! That’s why I mentioned it because I figured others would be interested.
You just need to put this command in the “Luup” tab in a scheduled scene: os.execute(“reboot”)
Then just schedule the scene you just created to run whenever you want it to reboot.
Then to verify that it rebooted you just need to put this code in the “Test Luup Code (Lua)” tab under the Mios Developers option on your dashboard
local fh = io.popen(“uptime”) – Execute command.
if (fh ~= nil) then
local data = fh:read(“*a”) – Capture the output of the executed command.
fh:close()
luup.task(tostring(data), 1, “Uptime”, -1)
else
luup.task(“failed to get the uptime.”, 2, “Uptime”, -1)
end