Ewelink icon

Ewelink

Consume Ewelink API

Overview

The Ewelink custom n8n node allows you to interact with the eWeLink API, specifically targeting device management and control.
For the Device resource and the Get Power State operation, this node retrieves the current power state (on/off) of a specified device by its Device ID.

Common scenarios:

  • Monitoring whether a smart plug, switch, or other eWeLink-compatible device is currently powered on or off.
  • Integrating device state checks into automation workflows (e.g., only proceed if a device is on).
  • Building dashboards or notifications based on real-time device status.

Practical example:
You could use this node in an automation that checks if your living room lamp (by Device ID) is on before sending a reminder to turn it off at night.

Properties

Name Type Meaning
Device ID String The unique identifier for the target device. Used to specify which device's power state should be retrieved.

Output

The output will be a JSON object containing the power state information of the specified device.
While the exact structure depends on the eWeLink API response, typical fields may include:

{
  "status": "ok",
  "state": "on", // or "off"
  "deviceid": "xxxxxx",
  // ...other device-specific details
}
  • state: Indicates the current power state ("on" or "off") of the device.
  • deviceid: The ID of the device queried.
  • Additional fields may be present depending on the device and API version.

Dependencies

  • External Service: Requires access to the eWeLink API.
  • Credentials: You must configure eWeLink account credentials (email and password) in n8n under the credential type ewelinkApi.
  • n8n Configuration: No special environment variables are required beyond standard credential setup.

Troubleshooting

Common issues:

  • Invalid Credentials: If the email or password is incorrect, authentication will fail.
  • Device Not Found: Providing an invalid or non-existent Device ID will result in errors from the API.
  • API Rate Limits: Excessive requests may be throttled by eWeLink.

Error messages:

  • "Authentication failed" or "Auth settings are not valid: Authentication failed - status 406": Check your eWeLink credentials.
  • Errors about missing or invalid deviceId: Ensure the Device ID is correct and the device is accessible via your eWeLink account.

How to resolve:

  • Double-check your credentials in n8n.
  • Verify the Device ID in your eWeLink app or dashboard.
  • Retry after some time if rate-limited.

Links and References

Discussion