Page 1 of 1

Request for changes in current condition block

Posted: Sun Oct 22, 2017 9:07 am
by Cyril
Hello,

Would it be possible to add a parameter for the format of the time (timestamp) of the last update. When updating from Weewx, it is always every 5 minutes, and zero seconds, so the display of the seconds is useless (I thing). Therefore I would like to show only HH:MM.

Still in this block, under the rain values (rain quantity and rain rate) could we have the time of the last change (time of quantity increase , sorry I don't know how to explain that, hope you understand).
Say at 9:00 I have 0 mm, at 9:05 I have 1 mm, then it would be nice if that time was displayed under the values. And until there is another millimeter of rain, it would remain at that time. That way we would have a better idea of the time when it was raining (at the moment, the only way to know it is to use the interactiveGraph/Precipitation).

Thanks & Regards

Re: Request for changes in current condition block

Posted: Sun Oct 22, 2017 10:05 am
by Jachym
Hi

seconds - yes I can add the option to only show minutes, I think it would be useful for more people

rain - this is complicated, it is technically possible, but the calculation of this means another query has to be performed to the database. Given some people use interval as short as 2-3s, I dont want an extra query because this block has to work as fast as possible.

If you want to see the last rain use the Rain block, it shows this.

P.S. Please use the word "suggestion" or "proposal" rather than request ;)

Re: Request for changes in current condition block

Posted: Mon Oct 23, 2017 12:09 pm
by Cyril
Hi,

I see you are already using a variable changeR to know if the value has changed, so maybe you could use that same condition to update a new variable with the timestamp?
When you set changeR = True, you could have something like: $("#currentLastRainValue").text(json['Timestamp']);
Wouldn't that work for the interval updates?

Re: Request for changes in current condition block

Posted: Mon Oct 23, 2017 5:55 pm
by Luc
The time stamp you are refering to is the time stamp of the last received rain value by the api.
A typical weather station would send rain data once per 30-300 seconds.
This will not mean the rain value is changed. Most of the time it is not.
To get the information you want a query on the data base is needed.
And as Jachym explained, he won't do that for performance reasons.

Re: Request for changes in current condition block

Posted: Mon Oct 23, 2017 6:22 pm
by Cyril
The changeR I am referring is set to True only when the value of the Rain changes. There is already a test on that, it does not require an extra query.