Ezlo Linux firmware - HTTP documentation preview

No, I can successfully remove a virtual device.

Its working now and deleting the device with this code formatting:

{
    "method": "extensions.plugin.run",
    "id": "_ID_",
    "params": {
        "script": "HUB:test_plugin/scripts/remove_device",
        "scriptParams": {
            "device_id": "5f157ebd46aaf021143f67d4"
        }
    }
}

@Oleh

How do we switch House Modes using the HTTP API ?
What is the correct command ?

I can see there are two different device id numbers.

These are the _id numbers for each mode:

Home = _id “1”
Away = _id “2”
Night = _id “3”
Vacation = _id “4”

I’ve tried a command like this with both those device id numbers. but it doesn’t work.

https://192.168.0.11:17000/v1/method/hub.modes.switch?_id=5f4e588c120bab1069c13c4f&value_int=2

Response:

 "error": {
        "code": -32602,
        "data": "rpc.params.invalid",
        "message": "Wrong params"
    },
    "id": "5f58d29a120bab10908be220",
    "result": {}
https://192.168.0.11:17000/v1/method/hub.modes.switch?_id=5f57d230120bab1065bc0e73&value_int=2

Response:

"error": {
        "code": -32602,
        "data": "rpc.params.invalid",
        "message": "Wrong params"
    },
    "id": "5f58d2d5120bab10908be222",
    "result": {}

Just tried this command in Postman:

https://192.168.0.11:17000/v1/method/hub/modes/switch?modeId=2

Still no dice:

Response:

 "error": {
        "code": -32602,
        "data": "rpc.params.invalid",
        "message": "Wrong params"
    },
    "id": "5f58dae1120bab10908be257",
    "result": {}

Then tried this one:

https://192.168.0.11:17000/v1/method/hub/modes/switch?modeId="2"

Response is different:

"error": {
        "code": -32602,
        "data": "ezlo.house_mode.not.exist",
        "message": "The house mode with this id does not exist"
    },
    "id": "5f58db7e120bab10908be259",
    "result": {}

Hmmm, my requests are authenticated with a token. Perhaps that is the difference?

1 Like

I can try it using authentication.

So what is the HTTPS command you are using ?

Yes your correct it only works when using authentication:

This is the correct URL when used with authentication.

https://192.168.0.11:17000/v1/method/hub/modes/switch?modeId=2

Response:

HTTP/1.1 200 OK
content-type: application/json
connection: close

{
    "error": null,
    "id": "5f58eacb120bab10962191c5",
    "result": {
        "switchToDelay": 120
    }
}

I’ve updated the dummy guide here for house modes, see item number 4.

You can also send a cancel house mode switching command which is handy and also use queries to set the delays in seconds.

I rebooted my Ezlo Plus due to a IP-address change and now I can change house mode without authentication.

OK that’s strange.

Has anybody managed to send insecure http command from Home Assistant to Ezlo or all of the HA users are banned :slight_smile: I tried to send it with rest command but it looks like you can only send http get commands with rest not https like in case with ezlo. Or i’m doing something wrong.

I’ve just rebooted my Ezlo Plus.

I tried to change the House Mode with no auth and I was able to switch it from Home to Away and also send the Cancel Command to stop it.

So it does seem to be working now with no auth.

Not sure why it wasn’t working yesterday ?

No I haven’t been able to send any HTTP commands to the Ezlo hub.

Even with auth turned off seems you still have to use HTTPS.

Does anyone know the correct commands for a Thermostat device ?

I am unable to get these device item objects working:

thermostat_setpoint_heating
thermostat_setpoint_cooling
thermostat_mode

I can however use thermostat_setpoint OK and change the setpoint using value_int=23 for 23 degrees etc.

See item number " 6. Controlling a Thermostat’s Set Point value." on this thread in the dummy guide here for further details.

There is also some issue or bug that kinda crashes the Vera Mobile Android app.

If I am in the Vera Mobile app connected to the Ezlo Plus and looking at the devices view, if I then send some incorrect / bad HTTPS commands to the HTTP Server API from Postman, then the Vera Mobile app kinda crashes it switches itself back to the Controllers list page, the Ezlo Plus then shows as offline and red briefly and then it comes back to online and green and I have to select the controller again to get back in to the app proper and look at the devices again.

@Ioana

Please can someone answer my questions here at number 6. about controlling a Thermostat device.

Also I need some working example HTTPS commands for retrieving devices current status and retrieving different variable values from a device.

As yet I’ve been unable to use a HTTPS command to query a device.

Also has the bug been fixed for disarming a device via a HTTPS command? As previously it was not working is it logged in your bug tracking system?

Thank you.

Hi cw-kid,

I asked my colleague @Oleh to get back to you with answers.

@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,
}
}

@Oleh

Thanks the Disarm command now works, I’ve updated the guide.

How about my other two question above ?

Cheers.

Best Home Automation shopping experience. Shop at getvera!

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