Ewelink icon

Ewelink

Consume Ewelink API

Overview

The Ewelink node for n8n allows you to interact with eWeLink-compatible smart devices via the eWeLink API.
Specifically, when using the Device resource and the Get Power Usage operation, this node retrieves the current power usage data for a specified device.

Common scenarios:

  • Monitoring real-time energy consumption of smart plugs or switches.
  • Integrating device power usage data into dashboards or reports.
  • Triggering automations based on power usage thresholds (e.g., alert if a device exceeds a certain wattage).

Example use case:
You want to log the power usage of your smart plug every hour to Google Sheets for later analysis.


Properties

Name Type Meaning
Device ID String The unique identifier of the device whose power usage you want to retrieve.

Output

The output is a JSON object containing the power usage information for the specified device.
The exact structure depends on the response from the eWeLink API, but typically includes fields such as:

{
  "status": "ok",
  "data": {
    "power": 12.34,
    "current": 0.056,
    "voltage": 220.1,
    // ...other possible fields
  }
}
  • status: Indicates if the request was successful.
  • data.power: Current power usage in watts.
  • data.current: Current in amperes.
  • data.voltage: Voltage in volts.

Note: The actual field names and presence may vary depending on the device model 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 "ewelinkApi" credential type.

Troubleshooting

Common issues:

  • Authentication failed:

    • Error message: Auth settings are not valid: Authentication failed - status 406
    • Solution: Double-check your eWeLink email and password in the credentials configuration.
  • Invalid Device ID:

    • If the provided Device ID does not exist or is not accessible, the node will return an error.
    • Solution: Ensure the Device ID is correct and that your account has access to it.
  • API Rate Limits or Connectivity Issues:

    • If the eWeLink API is unreachable or rate-limited, requests may fail.
    • Solution: Retry after some time or check your network connection.

Links and References

Discussion