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') }}"
unit_of_measurement: "CNY"
device_class: monetary
- name: electricity_balance_is_pay_entity
unique_id: electricity_balance_is_pay_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') }}"
unit_of_measurement: "CNY"
device_class: monetary
- name: electricity_need_pay
unique_id: electricity_need_pay
state: "{{ state_attr('sensor.electricity_95598', 'need_pay') }}"
unit_of_measurement: "CNY"
device_class: monetary
- name: thismonth_electricity_usage_entity
unique_id: thismonth_electricity_usage_entity
state: "{{ state_attr('sensor.electricity_95598', 'thismonth_electricity_usage') }}"
state_class: measurement
unit_of_measurement: "kWh"
- name: electricity_last_date_entity
unique_id: electricity_last_date_entity
state: "{{ state_attr('sensor.electricity_95598', 'last_date') }}"
|