vesync update template sensors examples (#20018)

This commit is contained in:
SNoof85 2021-10-28 08:58:18 +02:00 committed by GitHub
parent 21609245a9
commit 0566ada748
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,21 +110,17 @@ Adapted from the [TP-Link integration](https://www.home-assistant.io/integration
{% raw %}
```yaml
sensor:
- platform: template
sensors:
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"
template:
- sensor:
- name: "Vesync current comsumption"
state: "{{ state_attr('switch.vesync_switch', 'current_power_w') | float(default=0) }}"
unit_of_measurement: "W"
- name: "Vesync total consumption"
state: "{{ state_attr('switch.vesync_switch', 'today_energy_kwh') | float(default=0) }}"
unit_of_measurement: "kWh"
- name: "Vesync voltage"
state: "{{ state_attr('switch.vesync_switch', 'voltage') | float(default=0) }}"
unit_of_measurement: "V"
```
{% endraw %}