Run a scene when there's a lua startup failure

Hi Everyone,

Is there a way to detect a lua startup failure for a particular device?

I have a Denon receiver that works properly most of the time, but on occasion its network connection goes to lunch and the Denon plug-in starts reporting communications failures. Rebooting the receiver resolves the issue, so I put it on a Z-Wave outlet I can control through Vera. I’d like to detect a startup lua failure on the receiver and run a scene that cycles power on the Z-Wave outlet when a the startup failure is detected.

You could add this to your Startup Lua. It will wait 60 seconds to allow the plugin time to initialize and then check the specified device number. If it is not ready, it will run the specified scene.

[code]luup.call_delay(“checkDevReady”,60)

function checkDevReady()
local dID = 123 – Device number to check
local sNO = 123 – Scene number to run if not ready
if not luup.is_ready(dID) then
luup.call_action(“urn:micasaverde-com:serviceId:HomeAutomationGateway1”, “RunScene”, {SceneNum = sNO}, 0)
end
end[/code]