From df52f0eb3cda1ed8578ccc656b6b2778e1cdc3f1 Mon Sep 17 00:00:00 2001 From: SNoof85 Date: Wed, 27 Oct 2021 14:01:14 +0200 Subject: [PATCH] edimax update template sensor example (#19970) --- source/_integrations/edimax.markdown | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/source/_integrations/edimax.markdown b/source/_integrations/edimax.markdown index 8145f84139d..f99fde9bfe1 100644 --- a/source/_integrations/edimax.markdown +++ b/source/_integrations/edimax.markdown @@ -50,17 +50,15 @@ Starting with [version 2 of the firmware](https://www.edimax.com/edimax/download {% raw %} ```yaml - - platform: template - sensors: - edimax_current_power: - friendly_name: Edimax Current power consumption - unit_of_measurement: "W" - value_template: "{{ state_attr('switch.edimax_smart_plug', 'current_power_w') | replace('None', 0) }}" - - edimax_total_power: - friendly_name: Edimax Accumulated daily power consumption - unit_of_measurement: "kWh" - value_template: "{{ state_attr('switch.edimax_smart_plug', 'today_energy_kwh') | replace('None', 0) }}" +template: + - sensor: + - name: Edimax Current power consumption + unit_of_measurement: "W" + state: "{{ state_attr('switch.edimax_smart_plug', 'current_power_w') | default(0, true) }}" + + - name: Edimax Accumulated daily power consumption + unit_of_measurement: "kWh" + state: "{{ state_attr('switch.edimax_smart_plug', 'current_power_w') | default(0, true) }}" ``` {% endraw %}