Failed to set input

Cenario:
I have a scene that:
-Turns on the power plug where my denon receiver is connected when I arrive home
-Set the input to tuner

Problem:
It does not work because veralite cannot communicate with denon receiver because lua failed.

Why:
The denon is booting when I set the input to tuner.
A delay does not work because the lua will not recover from fail state
I know that I can do a full reload, but I don’t want to use that because it will return an error on my Android app (authomation) because the scene won’t end correctly.

Workaround:
I set the input to tuner everytime that I shutdown my denon receiver, but it’s stupid to hear the sound of tuner everytime I go out or go to sleep…

Solution:
Is it possible to run/force lua startup service just for the denon using a luup command that I can put in my scene?

Why doesn’t a delay work? How are you presently delaying? I would do this one of two ways.

a. Arrival scene turns on devices including Denon receiver. A one minute or longer delay sends Tuner command.

b. One scene turns everything on. A second scene uses the Denon outlet turn on as a trigger. That second scene delays for a minute and then sends the tuner command.

Hello,

Thanks for your answer.

I am using luup sleep command.

The problem is the denon plug-in that does not detect that the device is on and cannot communicate with it, just after a full up lua reload I can command.

I will do a test that is wait for 5 minutes and see if it communicate, but I don’t think it will, mainly because under the device there is a red message that says lua failed…

You should rarely use luup.sleep and if you do it should only be used for a few seconds. This can have negative side effects on the reliability of Vera.

Use luup.call_delay for longer sleeps.

Hello,

Unfortunaly the delay did not work.
The Denon device state is always the same, 1 minute, 5 minutes or even 1 hour after the plug module is turned on:
Lua Startup Failure Lua Failure

AFAIK the only way that i can do what i want is to use this command:

luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "Reload", {}, 0)

But this restarts me all my devices and the scene does not end well.
I have an error in the end, and i think the reason is the lua is restarting and does not allow the scene to end.

What i want is to do a single device restart. I just want to run the denon lua start up script.
Is this possible?

It would probably help clear up confusion if you posted the actual code you are trying to use. Why are you reloading Vera? If you are going to use LUA/LUUP then I would do something like this:

[code]turn on powerplug and other stuff…

luup.call_delay( ‘Receiver_On’, 30) – Turn receiver On after waiting 30 seconds.
function Receiver_On()
luup.call_action(“urn:micasaverde-com:serviceId:DiscretePower1”,“On”,{},99) – Turn on the receiver
end

luup.call_delay( ‘Tuner_Mode’, 30) – Call the set tuner function after waiting 30 seconds.
function Tuner_Mode()
luup.call_action(“urn:micasaverde-com:serviceId:InputSelection1”,“Input4”,{}, 99) – This is just an example and not the precise command.
end[/code]

I still don’t see what a delayed scene action or a triggered scene could not change the tuner settings a minute after applying power.

Thanks again for your help.

Let me try to explain it a little better.

When i’m not home and my Denon power plug is off my veralite gives me a red message under the device DENON: Lua Startup Failure Lua Failure.

First cenario:

[code]luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”, “SetTarget”, {newTargetValue = “1”}, 22)

luup.sleep(10000)

luup.call_action(“urn:micasaverde-com:serviceId:InputSelection1”,“Input5”,{}, 19)
[/code]

This is similar to what you are telling me, but unfortunately it does not work because even after 10 seconds i still have the same red message under the device telling me Lua Startup Failure Lua Failure, and it will stay there forever.

To fix this message and to start again communicating with DENON i figured out that i needed to reload luup.
So i’ve haded a new command and i’ve got something like this:

[code]luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”, “SetTarget”, {newTargetValue = “1”}, 22)

luup.call_action(“urn:micasaverde-com:serviceId:HomeAutomationGateway1”, “Reload”, {}, 0)

luup.call_action(“urn:micasaverde-com:serviceId:InputSelection1”,“Input5”,{}, 19)
[/code]

This still does not work because the last line of my scene won’t run.
I think the full reload stops actual running scenes and i cannot set the tuner input.

So what i need is a way to reload not the full vera lite but only the Denon plugin after the power plug is ON.

Did i’ve made myself clear now?

The only way to do this is if the Denon Plugin developer provided a way to do this in his plugin.
You need to contact that person.

I see what you are saying and without such a receiver I cannot debug it for you. However I can point a few things out.

luup.call_action(“urn:micasaverde-com:serviceId:HomeAutomationGateway1”, “Reload”, {}, 0)
Completely reloads LUA(Vera) and as you have seen that resets everything including scenes, so this method will never work for you.

Have you seen this thread regarding Denon plugin development?

You seem to be turning the outlet On, but not the receiver itself. Does it not require it’s own turn on after the power is applied?
luup.call_action(“urn:micasaverde-com:serviceId:DiscretePower1”,“On”,{},19) – Turn on the receiver
then set the input to tuner.

What happens if you check the status of the input setting?
local InputStatus = luup.variable_get(“urn:micasaverde-com:serviceId:InputSelection1”, “Input”, 19)
luup.log("Current receiver Input value is: "InputStatus)

@RichardTSchaefer may be right (he usually is) about needing to get with the plugin’s developer.

Hello,

No, it does not need to be turned on, since it resumes the previous state (I do not shut down, I just cut the power, and I need to do this because this amp produces a bzzzzzzzz sound that I don’t like to hear at night).

I have tried that to turn it on and unfortunately the result is the same, I cannot communicate with Denon until lua is reloaded.

I will check the Denon state and post it back.

Actually I using a workaround, everytime I shut down Denon e set the input to tuner. When I turn it on powering on the zwave plug it starts playing radio.
I have also reloaded the lua everytime I power the Denon.

Thanks