We have moved at community.getvera.com

Author Topic: Lua code works via Test Luup code (Lua) but not in scene  (Read 453 times)

Offline jiml57

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Lua code works via Test Luup code (Lua) but not in scene
« on: November 05, 2018, 09:44:35 am »
The followimg single line of lua code;

os.execute("ssh -y -i /root/.ssh/id_dss -l user@192.168.1.100 /home/user/scripts/plexremote-ON.sh")

when used under "Test Luup code (Lua)" works perfectly but when I add it to a scene within UI7 it simply does nothing.

Can anyone provide any pointers as to what is the problem might be.

Firmware version is 1.7.4000

Offline davidd

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Lua code works via Test Luup code (Lua) but not in scene
« Reply #1 on: November 08, 2018, 08:36:57 am »
I'm having this issue as well.  I use the Luup code in scenes to adjust thermostats depending on alarm status, set times, etc.  When the scene runs, nothing happens but when I copy/execute the Luup code in the "Test Luup Code" in Develop Apps, it works as expected.  I'm pretty sure this issue started with 1.7.4000 but I'm not 100% sure.

Offline wise72

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Lua code works via Test Luup code (Lua) but not in scene
« Reply #2 on: November 08, 2018, 11:19:01 am »
Same issue with code that used to work in the past (and continues to work in the test space)
Further performed a simple test with "return false" - but actions continue to be executed
(issue occurs irrespective of wether code is enetered in the trigger or the scene logic)
Partial & full reboot did not make any difference.

Offline wise72

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0

Offline davidd

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Lua code works via Test Luup code (Lua) but not in scene
« Reply #4 on: November 08, 2018, 01:49:46 pm »
I don't know why this worked, but it did.  I edited one of my scenes that has Luup code.  I copied the Luup code to notepad, deleted the code from the scene, added an action to the scene (turn a light on) and saved it.  Then, I edited that scene again, removed the action, pasted the Luup code back in, and saved the scene.  When I ran that scene, it now worked.  So, I ran my other scenes and they all work now too even though I did not change them at all.

Offline kigmatzomat

  • Sr. Member
  • ****
  • Posts: 377
  • Karma: +23/-0
Re: Lua code works via Test Luup code (Lua) but not in scene
« Reply #5 on: November 14, 2018, 11:48:45 pm »
My experience is that if a scene acquires an invalid character, it impacts a lot of other scenes, probably all the ones with later ID numbers. It's like luup engine recompiles the scenes into a single executable or DLL and if a scene is corrupted, everything afterwards is corrupted.

No clue what causes the invalid characters. Could be firmware update, something in a web browser, solar flare, gypsy curse, anything.