From 25ccba4c57837fb322a605178d0ebb78ae024c81 Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Tue, 3 Aug 2021 10:37:19 +0200 Subject: [PATCH] Move power and energy attributes to sensors (#18644) --- source/_integrations/tplink.markdown | 49 +++------------------------- 1 file changed, 5 insertions(+), 44 deletions(-) diff --git a/source/_integrations/tplink.markdown b/source/_integrations/tplink.markdown index 5dfb8ed248a..cc24ef88d1e 100644 --- a/source/_integrations/tplink.markdown +++ b/source/_integrations/tplink.markdown @@ -5,6 +5,7 @@ ha_category: - Hub - Switch - Light + - Sensor ha_release: 0.89 ha_iot_class: Local Polling ha_config_flow: true @@ -24,6 +25,7 @@ There is currently support for the following device types within Home Assistant: - **Light** - **Switch** +- **Sensor** In order to activate the support, you will have to enable the integration inside the configuration panel. The supported devices in your network are automatically discovered, but if you want to control devices residing in other networks you will need to configure them manually as shown below. @@ -40,14 +42,14 @@ Plugs are type `switch` when autodiscovery has been disabled. - HS100 - HS103 - HS105 -- HS110 (This device is capable of reporting energy usage data to template sensors) +- HS110 (confirmed to support consumption sensors) - KP105 -- KP115 +- KP115 (confirmed to support consumption sensors) ### Strip (Multi-Plug) - HS107 (indoor 2-outlet) -- HS300 (powerstrip 6-outlet) (This device is capable of reporting energy usage data to template sensors) +- HS300 (powerstrip 6-outlet) (confirmed to support consumption sensors) - KP303 (powerstrip 3-outlet) - KP400 (outdoor 2-outlet) - KP200 (indoor 2-outlet) @@ -143,44 +145,3 @@ tplink: - host: 192.168.200.7 - host: 192.168.200.8 ``` - -## Extracting Energy Sensor data - -Devices that are confirmed to support Consumption Reading; -1. HS110 -2. HS300 -3. KP115 -4. Bulbs (device-specific, only current power consumption is commonly available) - -In order to get the power consumption readings from a TP-Link HS110 device, you'll have to create a [template sensor](/integrations/template/). -In the example below, change all of the `my_tp_switch`'s to match your device's entity ID (without the domain). For example, if your entity is `switch.whale_heater` then replace `my_tp_switch` with `whale_heater`: - -{% raw %} - -```yaml -sensor: - - platform: template - sensors: - my_tp_switch_amps: - friendly_name_template: "{{ state_attr('switch.my_tp_switch','friendly_name') }} Current" - value_template: "{{ state_attr('switch.my_tp_switch','current_a') }}" - unit_of_measurement: "A" - my_tp_switch_watts: - friendly_name_template: "{{ state_attr('switch.my_tp_switch','friendly_name') }} Power" - value_template: "{{ state_attr('switch.my_tp_switch','current_power_w') }}" - unit_of_measurement: "W" - my_tp_switch_total_kwh: - friendly_name_template: "{{ state_attr('switch.my_tp_switch','friendly_name') }} Total Consumption" - value_template: "{{ state_attr('switch.my_tp_switch','total_energy_kwh') }}" - unit_of_measurement: "kWh" - my_tp_switch_volts: - friendly_name_template: "{{ state_attr('switch.my_tp_switch','friendly_name') }} Voltage" - value_template: "{{ state_attr('switch.my_tp_switch','voltage') }}" - unit_of_measurement: "V" - my_tp_switch_today_kwh: - friendly_name_template: "{{ state_attr('switch.my_tp_switch','friendly_name') }} Today's Consumption" - value_template: "{{ state_attr('switch.my_tp_switch','today_energy_kwh') }}" - unit_of_measurement: "kWh" -``` - -{% endraw %}