I am getting ready to rebuild my system from scratch. I am presently using quite a few Multistring variables as triggers for scenes. I set a number in one of the Multistring variables, received from an IR remote through KiraRxt as a trigger. I have been using the Reactor plugin for a couple of small tasks and I think the Reactor plugin might be more suited to the task.
Would Reactor triggers be more efficient than using the Multistring variable change as a trigger?
I made a test condition and action within Reactor. When I change a variable in a device it causes a light to toggle. It takes as many as 5 seconds to complete the task after setting a variable within a device using “LuaTest 1.7”. Is this a normal amount of time to complete a simple task?
Any suggestions would be appreciated.
Thank you, Mark
Can you post a Logic Summary (Tools tab) for your ReactorSensor? Also what is LuaTest 1.7 and how does that relate to Reactor? I’m not really clear on what you are describing your test.
I was previously using a test condition added to a existing Reactor. I created a new Reactor and the time to complete the actions was reduced substantially to 41ms. I am using the LuaTest to change a variable in the Shade1 vairable “ShadePreset” with the commands:
local dID = 212
local new_preset = 6
luup.variable_set(“urn:upnp-org:serviceId:Dimming1”,“ShadePreset”,new_preset,dID)
You can do this without Lua in Reactor. You can either use an expression variable to get the state so you can send the opposite in a Device Action with SetTarget, or you can use a ToggleState action in a Device Action, no fetching of the state/expression needed. That would likely be faster still.
The first time a Reactor Run Lua action is run, the code is loaded and “compiled” (tokenized is probably a more accurate term). So if you’re comparing timing, run the activity twice. The second and subsequent runs are more typical of “real” timing.
Thank you for the quick response. I’m just toggling the light as a test. In reality I would be running about 30 lines of code in place of the toggle. What I am asking is should I replace my Multstring triggers with Reactor triggers? Sorry I might not be explaining this very well.
I think most Reactor users would agree that Reactor activities start faster more consistently than native scenes. Reactor activities survive interruptions like surprise reloads or power loss. Reactor has more logic options. Reactor is a current plugin with active support. And really, they are kind of apples and oranges. But at the end of the day, the best tool is the one you are most comfortable with that addresses your needs.