Ezlo Linux firmware - HTTP documentation preview

@Oleh

What is the Ezlo equivalent of SDATA?

This http command can be used in a browser for Vera.

http://VERA-IP/port_3480/data_request?id=sdata

Hi cw-kid,

The hub.data.list comes closest. It gives devices, items, scenes and rooms. You can even apply pretty advanced filters on the values you want returned to optimize the data amount returned. I am looking into it for a newer version of the EzloBridge plugin.

Cheers Rene

1 Like

@cw-kid,
The closest analog of sdata is hub.data.list. This command allows to request data from multiple collections from a hub in one request, allows data filtering by id and field names. Default request looks like this:

{
    "api": "1.0",
    "method": "hub.data.list",
    "id": "<REQUEST_ID>",
    "params": {
        "devices":null,
        "items":null,
        "rooms": null,
        "scenes":null
    }
}

Default request, with all fields filled:

{
    "api": "1.0",
    "method": "hub.data.list",
    "id": "<REQUEST_ID>",
    "params": {
        "devices":{ 
            "ids":[], "fields": { "include":[] }
         },
        "items":{ 
            "ids":[], "fields": { "include":[] }
         },
        "rooms":{ 
            "ids":[], "fields": { "include":[] }
         },
        "scenes":{ 
            "ids":[], "fields": { "include":[] }
         }
    }
}
2 Likes

Detailed description of hud.data.list in attachment
hub.data.list.pdf (89.0 KB)

@cw-kid,
Just curious about what project are you working on with this request?

@Oleh I’m talking to “The Home Remote” developer Bill about him adding support for the Ezlo platform.

The Home Remote is a 3rd party cross platform dashboard GUI control app.

I wrote about it here.

Bill has expressed an interesting in adding support for Ezlo hubs.

I’ve sent him all the Ezlo API documentation and links to the threads on this forum.

I’ve also offered him remote access to my Ezlo Plus hub for testing and developing against, unless you guys want to send him an Ezlo Plus hub ?

I’ve been talking to Melih recently about how all the 3rd party dashboard apps out there and all the 3rd party HA systems / HA software platforms out there that currently integrate with Vera hubs are all going to be broken and no longer work with the new Ezlo hubs and API’s.

There are many systems out there that integrate with Vera currently and all will stop working, Home Assistant being a prime example, a lot of those folks just use Vera hubs as a “Z-Wave Radio”.

All systems and apps like this will have to be updated by the 3rd party developers for the Ezlo platform. Many will never be updated however due to lack of interest or them not being actively developed anymore like the Imperihome dashboard app for example.

1 Like

Hi
there maybe a way to integrate it into Imperihome using ISS from it

1 Like

Not sure I’ve never used Imperihome ISS. Ask @reneboer he’s used it for Open Luup.

Hello,

How do I make these API calls remotely? I.e. is there a vera domain name I can hit instead of the local IP?

Thanks!

I don’t believe Ezlo have this functionality currently.

Apparently you could do this in the past with the Vera Http API and their relay server, but they discontinued that service.

Personally I’ve only ever used http calls like these locally on my LAN.

I guess you could open the port number on your firewall and port forward, but I wouldnt recommend that unless you can add some extra security some how, like a static source IP address.

A VPN connection to your local LAN might be another option.

Hey cw-kid! Your CW’s IDIOT GUIDE has been very helpful, thank you for putting that together!

I found something that’s working right now, I’m just not confident that it’ll be supported long term since I can’t find any documentation on it… but here’s what I did:

  1. Following Python Script for Ezlo FW HTTP API Curl commands I saw we could get the Identity and IdentitySignature by doing a:
GET https://vera-us-oem-autha11.mios.com/autha/auth/username/{USER_NAME}?SHA1Password={SHA1_PASSWORD_FROM_SCRIPT}&PK_Oem=1&TokenVersion=2
  1. Using the Ezlo API Tool, and inspecting the requests with the Chrome DevTools, I noticed they were making this call (I’m not sure if this domain will always be around):
GET https://mms-proxy.vercel.app/device/device/device/{DEVICE_SN}
--header MMSAuth {Identity}
--header MMSAuthSig {IdentitySignature}

