forked from stmrocket/ha-smartmetertexas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
smartmetertexas.yaml
97 lines (75 loc) · 3.53 KB
/
smartmetertexas.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
sensor:
- platform: mqtt
name: SMT Current Reading
state_topic: "smt/reading"
unit_of_measurement: "kWh"
- platform: template
sensors:
smt_electricity_cost_this_hour:
friendly_name: Electricity Cost This Hour
unit_of_measurement: '$'
value_template: "{{ (states('sensor.smt_energy_hourly') | float * states('input_number.smt_energy_cost') | float) | round (2) }}"
smt_electricity_cost_last_hour:
friendly_name: Electricity Cost Last Hour
unit_of_measurement: '$'
value_template: "{{ (state_attr('sensor.smt_energy_hourly','last_period') | float * states('input_number.smt_energy_cost') | float) | round (2) }}"
smt_electricity_cost_today:
friendly_name: Electricity Cost Today
unit_of_measurement: '$'
value_template: "{{ (states('sensor.smt_energy_daily') | float * states('input_number.smt_energy_cost') | float) | round (2) }}"
smt_electricity_cost_yesterday:
friendly_name: Electricity Cost Yesterday
unit_of_measurement: '$'
value_template: "{{ (state_attr('sensor.smt_energy_daily','last_period') | float * states('input_number.smt_energy_cost') | float) | round (2) }}"
smt_electricity_cost_this_week:
friendly_name: Electricity Cost This Week
unit_of_measurement: '$'
value_template: "{{ (states('sensor.smt_energy_weekly') | float * states('input_number.smt_energy_cost') | float) | round (2) }}"
smt_electricity_cost_last_week:
friendly_name: Electricity Cost Last Week
unit_of_measurement: '$'
value_template: "{{ (state_attr('sensor.smt_energy_weekly','last_period') | float * states('input_number.smt_energy_cost') | float) | round (2) }}"
smt_electricity_cost_this_month:
friendly_name: Electricity Cost This Month
unit_of_measurement: '$'
value_template: "{{ (states('sensor.smt_energy_monthly') | float * states('input_number.smt_energy_cost') | float) | round (2) }}"
smt_electricity_cost_last_month:
friendly_name: Electricity Cost Last Month
unit_of_measurement: '$'
value_template: "{{ (state_attr('sensor.smt_energy_monthly','last_period') | float * states('input_number.smt_energy_cost') | float) | round (2) }}"
smt_electricity_cost_this_year:
friendly_name: Electricity Cost This Year
unit_of_measurement: '$'
value_template: "{{ (states('sensor.smt_energy_yearly') | float * states('input_number.smt_energy_cost') | float) | round (2) }}"
smt_electricity_cost_last_year:
friendly_name: Electricity Cost Last Year
unit_of_measurement: '$'
value_template: "{{ (state_attr('sensor.smt_energy_yearly','last_period') | float * states('input_number.smt_energy_cost') | float) | round (2) }}"
smt_energy_last_hour:
friendly_name: Energy Last Hour
unit_of_measurement: 'kWh'
value_template: "{{ state_attr('sensor.smt_energy_hourly','last_period') }}"
utility_meter:
smt_energy_hourly:
source: sensor.smt_current_reading
cycle: hourly
smt_energy_daily:
source: sensor.smt_current_reading
cycle: daily
smt_energy_weekly:
source: sensor.smt_current_reading
cycle: weekly
smt_energy_monthly:
source: sensor.smt_current_reading
cycle: monthly
smt_energy_yearly:
source: sensor.smt_current_reading
cycle: yearly
input_number:
smt_energy_cost:
name: Electricity Cost
mode: box
min: 0
max: 2.50
step: .001
unit_of_measurement: "$/kWh"