I have a energy sensor which is cumulative sensor ( total increasing )
- platform: mqtt
name: "device power"
state_topic: "/device/SENSOR"
value_template: "{{ value_json.ENERGY.Total }}"
unit_of_measurement: "kWh"
availability_topic: "/device/LWT"
qos: 1
payload_available: "Online"
payload_not_available: "Offline"
device_class: energy
state_class: total_increasing
I want a new entity which shows the past one month consumption reading i.e total energy consumed in past 30 days and it should be continous running reading
eg:
{{ device_power(current value) - device_power(30 days previous value) }}
How to achieve the function , i search the forum but i cannot find any solution.