From the response we get a Server_Relay (e.g. wss://nma-server6-ui-cloud.ezlo.com:443) which I can connect to with a websocket and start communicating. The Chrome DevTools showed me what messages they’re sending to authenticate.

But without seeing any official documentation, I’m worried I’ll build something that will stop working one day because it’s not officially supported.

Good detective work. @Oleh is the man to ask this question too.

Hi,

I did manage to use a Websocket client remotely as that is basically mimicking the Vera App access. However, I do not know if that applies to the http requests.

@Sorin, can you answer this?

Cheers Rene

I think this is still @Oleh. I’ll ping him privately.

Hi @reneboer, curently http requests are working on local mode only.

Hi @zAndy
Checking with the cloud team and will back to you asap.

@Oleh i’m trying to use the http api but i run in to some problems for some reason its not working.

i’m trying to run a scene with the following command:
http://192.168.0.110:17000/v1/method/hub/scenes/run?sceneId=5ffda2f1124c353a415f679a
but i get
Hmmm… can’t reach this page

192.168.0.110 refused to connect.

ERR_CONNECTION_REFUSED

in the api tool i have enabled offlineAnonymousAccess: true and offlineInsecureAccess: true, the id of the scene is 5ffda2f1124c353a415f679a

_id: “5ffda2f1124c353a415f679a”

enabled: true

house_modes: Array[4] [“1”,“2”,“3”,“4”]

is_group: false

name: “Test Scene”

parent_id: “5ffd9387124c3539f37741d1”

then: Array[1] [{“blockOptions”:{“method”:{“args”:{“abstractId”:“abstract”,“capability”:“capability”,“command”:“command”,“parameters”:“parameters”},“name”:“sendCloudAbstractCommand”}},“blockType”:“then”,“fields”:[{“name”:“abstract”,“type”:“string”,“value”:“6a4dfa60-54d3-11eb-b471-a3668ce75ba8”},{“name”:“command”,“type”:“string”,“value”:“send”},{“name”:“capability”,“type”:“string”,“value”:“text_command”},{“name”:“parameters”,“type”:“object”,“value”:{“text”:“play classical lullabies playlist on kid echo”}}]}]

user_notifications: Array[0] []

when: Array[0] []

what i’m missing?

B

@eonnet
192.168.xxx.xxx network is not a public network.
It’s a network provided by some local hub/router. So, no one outside this local network has access to addresses of this network. So, you need to make requests from the same network your hub is located in.
To check if you have access to that IP, please, open the terminal window and run the command:
ping 192.168.0.110
If you’ll get the good ping like (my hub has a similar kind of address 192.168.11.171):

PING 192.168.11.171 (192.168.11.171) 56(84) bytes of data.
64 bytes from 192.168.11.171: icmp_seq=1 ttl=64 time=0.260 ms
64 bytes from 192.168.11.171: icmp_seq=2 ttl=64 time=0.238 ms

So, if your computer is not in the same network, you will not be able to use local HTTP requests to your hub. If you get good ping results, you can ask your hub with curl console utility just like that (in bash for Ubuntu Linux):

hub.info.get with POST request:
curl --insecure “https://192.168.0.110:17000/v1/request” -X POST --http1.1 --data-raw ‘{“method”: “hub.info.get”, "id: “auto”, “params”: {}}’

hub.info.get with GET request:
curl --insecure “https://192.168.0.110:17000/v1/method?hub.info.get” --http1.1

get broadcasts stream:
curl --insecure “https://192.168.0.110:17000/v1/broadcasts” --http1.1

Hi @oleh yes i’m on a local network of course. the ping results is

miki@ubintu:~$ ping 192.168.0.110
PING 192.168.0.110 (192.168.0.110) 56(84) bytes of data.
64 bytes from 192.168.0.110: icmp_seq=1 ttl=64 time=0.585 ms
64 bytes from 192.168.0.110: icmp_seq=2 ttl=64 time=0.497 ms
64 bytes from 192.168.0.110: icmp_seq=3 ttl=64 time=0.673 ms
64 bytes from 192.168.0.110: icmp_seq=4 ttl=64 time=0.533 ms
64 bytes from 192.168.0.110: icmp_seq=5 ttl=64 time=0.619 ms
64 bytes from 192.168.0.110: icmp_seq=6 ttl=64 time=0.537 ms
64 bytes from 192.168.0.110: icmp_seq=7 ttl=64 time=0.605 ms

the result of the curl command is:

miki@ubintu:~$ curl --insecure “https://192.168.0.110:17000/v1/method?hub.info.get” --http1.1
curl: (7) Failed to connect to 192.168.0.110 port 17000: Connection refused

What version of the firmware on your hub (hub.info.get)
Can you fetch some logs from the device?
ssh root@192.168.0.110 -n ‘tail -n500 -F /var/log/firmware/ha-uid.log’
Does it contain some errors?