- 积分
- 171
- 金钱
- 153
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
注册会员
- 积分
- 171
- 金钱
- 153
- HASS币
- 0
|
发表于 2022-12-11 11:58:04
|
显示全部楼层
配置文件用下边这些
template:
- trigger:
- platform: event
event_type: "state_changed"
event_data:
entity_id: sensor.electricity_95598
sensor:
- name: electricity_charge_balance_entity
unique_id: electricity_charge_balance_entity
state: "{{ states('sensor.electricity_95598') }}"
state_class: measurement
unit_of_measurement: "CNY"
- name: electricity_balance_is_pay_entity
unique_id: electricity_charge_balance_entity
state: "{{ state_attr('sensor.electricity_95598', 'is_pay') }}"
- name: last_electricity_usage_entity
unique_id: last_electricity_usage_entity
state: "{{ state_attr('sensor.electricity_95598', 'last_electricity_usage') }}"
state_class: measurement
unit_of_measurement: "KWH"
- name: yearly_electricity_usage_entity
unique_id: yearly_electricity_usage_entity
state: "{{ state_attr('sensor.electricity_95598', 'yearly_electricity_usage') }}"
state_class: measurement
unit_of_measurement: "KWH"
- name: yearly_electricity_charge_entity
unique_id: yearly_electricity_charge_entity
state: "{{ state_attr('sensor.electricity_95598', 'yearly_electricity_charge') }}"
state_class: measurement
unit_of_measurement: "CNY"
|
|