@mr007,
do you want to control hubs through Http API via public endpoint or it will be some integration with other services/apps?
@Oleh,
Hubs through HTTP API via public endpoint. Along with some basic smart home controls - I manage properties that interact with all sorts of different APIs - this provides intelligence and an abstraction layer based on various events that can occur at any given time. With the retirement of the Vera devices, the goal is to replicate what we had existing as the properties grow and we can no longer configure them with the edge controllers.
Are they cloud services (eg: do you talk to them over the internet or local devices)?
@melih they are all cloud services enabled through a controller such as Vera or having direct APIs of their own. This is obviously the point of the public endpoint.
I understand.
Can you please provide me (either here or on a PM) list of these cloud services, so that we can integrate it natively into our system for you. (So that when you are creating automations etc you can do it from a single interface and no messing around running APIs etc)
@melih I think you’re missing the point. Many of these services used are not feasible via your interface and wouldn’t make sense to be honest. I don’t just talk to home automation apis and the abstraction layer is absolutely necessary. I’ll PM you as well - a public API is required.
Trying the initial script above, both remotely and from a computer on the hub network I’m getting the following message.
Suggestions on how to resolve this?
====================================================================
Get Controllers List
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): vera-us-oem-account12.mios.com:443
Traceback (most recent call last):
File “C:\Users\Thomas Oates\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\urllib3\connectionpool.py”, line 466, in _make_request
self._validate_conn(conn)
File "C:\Users\Thomas Oates\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local
…
-packages\Python310\site-packages\requests\adapters.py", line 698, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host=‘vera-us-oem-account12.mios.com’, port=443): Max retries exceeded with url: /account/account/account/446891/devices (Caused by SSLError(SSLError(1, ‘[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1007)’)))
I just tried that Python script again and it worked for me. I was given a token back. I ran the Python script on a Linux Debian box that was on the same LAN as my Ezlo Plus controller.
I have hidden some sensitive information obviously.
This is the command I ran and I added my controllers serial number my Vera account username and password etc.
python3 Ezlo_create_curl_config.py EzloIP EzloSerial userID pwd
See here for the original thread I think:
You might also want to take a look at these 3rd party tools “Ezlo Hub Kit”. I have never used them however.
@oleh Is there no official Ezlo information about how to use the Ezlo controllers HTTP(s) Server API but remotely on the WAN when you are not local to the Ezlo controller ???
EDIT: Just noticed it was also asking for the controllers IP with “EzloIP” I didn’t change that part of the command or enter the IP and it still worked and returned a token. I just ran the command again now replacing “EzloIP” with the LAN IP of the controller and it still works and retuned a token.
Its a long time ago now we looked into all this and wrote about it on the forum, so I forget a lot of it now.
But I think the reason why we initially needed that python script to get the token, was because at that time there was no way to turn OFF authentication for use with the Ezlo Controllers HTTP/S Server API.
On the Idiot’s Guide I wrote on the first post of that thread I talked about this Python script.
Once you have your token, I then created a file called “ezlo_plus_curl_auth” and added the token into it, something like this:
-H "Authorization: Basic FGYGHCE3NjAtYTdkZC0xMWU5LWJiOTYtNjdiZGM4MzAzYzBmOmhoX202OEdmQE4tVFBBUnNtIV9rMm0tMWVzZ2pYKlQ0ZUlQbmUNFCSzMERaJTZjWC1PViFHUTFMJVVRMmxNS2VBMWtmQl84RkE1WDkyazRXITN+LW0walVYWVFRb2VncHhvFJUBDWh3VmtJdDhSaWUjTy1YQVF1ejNwMHJpX3RxYWlWUkpaRm82UVlONnB2bG04TypZfnBUcXIxLTV5U21HT25aZiQ0UkF3Y3Zoc34yI2dsS1QjSiRCJDNlZyoycXIkNFF+a0NHcFljWG51b3lZM0ZMMSE1JXE5MUkyBVDSWTIyYy1kNTZlLTQyZWYtYmM3Ny05ZDhkZDNjODk2NTc="
--insecure
--http1.1
We could then use a local CURL command like this to query the Ezlo Controllers HTTP/S Server API.
Where the IP 192.168.0.40 was the IP address of the Ezlo controller (I used DHCP reservation on my router, to ensure that IP address would not change).
curl -K ezlo_plus_curl_auth https://192.168.0.40:17000/v1/method/hub/info/get
Later Ezlo added a way for us to turn OFF the authentication altogether, so we no longer needed any token. See the second post on that thread, where I talk about “offlineAnonymousAccess” and “offlineInsecureAccess” being set to false.
This was fine for me, for local LAN comms as long as we didn’t port forward port 17000 to the Internet.
I don’t believe at any point I ever attempted to use the Ezlo Controllers HTTP/S Server API remotely via the Internet and via some kind of Ezlo relay server. Or by just using my static ISP WAN IP address or a Dynamic DNS domain name service and port forwarding and sending commands directly to it that way.
Others may have done that and got it working?
Also NOTE - Everything I wrote about was about using the HTTP/S Server API to control the Ezlo Controller and its devices.
There is also a completely different Web Sockets API as well.
3rd party things like Multi System Reactor (Logic rules engine) uses the Web Sockets API to communicate with the Ezlo controllers. Again this is normally done locally on the same LAN.
I never used the Web Sockets API myself as it was more than I needed and a little above my understanding as I am not a developer.
Seeing your original question here, you say “I’m attempting to setup an Azure Data Factory job to retrieve the temperatures of all my thermostats for later reporting”
To SET a devices Temp value you can use a command like this.
https://192.168.0.40:17000/v1/method/hub.item.value.set?_id=6605aed5123e4314b04b79e4&value_int=21
You need the Item ID number of the Temp device, which can be obtained by using the Online API Tool.
You can use HTTP/S command like these to retrieve temps from devices.
To retrieve the current temp is a bit more tricky, as you need to send a POST HTTP command rather than a simple GET.
I just tested this in Postman and it worked and got the temp value back.
Here was the BODY I used:
"id"
is the Devices ID number of the Temp Sensor
"items":{"ids
is the ID number of the Item for the Temp Sensor
{"method": "hub.data.list", "id": "6605aed5123e4314b04b79e3", "params": {"items":{"ids":["6605aed5123e4314b04b79e4"],"fields":{"include":["valueFormatted"]}}}}