LUA code working in Vera but not with Ezlo

I have been running a small script in my Vera to send an http request on port 3000 and 3001 to my Raspberry pi to turn off the monitor on a scheduled basis. The code has run fine but I’m trying to port it to my Ezlo for migration and the same code is erroring out. Any help you guys could give me is much appreciated.

Code working in Vera:
local http = require(“socket.http”)
http.TIMEOUT = 1
result, status = http.request(“http://192.168.5.210:3000”)

Error when I copy it to a LUA script in Ezlo:
[string “anonymous:6387588694e7f5539a16a519”]:2: attempt to index a nil value (local ‘http’)
stack traceback:
anonymous:6387588694e7f5539a16a519:2

Hello @ceskelund

Thank you for contacting eZLO Smarter Home Control’s support.

We have answered your ticket a few minutes ago, please check your email.

Regards,

Jonathan Botero.
Customer Care Tier 1 Support.

Thank you jonathan, but the links you referenced didn’t answer my question. I’m trying to send an HTTP request to the IP address of my raspberry pi that is listening on ports 3000 and 3001. If I send :3000, the pi turns the video output on, if I send :3001, it turns the video output off. This was working in Vera but fails in Ezlo.

Thanks
Chris

Instead of LUA code have you tried a meshbot with an HTML PUT action instead? That is how I control some cameras on my network that I used to control with LUA code on Vera.

try it here>>> ezlogic.mios.com

1 Like

Thankyou @curiousB - That worked.

1 Like

did you find this easier than using LUA?

Anything you would us to improve in this process?

thanks