sinricpro / non-sdk-issues

Report non sdk related issues here (Alexa, Google Home, SmartThings, IFTTT, API)
2 stars 0 forks source link

[Bug] Multiple Records of Energy Consumption being created for same device #67

Closed fpto closed 1 year ago

fpto commented 1 year ago

For some reason multiple records are created for the same device when turning it on:

See: https://scontent.fsap12-2.fna.fbcdn.net/v/t1.15752-9/370228843_1066435571403052_4880248789456643644_n.png?_nc_cat=109&ccb=1-7&_nc_sid=ae9488&_nc_ohc=44O0bdNM6w4AX81IYZC&_nc_ht=scontent.fsap12-2.fna&oh=03_AdSC55jlRIiJi9ycG-ca5qL3axmPH3M5VsS4Ki488Zx42Q&oe=6511E6E9

This messes up energy tracking, since it records twice the same device session.

kakopappa commented 1 year ago

Hi @fpto

tried to reproduce this, does not seem to happen. This is what i did,

  1. Create a new device, set and set the consumption details as below: image
  2. Turn on the switch and wait for a while
  3. Turn off the switch
  4. Check consumption

image

Can you please provide steps to reproduce this problem. May be I am missing something.

fpto commented 1 year ago

In that case My guess is that the issue happens if you click twice on "turn on" button, which sometimes happens. I would expect in that case to keep only the record for the latest "turn on" time stamp.

fpto commented 1 year ago

It keeps happening:

image
kakopappa commented 1 year ago

Hi @fpto

I tried the double turn-on scenario, still seeing only one in the grid,

image

image

The current logic in the server is when you double turn on, it will replace the old turn-on time with the new turn-on time.

Do you have the steps to reproduce this issue?

kakopappa commented 1 year ago

Ok found the root cause. it seems to be happening when you double turn off.

kakopappa commented 1 year ago

I have deployed the fix to the production server now. Going forward it should not write double entries. Will add a clear estimate button in the next release. Thanks!

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.