CW's IDIOT GUIDE - To Ezlo platform HTTP API commands aka Luup Requests

PART 6 - OTHER CONTROL COMMANDS

1. Armed / Disarm a device.

Example Armed Command:

https://192.168.0.11:17000/v1/method/hub.device.armed.set?_id=5f4e588c120bab1069c13c4f&armed_bool=true

Curl with no auth:

curl --insecure --http1.1 “https://192.168.0.11:17000/v1/method/hub.device.armed.set?_id=5f4e588c120bab1069c13c4f&armed_bool=true”

Example Disarmed Command:

https://192.168.0.11:17000/v1/method/hub.device.armed.set?_id=5f4e588c120bab1069c13c4f&armed_bool=false

Curl with no auth:

curl --insecure --http1.1 “https://192.168.0.11:17000/v1/method/hub.device.armed.set?_id=5f4e588c120bab1069c13c4f&armed_bool=false”

The easiest way to discover the correct deviceid _id number is to use the online API tool and watch the “Broadcast response - Hub’s latest broadcast messages” section.

Go to https://apitool.ezlo.com/auth and login with your Vera username and password.

Select your Ezlo Hub’s Serial number and click the Connect button.

In the Vera Mobile app press the “Armed” button on the device you want to construct a HTTPS command for.

Watch the Broadcast section for the response.

image

You will see a response like the above screen shot. Copy the _id number this is the one to use in your HTTPS command.

2. Turn ON / OFF a Switch. (This is a virtual switch on my Ezlo Plus)

Again the easiest way to discover the correct deviceid _id number is to use the online API tool and watch the “Broadcast response - Hub’s latest broadcast messages” section.

Turn on the switch you want to control via the HTTP API and look for its item object _id number. In this example its “5f57d92f120bab1065bc0e76”

image

Command with no auth to turn on the switch:

https://192.168.0.11:17000/v1/method/hub.item.value.set?_id=5f57d92f120bab1065bc0e76&value_bool=true

OR

https://192.168.0.11:17000/v1/method/hub.item.value.set?_id=5f57d92f120bab1065bc0e76&value_int=1

Command with no auth to turn off the switch:

https://192.168.0.11:17000/v1/method/hub.item.value.set?_id=5f57d92f120bab1065bc0e76&value_bool=false

OR

https://192.168.0.11:17000/v1/method/hub.item.value.set?_id=5f57d92f120bab1065bc0e76&value_int=0

3. Trip and Un-trip a motion sensor. (This is a virtual motion sensor on my Ezlo Plus)

To find the correct item object _id number for this motion sensor I had to use the “hub.items.list” query in the online API tool, in this example its “5f57d230120bab1065bc0e74”

image

Command with no auth to trip the motion sensor:

https://192.168.0.11:17000/v1/method/hub.item.value.set?_id=5f57d230120bab1065bc0e74&value_bool=true

OR

https://192.168.0.11:17000/v1/method/hub.item.value.set?_id=5f57d230120bab1065bc0e74&value_int=1

Command with no auth to un-trip the motion sensor:

https://192.168.0.11:17000/v1/method/hub.item.value.set?_id=5f57d230120bab1065bc0e74&value_bool=false

OR

https://192.168.0.11:17000/v1/method/hub.item.value.set?_id=5f57d230120bab1065bc0e74&value_int=0

The eagle eyed are probably noticing by now that the commands are the same for the switch and motion sensor, we are just changing the devices item object _id number to the device we want to control !

4. Controlling Ezlo House Modes (Home / Night / Away / Vacation).

Using the online API Tool we can use the “hub.modes.get” query to list our house modes and see their ID numbers.

Looking in the “Response” section and the “Result” we can see the first House Mode item object:

Home = _id “1”

image

Away = _id “2”

image

Night = _id “3”

image

Vacation = _id “4”

image

OK so now we know the _id numbers for each of the different House Modes, lets look at switching the modes via HTTPS commands, for this we can use “hub.modes.switch”.

NOTE: This only works when using the token authentication:

EDIT: Seems you can switch House Modes with no authentication, I rebooted my Ezlo Plus and then it started working with no auth.

Curl HTTPS command using Auth - HOME MODE

curl -K ezlo_plus_curl_auth --http1.1 --insecure https://192.168.0.11:17000/v1/method/hub/modes/switch?modeId=1

Curl HTTPS command using Auth - AWAY MODE

curl -K ezlo_plus_curl_auth --http1.1 --insecure https://192.168.0.11:17000/v1/method/hub/modes/switch?modeId=2

Curl HTTPS command using Auth - NIGHT MODE

curl -K ezlo_plus_curl_auth --http1.1 --insecure https://192.168.0.11:17000/v1/method/hub/modes/switch?modeId=3

Curl HTTPS command using Auth - VACATION MODE

curl -K ezlo_plus_curl_auth --http1.1 --insecure https://192.168.0.11:17000/v1/method/hub/modes/switch?modeId=4

Curl HTTPS command using Auth - CANCEL HOUSE MODE SWITCHING

Using this command you can cancel the switching to another house mode.

curl -K ezlo_plus_curl_auth --http1.1 --insecure https://192.168.0.11:17000/v1/method/hub/modes/cancel_switch?modeId=1

How to increase the “hub.modes.alarm_delay.set” and "hub.modes.switch_to_delay.set"

These are not HTTPS commands however we can use the API Tool to set these delays in seconds, the default is 30 seconds. I have set both of these to 120 seconds.

image

image

5. Control Roller Shutter / Window Covering.

A Roller Shutter devices “dimmer” value 0 to 100 can be controlled.

In the API Tool first use the “hub.devices.list” query to find the _id number of the Roller Shutter device.

image

