I have occasionally seen the error you are reporting. It is not consistent, and may center around the fact that Vera doesn’t do anything useful with print() in its environment–it does not write the string to the log, and I’m not sure what it does with it (it would have been a simple matter for them to override it and provide a useful implementation, but oh well). Most of the time, it is a completely benign no-op, but occasionally, I can get that odd “can’t call a nil value” error as well. Try using [tt]luup.log(“Hello world”)[/tt] instead.
Also, as is being discussed in other threads right now, scene Lua must return a boolean true or false at whatever exit(s) it takes. Returning false stops the scene execution, and true allows it to continue. So your complete test code might look like this:
luup.log("Hello world",2)
return true
The second (optional) argument to luup.log is a message level, which defaults to 50 if not given as in the first paragraph’s example. In the code above, I’ve set it to 2, which outputs the message in yellow (warning) to the Vera log file and makes it easier to find. Also note that the log file is buffered, so the “chunk” may not be written to “disk” and accessible to you until other messages have come sufficient to fill the buffer and cause a write/flush of the block. Running your test scene several times will often produce that result.
OK. Let’s try this. Run the request below (change the IP address to that of your Vera where indicated), and post the output. Let’s see if a broad view exposes anything interesting.
OK. The scene number in the request output is different from the scene number you’ve reported up until reply #7. Did you attempt to delete the scene and recreate it? If not, please do these:
If you did recreate the scene, then, well, I'm at a loss. I see no reason for the scene to take a nil error.
Was hoping you wouldn't say that. I did delete a recreate a new scene to make sure I didn't foobar anything. But for shits and giggles, I check the url you provided.
Not sure if this is related, but while messing with the scene (deleting and recreating), now all the names for my smart lock has changed to “Code #” (# matching the index number). Anyway to restore the names that are associated with each PIN code?
To resurrect this thread…Vera support claimed that the device firmware was too old and may have to lingering bug. I finally had some time to get the firmware updated and still have the same result.
Then I discovered something new, connected the device to the Internet to allow remote support and voila, the scene codes work. WTF. Why is internet connection required to perform local functions like executing a code? Is there a way to bypass this?
My first guess at the problem is the Lua process breaks because Alert is not able to report back to Skynet.
AFAIK Internet connection is required to get the date/time at boot, but you can bypassa that (as I did, search for it in the forum). Apart from that, remote connection is not required, unless you need it for a plugin (ie: Nest, Ecobee or other cloud-based devices).
That’s strange. I have modified my Vera a bit, using @rafale77 code to remove some checks (like the one for Internet connectivity). Search for his thread, you will find some inspiration.
I was just reading your thread and it is quite a mystery… My vera is completely disconnected from the mios servers with the exception of the event servers which is the alerts reporting you are referring to and I have never observed this. That being said, I have most of my code on openLuup these days but still have a couple of scenes on the vera. How did you disconnect the device from the internet? Did you physically unplugged it or did you block IP/ports from your firewall? And do you mean you enabled remote support on the UI? (This creates an SSH tunnel to the vera server).
A wild guess here but it could also be the NetworkMonitor program in the firmware (nothing to do with the plugin) which I have disabled and have asked eZLO to take out as well blocking something.
The veraedge is completely blocked at the firewall. To allow remote support, it was temporarily connected to the DMZ network with no restriction.
Interestingly, I deleted all my old scenes, created a new one with “Hello World” and now it works. I am super confused now. Anyhow, looks like that annoyance is resolved.
@rafale77 Do you have a link to you code to disable internet check? Also, all I am trying to do is have the Veraedge push updates when an even occur. Is there a better way to do this than using scene?