MSR rule action to run Lua code on an Ezlo hub

From the MSR release notes:

“NOTE TO EZLO HUB USERS: Ezlo appears to have removed the API that allows a Lua script to be sent to the hub to run, as of their firmware version 2.0.1570.4. There is no replacement API that I can find, so the runlua action is no longer available. At all. If this inconveniences you, I’m sure @Oleh in the Ezlo Community would be interested in your feedback.”

Oleg says they haven’t removed any API however.

I created this rule and it doesn’t work the LUA code is not run on the Ezlo Plus hub.

Looking in the MSR log file I see this:

[latest-21337]2021-12-16T12:44:22.870Z <Rule:NOTICE> Rule#rule-kx8ydvth resetting!
[latest-21337]2021-12-16T12:44:22.871Z <Rule:NOTICE> Rule#rule-kx8ydvth stopping rule
[latest-21337]2021-12-16T12:44:22.873Z <Rule:5:Rule.js:743> Rule#rule-kx8ydvth acquiring semaphore
[latest-21337]2021-12-16T12:44:22.874Z <Rule:5:Rule.js:746> Rule#rule-kx8ydvth semaphore acquired; releasing timer
[latest-21337]2021-12-16T12:44:22.875Z <Rule:5:Rule.js:746> Rule#rule-kx8ydvth semaphore acquired; unsubscribing from condition dependencies
[latest-21337]2021-12-16T12:44:22.878Z <Rule:5:Rule.js:748> Rule#rule-kx8ydvth saving states
[latest-21337]2021-12-16T12:44:22.881Z <Rule:5:Rule.js:752> Rule#rule-kx8ydvth stopped
[latest-21337]2021-12-16T12:44:22.881Z <Rule:NOTICE> Rule Rule#rule-kx8ydvth stopped
[latest-21337]2021-12-16T12:44:22.883Z <Rule:NOTICE> Rule#rule-kx8ydvth restarting after reset
[latest-21337]2021-12-16T12:44:22.884Z <Rule:5:Rule.js:716> Rule#rule-kx8ydvth start(), awaiting semaphore
[latest-21337]2021-12-16T12:44:22.887Z <Rule:5:Rule.js:724> Rule#rule-kx8ydvth restored states: trig=(null), rule=(null)
[latest-21337]2021-12-16T12:44:22.888Z <Rule:5:Rule.js:724> Rule#rule-kx8ydvth subscribing to dependencies
[latest-21337]2021-12-16T12:44:22.888Z <Rule:INFO> Rule#rule-kx8ydvth (Globe Lamp Toggle - Lua) started
[latest-21337]2021-12-16T12:44:22.889Z <Rule:5:Rule.js:728> Rule#rule-kx8ydvth start() dependencies resolved, performing initial evaluation
[latest-21337]2021-12-16T12:44:22.889Z <Rule:5:Rule.js:1005> Rule#rule-kx8ydvth (Globe Lamp Toggle - Lua) evaluate() acquiring mutex
[latest-21337]2021-12-16T12:44:22.890Z <Rule:5:Rule.js:1009> Rule#rule-kx8ydvth._evaluate() mutex acquired, evaluating
[latest-21337]2021-12-16T12:44:22.890Z <Rule:5:Rule.js:1013> Rule#rule-kx8ydvth update rate is 0/min limit 60/min
[latest-21337]2021-12-16T12:44:22.891Z <Rule:5:Rule.js:936> Rule#rule-kx8ydvth evaluateExpressions() with 0 expressions
[latest-21337]2021-12-16T12:44:22.893Z <Rule:5:Rule.js:1033> Rule#rule-kx8ydvth._evaluate() trigger state now (null) (was (null))
[latest-21337]2021-12-16T12:44:22.893Z <Rule:5:Rule.js:1035> Rule#rule-kx8ydvth._evaluate() constraints state true
[latest-21337]2021-12-16T12:44:22.895Z <Rule:5:Rule.js:1041> Rule#rule-kx8ydvth trigger conditions NULL
[latest-21337]2021-12-16T12:44:22.895Z <Rule:5:Rule.js:1042> Rule#rule-kx8ydvth rule state changed, was (undefined) now (null)
[latest-21337]2021-12-16T12:44:22.896Z <Rule:INFO> Globe Lamp Toggle - Lua (Rule#rule-kx8ydvth) NULL!
[latest-21337]2021-12-16T12:44:22.896Z <Rule:5:Rule.js:1044> Rule#rule-kx8ydvth rule state now (null), changed true

It’s not hard to test. Used their API tool to run the example code from their own API documentation (the one that uses with the code parameter and Lua base-64 encoded). Used to work, now doesn’t work and hasn’t worked for quite a while.

    "method": "",
    "id": "_ID_",
    "params": {
        "code": "cHJpbnQoIkhlbGxvIEx1YSEp"

If you enter into the API tool, the choices no longer include any variant with the code option (you can send the example code using the custom option), and if you attempt to send it through your own connection, you get an error. Sending this either through the API tool or another connection:

	"api": "1.0",
	"id": "17dc38fd85f",
	"method": "",
	"params": {
		"code": "cHJpbnQoIkhlbGxvIEx1YSEp"

Response is this:

	"error": {
		"code": -32600,
		"data": "rpc.params.notfound",
		"message": "Bad params"
	"id": "17dc38fd85f",
	"method": "",
	"result": {}

So it certainly appears to have been removed, based on its absence from the API tool and its response when tested with their own example code.

My hub is currently on

@cw-kid am I missing something relevant in the log snippet you posted… there’s… nothing, that I can see…? Did you post the right snippet? In any case, if you are trying to draw @Oleh 's attention to the API issue, that’s fine, but if you are asking about an MSR behavior, this is not the place for it.

Great many thanks for your response.

I will look into what you said and ask the Ezlo Devs about it also.