On 05/09/2020, Mikael Fredriksson <pliggen...@gmail.com> wrote:
> Hi Glenn!
>
> Can't get the conversion for database units to change.
> This is how my skin.conf fill looks now (part under phpunits)
>
> # Uncomment as appropriate...
>          Only for the one/s you need.
>         # Only from the group/s you need.
>         # If you don't need a conversion performed then do nothing, leave
> them
>         # all commented out.
>
> #        temperature_convert = CtoF #degree C in database to degree F in
> report
>          temperature_convert = FtoC # degree F in database to degree C in
> report
>
> #        group_direction   = degree_compass
> #        group_percent     = percent
> #        group_pressure    = hPa        # Option inHg, mmHg , mbar or hPa
>         group_rain        = mm         # Option are inch , cm or mm
>         group_temperature = degree_C   # Option are degree_F or degree_C
>         group_speed       = km_per_hour # Option are mile_per_hour
> km_per_hour
>                                         # or meter_per_second
>
> But still I get the values in F in the observation page.
>
> Do you know what I could have missed?

You've missed nothing, and I was surprised to be able to duplicate it here.

Turns out there is nothing wrong with the code, but a change that was
brought in with weewx 3.9 (02/05/2019) has finally caught up with
wxobs and the way I specified the labels. The Defaults section was
moved to [StdReport] so entries made there will apply to *all* skins
and they have precedence over anything in skin.conf

http://weewx.com/docs/customizing.htm#How_options_work

The fix is... The section within wxobs/skin.conf [Units] [[Groups]]
that refers to the Group units (which wxobs uses to generate the
labels) needs to be moved into the [[wxobs]] section within weewx.conf

Using your case above, the entries in wxobs/skin.conf...

     group_rain        = mm         # Option are inch , cm or mm
     group_temperature = degree_C   # Option are degree_F or degree_C
     group_speed       = km_per_hour # Option are mile_per_hour

are moved to weewx.conf so that it will appear something like (your
path may be different)...
[StdReport]
    [...]
    [[wxobs]]
        skin = wxobs
        HTML_ROOT = /var/www/html/weewx/wxobs
        [[[Units]]]
            [[[[Groups]]]]
                group_rain        = mm         # Option are inch , cm or mm
                group_temperature = degree_C   # Option are degree_F or degree_C
                group_speed       = km_per_hour # Option are mile_per_hour

Because these changes will now be read from weewx.conf, you will need
to restart weewx for them to take affect.

n.b. The [[PHPUnits]] section remains in wxobs/skin.conf. It does not
get moved. It is specific to wxobs.inc and weewx would probably spit
out an error if it had to parse it.

This all assumes that your database is in US units (thus why you are
converting from F to C)
and that your weewx.conf file has the section Std Reports with entries like...
[StdReport]  [[Defaults]]   [[[Units]]]   [[[[Groups]]]]

Try it and let me know if this does indeed fix your problem. I'll then
adjust the notes / installer  in wxobs to suit.

Thanks for catching it and for bringing it to my attention.

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAAraAziKtCfEpC_bGY0%2B1JeXDMfWGx6KCjUrHJTuzw%3DL%2BEcrHA%40mail.gmail.com.

Reply via email to