mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-28 03:37:06 +00:00
Update imap_email_content template sensor examples (#20054)
This commit is contained in:
parent
91460bf92c
commit
6a4497cfb2
@ -121,25 +121,21 @@ Below is the template sensor which extracts the information from the body of the
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sensor:
|
template:
|
||||||
- platform: template
|
- sensor:
|
||||||
sensors:
|
- name: "Previous Day Energy Use"
|
||||||
previous_day_energy_use:
|
unit_of_measurement: "kWh"
|
||||||
friendly_name: Previous Day Energy Use
|
state: >
|
||||||
unit_of_measurement: kWh
|
|
||||||
value_template: >
|
|
||||||
{{ state_attr('sensor.energy_email','body')
|
{{ state_attr('sensor.energy_email','body')
|
||||||
| regex_findall_index("\*Yesterday's Energy Use:\* ([0-9]+) kWh") }}
|
| regex_findall_index("\*Yesterday's Energy Use:\* ([0-9]+) kWh") }}
|
||||||
previous_day_cost:
|
- name: "Previous Day Cost"
|
||||||
friendly_name: Previous Day Cost
|
unit_of_measurement: "$"
|
||||||
unit_of_measurement: $
|
state: >
|
||||||
value_template: >
|
|
||||||
{{ state_attr('sensor.energy_email', 'body')
|
{{ state_attr('sensor.energy_email', 'body')
|
||||||
| regex_findall_index("\*Yesterday's estimated energy cost:\* \$([0-9.]+)") }}
|
| regex_findall_index("\*Yesterday's estimated energy cost:\* \$([0-9.]+)") }}
|
||||||
billing_cycle_total:
|
- name: "Billing Cycle Total"
|
||||||
friendly_name: Billing Cycle Total
|
unit_of_measurement: "$"
|
||||||
unit_of_measurement: $
|
state: >
|
||||||
value_template: >
|
|
||||||
{{ state_attr('sensor.energy_email', 'body')
|
{{ state_attr('sensor.energy_email', 'body')
|
||||||
| regex_findall_index("\ days:\* \$([0-9.]+)") }}
|
| regex_findall_index("\ days:\* \$([0-9.]+)") }}
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user