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

Graph has odd Y-axis values and sensor data showing fixed 1. #958

Open earlthesquirrel opened 1 week ago

earlthesquirrel commented 1 week ago

Please don't delete these questions! They are asked almost with every issue - answering them as below saves us time from asking them!

First step Try to debug the skin yourself. If you can't figure it out, please include the debug information (text, screenshots, etc.). See this guide on debugging the skin. https://github.com/poblabs/weewx-belchertown#how-to-use-debug

I have a graph for O3 data. The data coming in (as verified from the Particle API) has values like 0.554274, 0.563021, 0.528518 ppm (at least that's what I was told the units were)

I am trying to properly graph the information. I tried to specify yAxis_softMin = 0.10000, yAxis_softMax = 1.50000, yAxis_tickInterval = 0.01000.

Describe the bug A clear and concise description of what the bug is.

The graphs produces some weird values on the Axis, and the O3 reading shows always as 1 I've confirmed that the data in the DB has the correct values. (I've been playing with the numbers, so the Axis values have been moving around)

Link to your website (IMPORTANT) https://www.baugh.org/weewx/belchertown/graphs/?graph=airQuality

That page has the O3 graph.

Version of the skin you're using

Using version 1.3

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

I expect some better scaling :-) and proper values showing up.

Screenshots If applicable, add screenshots to help explain your problem.

Device Information (please complete the following information):

Additional context Add any other context about the problem here. Maybe a potential fix?

HELP WANTED If you have a fix for this, please submit a pull request against the development branch!

roe-dl commented 1 week ago

You can set up the number of decimals in graphs.conf:

            [[[[numberFormat]]]]
                decimals = 5

May be, you will have to add a line to belchertown.py:

        all_obs_rounding_json['yourObsType'] = 5

Insert it before the line # social share.

earlthesquirrel commented 5 days ago

Where should I be adding the

           [[[[numberFormat]]]]
                decimals = 5

at?

earlthesquirrel commented 5 days ago

Also, I don't see a line starting with

# social share

in my belchertown.py file. Do you have a line number?

roe-dl commented 4 days ago

graphs.conf

The number format can be set in graphs.conf for every line in a graph. So you could set up a graph like this:

...
    [[YourPlot]]
        ...
        [[[YourObservationType]]]
            ...
            [[[[numberFormat]]]]
               decimals = 5

You did not provide the observation type name of your O3 reading. So I can describe it in general only. Replace [[[YourObservationType]]] with the name of your O3 reading, and [[YourPlot]] with the name of the plot.

belchertown.py

The line # social share is at line number 1953 in the actual version of the skin. So put the new line in line 1951. Please note py not js.tmpl.

line 1951 of belchertown.py