Ezlo Linux firmware - HTTP documentation preview

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?

Hi,

I think the https request only work for the Edge hub and not the Atom. The latter is still to come.

Cheers Rene

I just ordered a new Atom from Amazon and it doesn’t seem like :17000 or :22 are open. It pings, but get connection refused on those ports. How do I enable that for local API commands?