jonneytest / sma-bluetooth

Automatically exported from code.google.com/p/sma-bluetooth
0 stars 0 forks source link

No outputs added to PVOutput.org #37

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When I run the smatool with -d it gives me at the end this info, maybe here is 
somewhere the issue why it is not getting updated to the website?

SELECT DATE_FORMAT(dd1.DateTime,'%Y%m%d'), DATE_FORMAT(dd1.DateTime,'%H:%i'), 
ROUND((dd1.ETotalToday-dd2.EtotalToday)*1000), dd1.CurrentPower, dd1.DateTime 
FROM DayData as dd1 join DayData as dd2 on 
dd2.DateTime=DATE_FORMAT(dd1.DateTime,'%Y%m%d0000000') WHERE 
dd1.DateTime>=Date_Sub(CURDATE(),INTERVAL 1 DAY) and dd1.PVOutput IS NULL and 
dd1.CurrentPower>0 ORDER BY dd1.DateTime ASC

Original issue reported on code.google.com by zweinste...@gmail.com on 1 Sep 2011 at 1:34

GoogleCodeExporter commented 8 years ago
Problem solved.
Somebody told me that the program does not send updates at night or when 
current is 0 or when you use the -d -v options. Is this correct? because 
yesterday afternoon I used that.
And therefor I had to try it this morning and now it works.

Original comment by zweinste...@gmail.com on 2 Sep 2011 at 11:00

GoogleCodeExporter commented 8 years ago
I believe the reason why it failed in the evening and succeeded in the morning 
is as follows: smatool selects data for uploading that are within the range 
defined by 
Date_Sub(CURDATE(),INTERVAL 14 DAY).
For me, the date and time is 20111221 16:44 
When I execute in mysql 'SELECT Date_Sub(CURDATE(),INTERVAL 14 DAY);' I get 
2011-12-07
With this specification, smatool attempts to send data to pvoutput starting 
with 2011-12-07 09:35, which is more than 14 days, so pvoutput refuses to 
accept the upload.

A solution would consist of using the expression 
Date_Sub(CURDATE(),INTERVAL 13 DAY).
This limits a bit the amount of historic data that is sent, but at least it 
work on all times of day

Original comment by vereecke...@gmail.com on 21 Dec 2011 at 3:50