-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathconfiguration.yaml
56 lines (52 loc) · 2.01 KB
/
configuration.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
template:
- trigger:
- platform: event
event_type: "state_changed"
event_data:
entity_id: sensor.electricity_charge_balance_户号
sensor:
- name: electricity_charge_balance_entity_户号
unique_id: electricity_charge_balance_entity_户号
state: "{{ states('sensor.electricity_charge_balance_户号') }}"
state_class: measurement
unit_of_measurement: "CNY"
device_class: monetary
- trigger:
- platform: event
event_type: "state_changed"
event_data:
entity_id: sensor.last_electricity_usage_户号
sensor:
- name: 最近一天用电量
unique_id: last_electricity_usage_entity_户号
state: "{{ states('sensor.last_electricity_usage_户号') }}"
attributes:
present_date: "{{ state_attr('sensor.last_electricity_usage_户号', 'present_date') }}"
last_updated: "{{ state_attr('sensor.last_electricity_usage_户号', 'last_updated') }}"
state_class: total # total_increasing
unit_of_measurement: "kWh" # string (optional, default: None)
device_class: energy
- trigger:
- platform: event
event_type: "state_changed"
event_data:
entity_id: sensor.yearly_electricity_usage
sensor:
- name: yearly_electricity_usage_entity_户号
unique_id: yearly_electricity_usage_entity_户号
state: "{{ states('sensor.yearly_electricity_usage_户号') }}"
state_class: total_increasing
unit_of_measurement: "kWh"
device_class: energy
- trigger:
- platform: event
event_type: "state_changed"
event_data:
entity_id: sensor.yearly_electricity_charge_户号
sensor:
- name: yearly_electricity_charge_entity_户号
unique_id: yearly_electricity_charge_entity_户号
state: "{{ states('sensor.yearly_electricity_charge_户号') }}"
state_class: total_increasing
unit_of_measurement: "CNY"
device_class: monetary