I am driving UI7 modes ( Home, Away etc ) from my plugin, however I noticed that the Get Mode action is taking quite some time and I am trying to optimize timings.
For instance getting the current mode , per the wiki page , is done via:
Get ?Mode? variable value
http://IP:3480/data_request?id=variableget&Variable=Mode
However, when I do this, I notice it takes close to 300ms just for that.
[quote=“RichardTSchaefer, post:6, topic:185205”]You have to be in the Scene LUA or Startup LUA context to do this … you can’t do it from a plugin LUA context.
I consider that a bug … I use the following to copy to my state variable:
Wow Thanks for the nice workaround ! @RexBeckett’s one with 127.0.0.1 runs quite fact so I may stick to this one, I wonder how fast the call_action( “RunLua”) is
local url_req = "http://127.0.0.1:3480/data_request?id=variableget&DeviceNum=0&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&Variable=Mode"
local req_status, req_result = luup.inet.wget(url_req)