Next use the “hub.items.list” query to find the correct device item object for this Roller Shutter device.

There are several device item objects for a Roller Shutter device, the one we want to use is the “dimmer” item.

image

Example HTTPS command to set a Roller Shutter to 50% with no Auth.

https://192.168.0.11:17000/v1/method/hub.item.value.set?_id=5f5b7a69120bab1066107b8f&value_int=50

6. Controlling a Thermostat’s Set Point value.

In the API Tool first use the “hub.devices.list” query to find the _id number of the Thermostat device.

image

Next use the “hub.items.list” query to find the correct device item object for this Thermostat device.

The device item object we want to use is “thermostat_setpoint”.

image

Example HTTPS command with no Auth to set the Thermostat set point to 23 degress.

https://192.168.0.11:17000/v1/method/hub.item.value.set?_id=5f5b78bc120bab1066107b87&value_int=23

Example HTTPS command with no Auth to set the Thermostat set point to 10 degress.

https://192.168.0.11:17000/v1/method/hub.item.value.set?_id=5f5b78bc120bab1066107b87&value_int=10

There are also some other device item objects for a thermostat device such as:

thermostat_setpoint_heating
thermostat_setpoint_cooling

However when I tried to send values to these items it did not work and those set points did not change, even though I received no error in Postman.

There is also a thermostat item named “thermostat_mode” with these possible modes by the looks of it. However I don’t currently know the correct commands to use for setting these modes?

0: “off”
1: “heat”
2: “cool”
3: “auto”
4: “aux”
5: “resume”
6: “fan_only”
7: “furnace”
8: “dry_air”
9: “moist_air”
10: “auto_change_over”
11: “saving_heat”
12: “saving_cool”
13: “away_heat”
14: “away_cool”
15: “full_power”
16: “special”
17: “eco”
18: “emergency_heating”
19: “precooling”
20: “sleep”

2 Likes

Hi
thank you for this guide, we are still very far from simple things like I descative the authentication via a button on the interface and I create the http request simply with an ID and a parameter.
For me it’s too complicated at the moment to do all this, mounted a Pi, create this, create that, two machines that also run, one that crashes and it’s the loose

2 Likes

I’ve updated the guide with the first 4 parts for controlling a device or running a scene, either with authentication turned on or with authentication turned off.

2 Likes

Hi @cw-kid,

Very nice write ups. Well done.

Cheers Rene

1 Like

This is very good and the kind of materials ezlo should producing.

Does it support requesting device status? That would allow better integration with NodeRed and the like.

Not sure yet but I would expect so. I haven’t seen any example commands for setting or getting a devices variable / status.

Yes. There’s a doc in a previous thread with available calls. @reneboer has some samples in its python script, if I remember correctly.

Thank you @cw-kid :raised_hands: !

I’ve create an article with the information provided, so everybody can access it. I’ve posted it here as well.

1 Like

@Ioana

I’ve updated Part 3 and confirmed that the commands work for a Dimmable Light.

And I’ve updated Part 6 for controlling House Modes and for tripping / untripping a motion sensor.

They will be continued to be updated as and when we discover new HTTPS commands.

2 Likes

Great! Please ping me/send a dm whenever you update the info, so I’ll make sure we’re using the latest and greatest in the webpage as well :slight_smile:

Hello @cw-kid and @Oleh i tried this command and something is not working.
when i trip the virtual sensor it does not change state in the UI in the app, so i don’t know if its tripped or un-triped. I armed the sensor so at least i can have a notification to see if its working and when i trip the sensor nothing happens but when i un-trip the sensor i receive a notification that movement is no longer detected.

is it a bug or this is a case only with me?

I’m having the exact same issue so I would say a bug.

When I tested the virtual motion sensor in the Vera mobile app for Android you could see that it was tripped by the icon flashing.

I have not tested notifications.

I know there is a bug where I was unable to disarm a device by https command. But I could arm the device OK.

So it’s an Android vs iOS thing then again :smiley:

1 Like

i’m on IOS also

@Oleh @Ioana So i tested a scene where when motion is detected to flip a virtual switch and when stops to turn it off. So its working… The display in IOS app is just not working.

@cw-kid, about PART6

https://192.168.0.11:17000/v1/method/hub.device.armed.set?_id=5f4e588c120bab1069c13c4f&value_bool=false

  1. Please use “$URL” to avoid truncation of a query in Bash shell:
  2. Please, use the “armed” property of a command, not “value”, replace “value_bool” with “armed_bool”.

curl --insecure --http1.1 “https://192.168.0.11:17000/v1/method/hub.device.armed.set?_id=5f4e588c120bab1069c13c4f&armed_bool=true
curl --insecure --http1.1 “https://192.168.0.11:17000/v1/method/hub.device.armed.set?_id=5f4e588c120bab1069c13c4f&armed_bool=false

hub.device.armed.set WS example:
{
“method”: “hub.device.armed.set”,
“id”: “ID”,
“params”: {
“_id” : “OBJECT_ID”,
“armed”: true,
}
}

1 Like

Thanks I can confirm the disarm commands now work, I have updated that section of the guide.

1 Like

Hi @cw-kid,

Small addition to the guide. If you want to be able to send commands to the Ezlo hub without needing a password you must use method hub.offline.anonymous_access.enabled.set. You still have to use https and the --insecure option.

The method hub.offline.insecure_access.enabled.set allows plain http access, i.e. not using SSL. So you can use curl --http1.1 “http://…”

I would leave the SSL option on unless you cannot use https for some reason.

Cheers Rene

1 Like

HTTP commands were not working for me initially they are now however.

I have updated Part 2 here, with the new information about HTTP commands vs HTTPS.

Thanks

1 Like

Best Home Automation shopping experience. Shop at getvera!

© 2020 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules