Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - Allow flexibility to change daily records on the main page #65

Closed
biltmorelaker opened this issue Feb 20, 2019 · 7 comments
Labels
enhancement New feature or request help wanted Extra attention is needed wontfix This will not be worked on

Comments

@biltmorelaker
Copy link
Contributor

Allow changing of the daily records on the first page for more info and to address people that don’t have solar or UV sensors to allow something like:

Temp Range 60-75 °F Humidity Range 70.3-82.1 %
Highest Wind 8 mph Barometer Range 29.1-30.3 inHg
Today's Rain 2.5 in Highest Rate 0.30 in/hr

Allowing user choice of what is displayed by specifying variables would be best.

@poblabs
Copy link
Owner

poblabs commented Mar 29, 2019

The issue with this table is that it's part of the background updates. So specifying ranges like you have above would be a little challenge to have it updated on every ajax update.

If the option was to NOT do ranges, then it makes the request slightly easier.

Or the easiest and most customizable way would be to remove the background updates on these fields, which then would allow full customization on this area of the page by way of an .inc file.

@biltmorelaker
Copy link
Contributor Author

My request is driven by a desire to address the fact that I don't have a UV or Solar sensor on my Vantage Vue. So, I want to remove the UV reading which is N/A for me. Starting from that, it seemed the space could be used to provide more info. I saw that you had High and Low values for temp and thought they could be dumped into variables and displayed more effectively by showing ranges in a single cell. Same story for the barometric values.

If that's not true, how would the .inc file be handled? I do believe that making the space more effective (both for today and the month would enhance the value of the display even further).

@poblabs
Copy link
Owner

poblabs commented Mar 29, 2019

I agree the space can be better utilized.

It is true that a range could be shown using the built-in weewx $tags, but only if those cells did not update when the rest of the page updates. To provide customization with updates it'll require opening the hood more than the average user would want to do and edit belchertown.py heavily. That's not ideal. There's no skin.conf-type option that I can think of that would allow those values for the AJAX updates (range or not).

So using an .inc file would allow for adding the information you want - but you sacrifice the AJAX updates.

@biltmorelaker
Copy link
Contributor Author

Ah rats!. I think the AJAX updates are important. The value of the front page is that it is constantly updated. So, until I learn enough Python (if ever) to make the required changes in belchertown.py, I'd rather just be able to swap out UV.

What if we reduce the font size (so as not to have it extend below the earthquake block) and add another line of data? Allow something like:

Temp Lo 35 deg Temp High 48.3 deg
Highest Wind 8 mph Highest Gust 12 mph
Today's Rain 2.5 in Highest Rate 0.30 in/hr
Humidity Lo 40% Humidity High 57%

Is that possible?

poblabs added a commit that referenced this issue May 28, 2019
Updates #104 for some new keys

Updates #65 - still not sure how to make this space dynamic but at least this commit removes UV which not everyone has.
@poblabs
Copy link
Owner

poblabs commented May 28, 2019

The lastest commit makes some small changes while I try to wrap my head around this one. I guess we all missed that the monthly snapshot stats weren't AJAX, so they are now, at the very minimum.

Having this section become dynamic is more of a challenge than MQTT since for this section we rely on the weewx_data.json file.

Thinking ahead:

Perhaps if we define an ID to each of the boxes, then we can do an array and use that array to define the observation name and the aggregate period.

For example if the box layout and IDs were:

Box 1 Label: Box 1 Value Box 2 Label: Box 2 Value
Box 3 Label: Box 3 Value Box 4 Label: Box 4 Value
Box 5 Label: Box 5 Value Box 6 Label: Box 6 Value

Then the skin.conf config might be something like:

snapshot_box1 = "This is the label", "month-outTemp-max"
snapshot_box2 = "Label for box 2", "day-rain-sum"

Where the first grouping is the label, and the second grouping are the database values to update with AJAX. From the box1 example: month is the timespan, outTemp matches the weewx archive schema name, and max is the aggregate type.

If we stick to something like this, then the <span> class name can be month-outTemp-max and we could pass that same ID to JavaScript which can split on the - to create an array. We would use that array to find the data within weewx_data.json and update the element.

Something like this (untested);

jQuery('.stn-quick-stats').find('span').each(function () {
    // Find the element class name for the observation data
    thisElementClass = jQuery(this).attr("class");
    
    obsLookup = thisElementClass.split("-");
    var timespan = obsLookup[0];
    var observation = obsLookup[1];
    var aggregate = obsLookup[2];
    
    jQuery('.' + thisElementClass).html( data[timespan][observation][aggregate] );

});

This is of course dependent on that element being in the weewx_data.json since I'm sure not everything is in there right now (like custom air quality or lightning data for example).

EDIT: To allow for user controlled number of boxes, we can do this skin.conf config:
snapshot_bar = "Label for Box 1: month-outTemp-max", "Label for Box2: month-outTemp-min", "Label for Box3: day-outTemp-min". Then within the .tmpl file, to create the boxes we can do this example of placing a td within the table:

                            #if $Extras.has_key('snapshot_bar')
                            #for $box in $Extras.snapshot_bar
                            #set $section = $box.split(":")
                            #set $label = $section[0]
                            #set $className = $section[1].strip()
                            <td><b>$label:</b></td>    <td><span class="$className"></span></td><!-- AJAX -->
                            #end for
                            #end if

Thoughts

  1. Is the thought that this custom box area would be section 1 of the snapshot bar? Section 2 would become a custom .inc file, and section 3 would become the earthquake data?

@poblabs
Copy link
Owner

poblabs commented May 28, 2019

Update, I have a working prototype for the records snapshot bar.

Take this skin.conf example:

snapshot_bar = "Label for Box 1: month-outTemp-max", "Label for Box2: month-outTemp-min", "Label for Box3: day-outTemp-min", "Box 4 is UV: day-UV-max", "Box 5 is humidity: day-humidity-max"

Outputs, and updates in real time:

image

Note, the number of groups you add will determine how many rows will be displayed.

I think this changes the usefulness of the snapshots bar. It becomes more of a "Quick Station History" section, a customized User section (for air quality, lightning, etc.) and then earthquake stays the same.

As a result the titles will be removed since the content is very dynamic.

image

poblabs added a commit that referenced this issue May 31, 2019
Updates #104 for some new keys

Updates #65 - still not sure how to make this space dynamic but at least this commit removes UV which not everyone has.
@poblabs poblabs added enhancement New feature or request help wanted Extra attention is needed labels Sep 9, 2020
@stale
Copy link

stale bot commented Nov 8, 2020

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.

@stale stale bot added the wontfix This will not be worked on label Nov 8, 2020
@stale stale bot closed this as completed Nov 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants