Xiaomi Aqara Wall Switch D1 Energy Monitor


I’m using Aqara D1 double switch and I can see the current consumption in W and period in kWh

using this guide to integrate it in Home Assistant

i get the following read

notice the consumption is stacking and not resetting at all
also when going to Energy tab it’s not showing

i wrote the following code to count the current W and convert it to kWh but it’s not accurate

  - platform: integration
    source: sensor.switch_guest_power
    name: guest_power
    unit_prefix: k
    round: 2

is there a similar way to use the consumption sensor instead of the power sensor in the Energy tab