poblabs / weewx-belchertown

A clean and modern weewx skin with real time streaming updates, forecast data and interactive charts. View it in action at BelchertownWeather.com
https://belchertownweather.com
GNU General Public License v3.0
211 stars 112 forks source link

Feature request: Ability to choose either visibility or cloud base/height #24

Closed 41south closed 5 years ago

41south commented 6 years ago

Hopefully just a simple skin.conf setting, the ability to choose one or the other of visibility (from Darksky?) or cloud base as transmitted or derived by most weather stations. Possibly add a calculation to derive it from temp and dewpoint if it isn't already in the users data?

Cheers Colin

poblabs commented 5 years ago

Looks like weewx can calculate cloud base within weewx core as long as you extend the database. So this is an option, but not one out of the box - which may be confusing for average users on how to enable this feature.

I'm not sure if I can tap into the weewx calculations within the bin/user/belchertown.py file since I don't think I can get loop data during report time.

Which leaves me the option to calculate it within the skin itself which might not be ideal because of the unit conversions (foot and meter).

I need to think about the best way to do it

poblabs commented 5 years ago

I suppose I could just add an option to enable cloudbase instead of visibility and have it included much like appTemp?

poblabs commented 5 years ago

I think I will go that route.

Treat it like a user-controller option after extending the database. I even wrote a Belchertown skin wiki on how to do the database extensions since it seems more people are interested in the additional observations (appTemp specifically).

I'll do some testing and will push a commit you can test with. It will require a skin.conf upgrade.

poblabs commented 5 years ago

Take a look at https://github.com/poblabs/weewx-belchertown/commit/41b1fa7a297b44bd77ceb5af01420c8fb20453fb.

Extend your database for cloudbase using the wiki link in the last reply.

Download the new styles.css, index.html.tmpl and skin.conf. Then add new skin option show_cloudbase = 1 to your skin options and restart weewx.

It should look something like this. I've kept visibility in there too since they are two different observations.

Adding cloudbase has pushed everything down a bit in that top area, so I had to re-design a little bit of the top area. Should look normal for non-cloudbase enabled sites as well as cloudbase enabled. Hopefully not too much whitespace.

image

41south commented 5 years ago

Thanks Pat that looks perfect, I'll update later today and let you know how it goes. I'm already displaying the tag in a custom page so I don't foresee any issues.

Nice job on the Wiki for the db extensions too 👍

41south commented 5 years ago

Looks like we have the old metric/imperial clash again. My extra section shows the correct height where as the new section you've added looks to be the metric equivalent with 'feet' after it. In the attached the 2900 feet is correct screen shot 2018-12-31 at 4 04 55 pm screen shot 2018-12-31 at 4 05 21 pm

poblabs commented 5 years ago

What is your mqtt extension sending units set as?

On Sun, Dec 30, 2018, 10:08 PM Colin notifications@github.com wrote:

Looks like we have to old metric/imperial clash again. My extra section shows the correct height where as the new section you've added looks to be the metric equivalent with 'feet' after it. In the attached the 2900 feet is correct [image: screen shot 2018-12-31 at 4 04 55 pm] https://user-images.githubusercontent.com/1725001/50553938-4899ee80-0d16-11e9-8855-504172f5eb24.png [image: screen shot 2018-12-31 at 4 05 21 pm] https://user-images.githubusercontent.com/1725001/50553939-4899ee80-0d16-11e9-9152-6e2e4f06f821.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/poblabs/weewx-belchertown/issues/24#issuecomment-450603877, or mute the thread https://github.com/notifications/unsubscribe-auth/ADUsZ0qERWMz3IoOgNeDrc7xAZ2D-rBcks5u-X-wgaJpZM4YxCPR .

41south commented 5 years ago

[[MQTT]]

This section is for the MQTT service setup

    server_url = mqtt://192.168.20.121:1883/
    topic = weather/41south
    unit_system = METRIC
    binding = loop
    aggregation = aggregate
    log_success = False
    log_failure = True
    [[[inputs]]]
        [[[[dayRain]]]]
            name = dayRain_mm
            units = mm
        [[[[rainRate]]]]
            name = rainRate_mm_per_hour
            units = mm_per_hour
41south commented 5 years ago

I think we must follow a lot of aviation rules here where visibility is metres/km, cloud height is feet, rain is mm etc. It's not a black and white imperial or metric thing - unfortunately :)

poblabs commented 5 years ago

I think you can override it similarly to how you've done the others. Observation is "cloudbase" then define your unit and restart weewx.

On Sun, Dec 30, 2018, 10:24 PM Colin notifications@github.com wrote:

I think we must follow a lot of aviation rules here where visibility is metres/km, cloud height is feet, rain is mm etc. It's not a black and white imperial or metric thing - unfortunately :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/poblabs/weewx-belchertown/issues/24#issuecomment-450604514, or mute the thread https://github.com/notifications/unsubscribe-auth/ADUsZ3h25Ax_dSMTwrHYSVC0lcqmcEdVks5u-YNugaJpZM4YxCPR .

41south commented 5 years ago

So ... [[[[cloudbase]]]] name = cloudbase_feet units = feet

I noticed that the correct value is there after a screen refresh before the MQTT data kicks in

41south commented 5 years ago

Close :)

[[[[cloudbase]]]] name = cloudbase_foot units = foot

Fixed - thanks.

Can be closed I think.

poblabs commented 5 years ago

Great!