With the older Vera hubs, it was simple to enable / disable the built-in HTTP server via the web interface, but with the new Ezlo hubs I see no such option in the beta interface (http://ezlogic.mios.com)
I am attempting to make a simple HTTPS request to my Ezlo Hub, but it appears the built-in HTTP server is not enable. Does anyone know how to enable / disable it?
Here’s a basic Python script to illustrate what I’m trying to do, and the error I get.
r = requests.get(url = URL)
data = r.json()
print (data)
The error I get: (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x7f8c990f6b50>: Failed to establish a new connection: [Errno 61] Connection refused’))
This implies the HTTP server is not running. Any pointers would be appreciated. Thanks.
Which suggests the server is running? But, when I run the Python script I posted earlier, I get the same error message: “Failed to establish a new connection: [Errno 61] Connection refused’))”
I just tried a https command on my hub, I can still connect OK but I can’t turn on the plug device I selected I am getting an error about the device ID which is the correct one though.
{"error":{"code":-32602,"data":"rpc.params.wrong_field","message":"Wrong field of object","reason":"Item not found by id: 5fccde48120bab1205c86e0c"},"id":"60aad730120bab0320000bc9","result":{}}
I’ll have to have a think about this and get back to you.
I’m not getting any response code, still the HTTP server / connection error. Somehow my HTTP server is not running, even though it claims it “is”. I must be missing some step…
I decided to factory reset the Ezlo just to clear everything out and try again.
I did both the paper clip method and the hub.reset command via the dashboard.
Now, no matter what I do, it will not connect to the WiFi access point it connected to when I first set it up.
I’m going to try wired now, but the WiFi in general seems very buggy.
Ok, I learned something today… it appears (due to a bug, limitation, or design) that you CANNOT control devices via the API when you have set-up the hub in wireless mode ONLY when the hub is wired.
What is very odd about this, is that if you set-up the hub in wireless mode, you CAN use the Vera application to control devices, but you cannot control the devices via the API - at least not locally.
This is a very strange design decision, or I’m missing something. It should make no difference how the hub is connected locally.
Once I factory reset the hub and put it in wired mode (and enabled the HTTP server) I could control a device via a browser with:
and got a successful response:
{“error”:null,“id”:“60aaf000077e903f79d6059f”,“result”:{}}
I factory reset the hub (again) and put it in wireless mode, and connections to the hub failed.
Finally factory resetting one last time and using a wired mode confirmed it worked.
So - bottom line, to use the HTTP/S API locally, use the hub in wired mode, not wireless mode.
All in all a frustrating, but learning experience. Would love to hear what the devs say.
@oleh, please see my [SOLVED] post in the thread. Yes, it’s a Ezlo Plus.
BTW, support told me that the product could NOT be used locally, ONLY via the cloud. That is clearly not the case, and even the API docs give examples using it locally.
(The APIs docs need to be extended to include @cw-kid write-up on how to enable the HTTP server, etc. and perhaps include a note about what we found out today (unless the error is on my part).