Scene code failing

Simple lua code fails with:

LuaInterface::CallFunction_Scene Scene 95 failed attempt to call a nil value

Code:

os.execute(“echo $(date +‘%Y-%m-%d %H:%M:%S’) motion >>/tmp/motion/garage.log”)
end

Any experienced scene lua coders out there that have seen this?

Hello @tinman

Just a quick thought — could you please double-check the quotation marks in your code? Sometimes when code is pasted into the forum, straight quotes (" or ') can get automatically replaced with curly quotes (“ ” or ‘ ’), which Lua doesn’t recognize and will cause a call a nil value error like the one you’re seeing.

Here’s what a corrected line should look like:

os.execute(“echo date +'%Y-%m-%d %H:%M:%S' motion >> /tmp/motion/garage.log”)

Make sure:

  • You’re using straight double and single quotes throughout.
  • The /tmp/motion/ directory actually exists on your system.
  • And finally, the end statement at the bottom — is that part of a function or loop block? If not, you may not need it there.

Let us know if that helps narrow it down!

Thanks for responding. I know the Vera side of things isn’t likely to get much attention.
This hub is failing to run scene code that’s been in use for a couple of years. I’ve used that very line of code in other scenes and it’s never given problems. When the hub reloads I see this in the log:

01 07/14/25 9:56:15.640 JobHandler_LuaUPnP::Run cannot start lua with code:
function scene_61()
luup.call_action(“urn:micasaverde-com:serviceId:EnergyMetering1”, “ResetKWH”, {}, 2112)

end

And after that it shows the rest of the code from scenes in red. This is in a scene I’ve used for years.I know that if a scene has code that won’t compile the rest of the code in scenes won’t work.

ALSO: this is the first scene containing any Lua code.

Hello @tinman

We have sent you an email with a request to initiate a remote session in order to check your controller. Could you please confirm once you’ve received it?

Not sure where you sent the email. I didn’t get one. I have enabled remote access. Would I normally return the remote access code in that email? The email in my account preferences is correct.

BTW, looking at the userdata JSON there appears to be 3 orphaned scenes at the top - -first three

Hello @tinman

We sent it to your .net email. Is the controller serial ending in 845?

Yes, that’s the one

access code: *****

Any progress here? The service led is off on my hub. Some days it’s on - others it’s off. When it’s on I know I can log in to access alerts. I assume that when it’s on the hub is connected to your server. Can you remote access the hub with the service led off?

Hello @tinman

That’s correct — we noticed yesterday that your controller is currently offline, but we hadn’t updated the case here yet. Could you please try connecting your controller via Ethernet to port 1 of the main modem and perform a power cycle?

We’ll be standing by to continue once it’s back online.

Tried what you suggested, connecting an ethernet cable directly to the output of my router - temporarily disabling ethernet to other devices on my network. The hub booted and the service led came on briefly - a few seconds, and then went off.

Hello @tinman

Could you please proceed with a network reset by quickly pressing the reset button three times?
Please avoid pressing it more than three times, as this will trigger a factory reset on your controller.

OK did that. took a while before most led’s came on. Right now internet and service are blinking

I have a second Vera Plus that I had running briefly over a year ago. I wasn’t really doing anything with it so I put it away as a spare. I’ve fired it up and connected it to the same gigabyte switch. It starts up ok and after several minutes all LED’s are on - including the service LED. Tomorrow I will try to put everything on that hub and see if scene code works as expected.

Hello @tinman

Thanks for the update!
To help make the troubleshooting process with your controller smoother and more efficient, feel free to reach out to us directly.

You can either:

:e-mail: Send us an email at: support@ezlo.com
:telephone_receiver: Or call us at: 1-866-966-2272

Our team will be happy to walk you through the next steps.

About the hub now stuck with the internet and service LED’s flashing; I believe it’s of no use in this state. Before I could at least control the devices that were attached to it. I could also connect using WinSPC. Will I have to to a full reset - using the reset button - to get back to some useful state? Or is there another way?

I did a factory reset of the hub. Appears to work fine - service light is on and scene codes run as expected.