more G-Labs products

Author Topic: Statistics feature requests  (Read 2050 times)

February 29, 2016, 01:46:49 PM
Read 2050 times

kevin1

  • *****
  • Information
  • Hero Member
  • Posts: 330
Statistics feature requests:

-remember which options I prefer so I don't have to re-select them every time: compare all, temp, days, from 7 days ago, to today

-allow two parameters to be viewed on one chart (one would use left Y axis the other right Y axis), or small chart below a bigger chart

-implement 'delete value' - there seems to be partial implementation but it doesn't actually delete value from stats.  This would be nice to get my coding mistakes out of the statistics database (I have a temp=150 throwing off the chart range)


February 29, 2016, 05:08:01 PM
Reply #1

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Definitely would be nice to delete a value!  If a sensor throws a ridiculously wrong value, the range is broken.  I have one sensor that is currently sending -50F all the time so my temperature values are useless because of it.  I could purge the whole database, but I don't really want that either.  The only thing I can think of doing to fix it currently is installing a database editor and manually removing that single value.

February 29, 2016, 10:13:27 PM
Reply #2

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
When you sélect Days range it's possible to delete a selected value. I have add that in statistics a few months  ago.

February 29, 2016, 11:48:17 PM
Reply #3

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I know you can select a single value, but didn't realize you could then delete it.  Awesome!

March 01, 2016, 02:48:53 AM
Reply #4

kevin1

  • *****
  • Information
  • Hero Member
  • Posts: 330
When you sélect Days range it's possible to delete a selected value. I have add that in statistics a few months  ago.

Dani - I see the delete value popup by the date, but when i click it nothing happens.

March 01, 2016, 04:41:40 PM
Reply #5

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I just tried to use the delete value command.  I believe it did work before such that when you select the button, it would pop up a new window to confirm deletion.  It did not do that this time and the value did not get removed.  I refreshed the data and it was still there.

March 02, 2016, 08:39:28 AM
Reply #6

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi bkenobi,
Can you get a log of the delete API sent by HG UI. And then perform it in the browser, you get the SQL Delete Command in Response. To look if it's correct ?

Yes I don't refresh the stats screen after each delete.

March 02, 2016, 07:14:43 PM
Reply #7

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I can do that this evening.  Do you happen to know the correct syntax for the api command?  I assume I'd need to get the element ID by selecting the item I want to delete in the statistics view.

March 03, 2016, 04:32:48 AM
Reply #8

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
This is what the log shows when I select delete on the item in the web UI.
Code: [Select]
2016-03-02 19:28:51.7027 Info WebServiceGateway 192.168.0.5 HTTP GET 200 /api/HomeAutomation.HomeGenie/Statistics/Parameter.StatDelete/1454221391413.78/0 [OPEN]
2016-03-02 19:28:52.3009 Info WebServiceGateway 192.168.0.5 HTTP GET 200 /api/HomeAutomation.HomeGenie/Statistics/Parameter.StatDelete/1454221391413.78/0 [CLOSED AFTER 0.598 seconds]

Using the API command from the above debug:
Code: [Select]
[[Response,DELETE FROM ValuesHist WHERE (TimeStart BETWEEN '6578-03-30 22:39:01' AND '6578-03-30 22:39:01.999999')]]

March 03, 2016, 10:31:39 AM
Reply #9

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi bkenobi,

Why your date is 30 Mars in 6578 ?
That works on RPI. Your HG run under Linux or Windows ?
If I call my RPI with you API command :
Code: [Select]
192.168.1.xxx/api/HomeAutomation.HomeGenie/Statistics/Parameter.StatDelete/1454221391413.78/0I get that response :
Code: [Select]
[[Response,DELETE FROM ValuesHist WHERE (TimeStart BETWEEN '2016-01-31 05:23:11' AND '2016-01-31 05:23:11.999999')]]I suppose the date of you delete try is on 31 January 2016
In HG UI the statistics date are passed as a double value
« Last Edit: March 03, 2016, 10:39:07 AM by dani »

March 03, 2016, 04:21:37 PM
Reply #10

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I'm on RPi and the data for the OS *should* be correct since all the debug logs show the right time.  I didn't notice that the request was for a date in 4000+ years.  Obviously that would be an issue.  I simply copy/pasted what HG output so I can't explain why it responded that way.

March 03, 2016, 04:40:36 PM
Reply #11

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I also noticed that the date is completely wrong too.  The correct time/date for the point I want deleted is 1/31/16 6:33:23 AM.  I don't know what format the string in the StatDelete call is in, otherwise I'd try to verify what time it's actually asking for.  Your response is actually off by an hour from what I need as well.  I'm not sure what's going on, but this doesn't seem like it's working per design.