Hello
I’m trying to follow energy consumption.
I’m from Belgium and I have a p1 device.
So in my yaml file to start with consumption by quarter :
utility_meter:
energy_quarter:
source: sensor.p1_meter_energy_import
unique_id: energy_quarter
cycle: quarter-hourly
Then I tried template sensor :
Those works good :
template:
- sensor:
- name: "energy_quarter_current"
unique_id: energy_quarter_current
unit_of_measurement: "kWh"
state: "{{ states('sensor.energy_quarter') | float(0) }}"
- name: "energy_quarter_before"
unit_of_measurement: "kWh"
state: "{{ state_attr('sensor.energy_quarter', 'last_period') | float(0) }}"
But what if I want to set energy_quarter_before_before (so 2 quarter before)?
Because I don’t have other attibutes like this.
Thanks for your help