From c8ba8434185feea9d787dab933775249a8282107 Mon Sep 17 00:00:00 2001 From: Joe Trabulsy Date: Wed, 24 Jul 2019 18:01:45 -0400 Subject: [PATCH] Update VeSync Integration page (#9779) * Update VeSync integration page * Fix incorrect redirect * Remove linkable titles * Remove additional platform * Add service * Remove Time Zone * Remove active_time attribute * :pencil2: Tweak --- .vscode/cSpell.json | 1 + source/_components/vesync.markdown | 82 +++++++++++++++++++++++++----- 2 files changed, 70 insertions(+), 13 deletions(-) diff --git a/.vscode/cSpell.json b/.vscode/cSpell.json index 42c5d088e2f..1951a92694f 100644 --- a/.vscode/cSpell.json +++ b/.vscode/cSpell.json @@ -12,6 +12,7 @@ "Denon", "endconfiguration", "endraw", + "Etekcity", "fitbit", "Flexit", "geizhals", diff --git a/source/_components/vesync.markdown b/source/_components/vesync.markdown index fa7e38cf0b8..7d7a8d93016 100644 --- a/source/_components/vesync.markdown +++ b/source/_components/vesync.markdown @@ -1,5 +1,5 @@ --- -title: "VeSync Switch" +title: "VeSync Integration" description: "Instructions on how to set up Etekcity VeSync switches and outlets within Home Assistant." logo: vesync.png ha_category: @@ -9,20 +9,37 @@ redirect_from: - /components/switch.vesync/ --- -The `vesync` switch platform enables integration with Etekcity VeSync smart wall switches and outlets. +The `vesync` integration enables you to control Etekcity smart switches and outlets connected to the VeSync App. -VeSync outlets are low-cost wifi smart plugs that offer energy monitoring and work with popular voice assistants. +The devices must be added to the VeSync App before this integration can discover them. -Supports both the 7A round outlets and 15A rectangular outlets, as well as the in wall switches. +The following platforms are supported: + +- **switch** + +## Supported Devices + +This integration supports devices controllable by the VeSync App. The following devices are supported by this integration: + +### Plugs + +- Etekcity 7 Amp US outlet - ESW01-USA (Round) +- Etekcity 10 Amp US outlet - ESW10-USA (Round) +- Etekcity 10 Amp EU outlet - ESW10-EU (Round) +- Etekcity 15 Amp US outlet - ESW15-USA (Rectangular) +- Etekcity 2 Plug Outdoor Outlet - ESO15-TB + +### Switches + +- Etekcity In Wall Smart Switch (EWSL01-USA) ## Configuration -To use your VeSync switches, you must first register your switches with the VeSync app. Once registration is complete you must add the following to your `configuration.yaml` file: +To use this integration, all devices must be registered with the VeSync App. Once registration is complete, you can add the VeSync integration by adding the VeSync integration in the configuration section of the frontend and entering your username and password. You can also use the traditional configuration method by adding the following to your `configuration.yaml` file: ```yaml # Example configuration.yaml entry -switch: - - platform: vesync +vesync: username: YOUR_USERNAME password: YOUR_PASSWORD ``` @@ -38,11 +55,50 @@ password: type: string {% endconfiguration %} -## Exposed Attributes +## Services -VeSync switches will expose the following details for only the smart outlets. Energy monitoring not available for in-wall switches. +| Service | Description | +|---------|-------------| +| `update_devices` | Poll Vesync server to find and add any new devices | -| Attribute | Description | Example | -| ------------------- | ------------------------------------------------------------------- | --------------- | -| `current_power_w` | The present power consumption of the switch in watts. | 100 | -| `today_energy_kwh` | The kilowatt hours used by the switch during the previous 24 hours. | 0.12 | +## Outlet Exposed Attributes + +VeSync outlets will expose the following details for only the smart outlets. Energy monitoring not available for in-wall switches. + +| Attribute | Description | Example | +| ----------------------- | ----------------------------------------------------------------------- | --------------- | +| `current_power_w` | The present power consumption of the switch in watts. | 100 | +| `today_energy_kwh` | The kilowatt hours used by the switch during the previous 24 hours. | 0.12 | +| `voltage` | Current voltage of the device | 120.32 | +| `weekly_energy_total` | Total energy usage for week starting from Monday 12:01AM in kWh | 14.74 | +| `monthly_energy_total` | Total energy usage for month starting from 12:01AM on the first in kWh | 52.30 | +| `yearly_energy_total` | Total energy usage for year start from 12:01AM on Jan 1 in kWh | 105.25 | + +## Extracting Attribute data + +In order to get the attributes readings from supported devices, such as energy from outlets or fan attributes, you'll have to create a [template sensor](/components/switch.template/). + +In the example below, change all of the `vesync_switch`'s to match your device's entity ID. + +Adapted from the [TP-Link integration](https://www.home-assistant.io/components/tplink/#plugs). + +{% raw %} + +```yaml +sensor: + - platform: template + vesync_switch_watts: + friendly_name_template: "{{ states.switch.vesync_switch.name}} Current Consumption" + value_template: '{{ states.switch.vesync_switch.attributes["current_power_w"] | float }}' + unit_of_measurement: 'W' + vesync_switch_total_kwh: + friendly_name_template: "{{ states.switch.vesync_switch.name}} Total Consumption" + value_template: '{{ states.switch.vesync_switch.attributes["today_energy_kwh"] | float }}' + unit_of_measurement: 'kWh' + vesync_switch_volts: + friendly_name_template: "{{ states.switch.vesync_switch.name}} Voltage" + value_template: '{{ states.switch.vesync_switch.attributes["voltage"] | float }}' + unit_of_measurement: 'V' +``` + +{% endraw %}