Reactor as a trigger for vera scenes

My Reactor has recently updated to v2 and I and after rebuilding all reactors and logic I am having trouble when I assign a reactor stat as a trigger for a Vera scene that runs luup for a TTS function (with notifications).
I have tried the following:

  1. Run the TTS Vera scene manually with only manual trigger assigned (works)
  2. Assigned reactor state as a trigger for the Vera scene and attempted to run scene manually (scene ran with a green tick but no TTS output). Also attempted manually changing the state of the reactor (no TTS output)
  3. Create a virtual on/off switch and assigne off state as trigger for the Vera scene then manually run the scene (works). Also manually change the state of the vSwitch to Off (works)
  4. Assign in reactor turn on vswitch =trigger turn off vSwitch =untripped and assign the relevant Vera scenes to on and off state for the vSwitch. Perform manual trigger of the reactor states(works)

Is this normal functionality or should I be able to use reactor states as a trigger for Vera scenes?

[quote=“PrincessCleavage, post:1, topic:200412”]My Reactor has recently updated to v2 and I and after rebuilding all reactors and logic I am having trouble when I assign a reactor stat as a trigger for a Vera scene that runs luup for a TTS function (with notifications).
I have tried the following:

  1. Run the TTS Vera scene manually with only manual trigger assigned (works)
  2. Assigned reactor state as a trigger for the Vera scene and attempted to run scene manually (scene ran with a green tick but no TTS output). Also attempted manually changing the state of the reactor (no TTS output)
  3. Create a virtual on/off switch and assigne off state as trigger for the Vera scene then manually run the scene (works). Also manually change the state of the vSwitch to Off (works)
  4. Assign in reactor turn on vswitch =trigger turn off vSwitch =untripped and assign the relevant Vera scenes to on and off state for the vSwitch. Perform manual trigger of the reactor states(works)

Is this normal functionality or should I be able to use reactor states as a trigger for Vera scenes?[/quote]

Reactor has always been able to be used as a device in a scene trigger, and this has not changed with 2.0 (and did not change at 1.5 when Reactor became able to run scenes itself).

Check the device trigger setup in your scene. A common mistake is to choose “when the device is armed and tripped”, but then not have the device armed. You can either arm the ReactorSensor, or you can change the scene trigger to “is tripped whether it is armed or disarmed”.

You can also name the scene in a “Run Scene” action in Reactor’s Activities tab to directly run the scene.

[quote=“rigpapa”][quote=“PrincessCleavage, post:1, topic:200412”]My Reactor has recently updated to v2 and I and after rebuilding all reactors and logic I am having trouble when I assign a reactor stat as a trigger for a Vera scene that runs luup for a TTS function (with notifications).
I have tried the following:

  1. Run the TTS Vera scene manually with only manual trigger assigned (works)
  2. Assigned reactor state as a trigger for the Vera scene and attempted to run scene manually (scene ran with a green tick but no TTS output). Also attempted manually changing the state of the reactor (no TTS output)
  3. Create a virtual on/off switch and assigne off state as trigger for the Vera scene then manually run the scene (works). Also manually change the state of the vSwitch to Off (works)
  4. Assign in reactor turn on vswitch =trigger turn off vSwitch =untripped and assign the relevant Vera scenes to on and off state for the vSwitch. Perform manual trigger of the reactor states(works)

Is this normal functionality or should I be able to use reactor states as a trigger for Vera scenes?[/quote]

Reactor has always been able to be used as a device in a scene trigger, and this has not changed with 2.0 (and did not change at 1.5 when Reactor became able to run scenes itself).

Check the device trigger setup in your scene. A common mistake is to choose “when the device is armed and tripped”, but then not have the device armed. You can either arm the ReactorSensor, or you can change the scene trigger to “is tripped whether it is armed or disarmed”.

You can also name the scene in a “Run Scene” action in Reactor’s Activities tab to directly run the scene.[/quote]
My understanding is that if I use the Run Scene action in reactor Notifications in the Vera scene will not work (this is a requirement for my function).
For Vera scene in question the reactor state trigger I have tried them all and I initially tried restores from tripped weather armed or disarmed (see screenshot), also this does not explain why Vera scene will not output TTS when reactor state is assigned as a trigger and scene is run manually but when vSwitch state is assigned as a trigger and scene is run manually The action is as expected (TTS output from Sonos)

[quote=“PrincessCleavage, post:3, topic:200412”]… also this does not explain why Vera scene will not output TTS when reactor state is assigned as a trigger and scene is run manually but when vSwitch state is assigned as a trigger and scene is run manually The action is as expected (TTS output from Sonos)
[/quote]

Yes, you noted that the scene does not run when run manually or when tripping the ReactorSensor that is the scene trigger. I would look in your logs and see if you can find any messages logged that may help.

