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

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

There was a missing device type in the test_plugin for creating “Virtual Devices” and that was a Door / Window Contact Sensor.

I asked the devs and they have added it. Its not currently available on the live Ezlogic site yet but will be soon.

image

It does add the device with a battery icon for some reason, still trying to find out why?

image

Its the “dw_state” item ID that you need to control to trip / untrip the sensor.

items:
0:
_id: "65a540e6123e431acd486ba8"
deviceId: "65a540e6123e431acd486ba7"
enum: Array[3] ["dw_is_opened","dw_is_closed","unknown"]
hasGetter: true
hasSetter: false
name: "dw_state"
show: true
value: "unknown"
valueFormatted: "unknown"
valueType: "token"

Trip the virtual door sensor:

https://192.168.0.11:17000/v1/method/hub.item.value.set?_id=65a540e6123e431acd486ba8&value=dw_is_opened

Untrip the virtual door sensor:

https://192.168.0.11:17000/v1/method/hub.item.value.set?_id=65a540e6123e431acd486ba8&value=dw_is_closed

image

NOTE - You cannot control real paired security sensor devices in this manner via the HTTP Server API. Just the virtual ones.

I added a Virtual Temperature Sensor device today to my Ezlo Plus controller.

Using the Online API Tool I found its Item ID number for the temp part of the device.

items:
0:
_id: "66058f6c123e4314a6310100" <<<<--------
deviceId: "66058f6c123e4314a63100ff"
hasGetter: true
hasSetter: false
name: "temp"
scale: "celsius"
show: true
value: 0
valueFormatted: "0"
valueType: "temperature"

I was then able to use a HTTP command such as this to set a temp value on the virtual device.

https://192.168.0.101:17000/v1/method/hub.item.value.set?_id=66058f6c123e4314a6310100&value_int=23

image