Cannot control Zigbee devices via terminal using iHost Open API

Hello,

I’m currently using a Sonoff iHost (eWeLink CUBE 2.5.2) and I’m trying to control local Zigbee devices via the Open API. Specifically, I’m working from the Homebridge Docker terminal, running on the iHost itself.

I intend to use the Homebridge plugin “GarageDoor Command”, where I would integrate:

  • A contact sensor (Zigbee, added locally via iHost)
  • A relay switch (added via the eWeLink app)

I’m able to retrieve device information using the /open-api/v1/rest/devices endpoint, but when I try to control a device using PUT /devices/state, I get the following error:

json

{"error":110000,"message":"The device isn't exist"}

The devices are visible and online in the device list, and the API itself is responsive. This suggests that the token I’m using does not have permission to write to local Zigbee devices.

However, my iHost interface does not show any “Developer” or “Open API” panel, and I couldn’t find a way to generate a token with write permissions. Also, the Docker Add-on Store does not list any official ewelink-open-api container.


Could you please clarify:

  1. How can I enable Developer Mode or generate a token with write access for local Zigbee devices?
  2. Is there an official way to install the Open API interface (if required) on the iHost?
  3. Is there any workaround to allow local control for use cases like Homebridge plugins?

I’ve used ChatGPT to help me doing all the commands and I’ve read the followings sites:

Thank you in advance.

Best regards,

Can you provide your complete request?
In curl will do.

Hi,

Sure, here is the full curl request I used:

curl -X PUT "http://192.168.1.4/open-api/v1/rest/devices/state" \
  -H "Authorization: Bearer MY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "serial_number": "003c84fffece38fe",
    "state": {
      "power.powerState": "on"
    }
  }'

The API responds with:

{"error":110000,"data":{},"message":"The device isn't exist"}

Let me know if you need any additional info.

Thanks!

I’ve tried this one as well:


curl -X PUT http://192.168.1.4/open-api/v1/rest/devices/state 
  -H "Authorization: Bearer MY_TOKEN" 
  -H "Content-Type: application/json" 
  -d '{
    "serial_number": "eff6e0f6-c8de-4821-b2b1-179e4544625e",
    "state": {
      "toggle.1.toggleState": "on"
    }
  }'

The URL is wrong.
The correct one should be:

curl -X PUT "http://10.10.10.214/open-api/v2/rest/devices/<DEVICE-SERIAL-NUMBER>" \
  -H "Authorization: Bearer <iHOST-TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "state": {
      "power": {
        "powerState": "off"
      }
    }
  }'

Please refer to here: eWeLink CUBE Open API V2 - eWeLink

Under the title h. Update Specified Device Information or State you’ll find further description and instruction about the api.