[quote=“rigpapa, post:4, topic:200412”][quote=“PrincessCleavage, post:3, topic:200412”]… also this does not explain why Vera scene will not output TTS when reactor state is assigned as a trigger and scene is run manually but when vSwitch state is assigned as a trigger and scene is run manually The action is as expected (TTS output from Sonos)
[/quote]

Yes, you noted that the scene does not run when run manually or when tripping the ReactorSensor that is the scene trigger. I would look in your logs and see if you can find any messages logged that may help.[/quote]

Oh and of course, if your condition is “restores from tripped”, you need to both trip and untrip the ReactorSensor, because the trigger will be on the untrip.

[quote=“rigpapa”][quote=“rigpapa, post:4, topic:200412”][quote=“PrincessCleavage, post:3, topic:200412”]… also this does not explain why Vera scene will not output TTS when reactor state is assigned as a trigger and scene is run manually but when vSwitch state is assigned as a trigger and scene is run manually The action is as expected (TTS output from Sonos)
[/quote]

Yes, you noted that the scene does not run when run manually or when tripping the ReactorSensor that is the scene trigger. I would look in your logs and see if you can find any messages logged that may help.[/quote]

Oh and of course, if your condition is “restores from tripped”, you need to both trip and untrip the ReactorSensor, because the trigger will be on the untrip.[/quote]
All I can see in logs is:
Scene::RunScene running 267 Alexa Stop 2 <0x6dea2520>
0101/11/19 11:51:52.309LuaInterface::CallFunction_Scene Scene 267 failed attempt to call a nil value <0x6dea2520>

[quote=“PrincessCleavage, post:6, topic:200412”][quote=“rigpapa”][quote=“rigpapa, post:4, topic:200412”][quote=“PrincessCleavage, post:3, topic:200412”]… also this does not explain why Vera scene will not output TTS when reactor state is assigned as a trigger and scene is run manually but when vSwitch state is assigned as a trigger and scene is run manually The action is as expected (TTS output from Sonos)
[/quote]

Yes, you noted that the scene does not run when run manually or when tripping the ReactorSensor that is the scene trigger. I would look in your logs and see if you can find any messages logged that may help.[/quote]

Oh and of course, if your condition is “restores from tripped”, you need to both trip and untrip the ReactorSensor, because the trigger will be on the untrip.[/quote]
All I can see in logs is:
Scene::RunScene running 267 Alexa Stop 2 <0x6dea2520>
0101/11/19 11:51:52.309LuaInterface::CallFunction_Scene Scene 267 failed attempt to call a nil value <0x6dea2520>[/quote]

Is your scene using Lua? Can you post that here?

[quote=“rigpapa”][quote=“PrincessCleavage, post:6, topic:200412”][quote=“rigpapa”][quote=“rigpapa, post:4, topic:200412”][quote=“PrincessCleavage, post:3, topic:200412”]… also this does not explain why Vera scene will not output TTS when reactor state is assigned as a trigger and scene is run manually but when vSwitch state is assigned as a trigger and scene is run manually The action is as expected (TTS output from Sonos)
[/quote]

Yes, you noted that the scene does not run when run manually or when tripping the ReactorSensor that is the scene trigger. I would look in your logs and see if you can find any messages logged that may help.[/quote]

Oh and of course, if your condition is “restores from tripped”, you need to both trip and untrip the ReactorSensor, because the trigger will be on the untrip.[/quote]
All I can see in logs is:
Scene::RunScene running 267 Alexa Stop 2 <0x6dea2520>
0101/11/19 11:51:52.309LuaInterface::CallFunction_Scene Scene 267 failed attempt to call a nil value <0x6dea2520>[/quote]

Is your scene using Lua? Can you post that here?[/quote]
For some reason all is working as expected again… did anything change in reactor app?
Below is the luup in the scene with three reactor states restores from triggered weather armed or disarmed which is now working for some reason:
luup.call_action(“urn:micasaverde-com:serviceId:Sonos1”, “Say”,
{Text=“Alexa”, Language=“en”, Volume=95},
601)
luup.sleep (500)
luup.call_action(“urn:micasaverde-com:serviceId:Sonos1”, “Say”,
{Text=“Stop”, Language=“en”, Volume=85},
601)

[quote=“PrincessCleavage, post:8, topic:200412”][quote=“rigpapa”][quote=“PrincessCleavage, post:6, topic:200412”][quote=“rigpapa”][quote=“rigpapa, post:4, topic:200412”][quote=“PrincessCleavage, post:3, topic:200412”]… also this does not explain why Vera scene will not output TTS when reactor state is assigned as a trigger and scene is run manually but when vSwitch state is assigned as a trigger and scene is run manually The action is as expected (TTS output from Sonos)
[/quote]

Yes, you noted that the scene does not run when run manually or when tripping the ReactorSensor that is the scene trigger. I would look in your logs and see if you can find any messages logged that may help.[/quote]

Oh and of course, if your condition is “restores from tripped”, you need to both trip and untrip the ReactorSensor, because the trigger will be on the untrip.[/quote]
All I can see in logs is:
Scene::RunScene running 267 Alexa Stop 2 <0x6dea2520>
0101/11/19 11:51:52.309LuaInterface::CallFunction_Scene Scene 267 failed attempt to call a nil value <0x6dea2520>[/quote]

Is your scene using Lua? Can you post that here?[/quote]
For some reason all is working as expected again… did anything change in reactor app?[/quote]

I can’t change things remotely. There are times I have wished I could, but no.

Below is the luup in the scene with three reactor states restores from triggered weather armed or disarmed which is now working for some reason: luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="Alexa", Language="en", Volume=95}, 601) luup.sleep (500) luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="Stop", Language="en", Volume=85}, 601)

Scene Lua should always end with “return true” or “return false”. Even though nothing else in the scene may be left to execute, suspicious and undefined, potentially random behaviors could result when you don’t return a definitive result. This is not a Reactor thing. This is a scene Lua thing since forever. Your scene just ends without a return, so you are effectively returning nothing to Luup, and I would venture to guess that leaves a roll of the dice and who knows what happens after (but when you return nothing and get a mysterious error about “nil” in the log, hmmm… sounds fishy to me).

And your sleep is only 1/2 second. Is that enough to get work done? It may be that there is simply a race condition–the delay is too short, but sometimes Vera hits the delay on the money, and maybe sometimes it’s a little late, with the latter making a difference.

[quote=“rigpapa”][quote=“PrincessCleavage, post:8, topic:200412”][quote=“rigpapa”][quote=“PrincessCleavage, post:6, topic:200412”][quote=“rigpapa”][quote=“rigpapa, post:4, topic:200412”][quote=“PrincessCleavage, post:3, topic:200412”]… also this does not explain why Vera scene will not output TTS when reactor state is assigned as a trigger and scene is run manually but when vSwitch state is assigned as a trigger and scene is run manually The action is as expected (TTS output from Sonos)
[/quote]

Yes, you noted that the scene does not run when run manually or when tripping the ReactorSensor that is the scene trigger. I would look in your logs and see if you can find any messages logged that may help.[/quote]

Oh and of course, if your condition is “restores from tripped”, you need to both trip and untrip the ReactorSensor, because the trigger will be on the untrip.[/quote]
All I can see in logs is:
Scene::RunScene running 267 Alexa Stop 2 <0x6dea2520>
0101/11/19 11:51:52.309LuaInterface::CallFunction_Scene Scene 267 failed attempt to call a nil value <0x6dea2520>[/quote]

Is your scene using Lua? Can you post that here?[/quote]
For some reason all is working as expected again… did anything change in reactor app?[/quote]

I can’t change things remotely. There are times I have wished I could, but no.

Below is the luup in the scene with three reactor states restores from triggered weather armed or disarmed which is now working for some reason: luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="Alexa", Language="en", Volume=95}, 601) luup.sleep (500) luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="Stop", Language="en", Volume=85}, 601)

Scene Lua should always end with “return true” or “return false”. Even though nothing else in the scene may be left to execute, suspicious and undefined, potentially random behaviors could result when you don’t return a definitive result. This is not a Reactor thing. This is a scene Lua thing since forever. Your scene just ends without a return, so you are effectively returning nothing to Luup, and I would venture to guess that leaves a roll of the dice and who knows what happens after (but when you return nothing and get a mysterious error about “nil” in the log, hmmm… sounds fishy to me).

And your sleep is only 1/2 second. Is that enough to get work done? It may be that there is simply a race condition–the delay is too short, but sometimes Vera hits the delay on the money, and maybe sometimes it’s a little late, with the latter making a difference.[/quote]
Just right time to trigger Alexa to lister then action command (I have played with this timing a bit). What should I add to the end of my luup to complete it correctly?

return true. there are times when it is appropriate to return false, but I won’t muddy these waters with that right now.

Thanks, how do you import scenes into the new reactor? When I select activity run scene there is nothing to choose from and I can?t see in the document how to import but it mentions you can

Thanks, how do you import scenes into the new reactor? When I select activity run scene there is nothing to choose from and I can?t see in the document how to import but it mentions you can[/quote]

When you re-installed Reactor 2.0 did you reinstall the patched Javascript file after? Here: http://forum.micasaverde.com/index.php/topic,118192.0.html

Thanks, how do you import scenes into the new reactor? When I select activity run scene there is nothing to choose from and I can?t see in the document how to import but it mentions you can[/quote]

When you re-installed Reactor 2.0 did you reinstall the patched Javascript file after? Here: http://forum.micasaverde.com/index.php/topic,118192.0.html[/quote]
No I didn?t, thanks for pointing this out, resolved my problem and now I have a drop down select option for all my Vera scenes.
Thanks