Exactly.

That's the big advantage of assigning a type to a unit group. All the
formatting and conversion machinery becomes available.

On Sun, Jun 5, 2022 at 8:45 AM 'Peter Fletcher' via weewx-user <
[email protected]> wrote:

> Thanks!
> I assume that this works 'out of the box' because I have defined the unit
> for sunshine time as 'minute' (rather than something like 'sun_minute') and
> weewx already 'knows' how to convert between common units of time. For my
> solar production example, you would presumably need to use the unit names
> as they are defined in one of the energy groups..
>
> On Friday, June 3, 2022 at 7:41:33 PM UTC-4 [email protected] wrote:
>
>> Sure. Just tell the report to use hours instead of minutes.
>>
>> For example, for tags, it becomes $week.sunshine.sum.hour
>>
>> For a plot, use option 'unit' in skin.conf.
>>
>> [ImageGenerator]
>>   ...
>>   [[week_images]]
>>     ...
>>     [[[week_sunshine]]]
>>       unit = hour
>>       [[[[sunshine]]]]
>>
>> All documented in the Customizing Guide
>> <http://www.weewx.com/docs/customizing.htm>.
>>
>> On Fri, Jun 3, 2022 at 4:31 PM 'Peter Fletcher' via weewx-user <
>> [email protected]> wrote:
>>
>>> As noted in a different thread, I am working on a small extension to
>>> calculate and store sunshine time (time when the sun is out, rather than
>>> covered by clouds). I am saving the number of *minutes* of sunshine
>>> during the archive period in each archive record. Sunshine minutes are fine
>>> for display on daily reports and graphs, but I would rather display the
>>> more usual sunshine hours on weekly, monthly, and longer reports. Is there
>>> an easy way to tell the report generator to scale the units it uses for
>>> different report periods? I can see this being useful for other categories
>>> of data, too. You might, for example want to display solar production in Wh
>>> for the daily reports but in kWh for monthly and longer ones.
>>>
>>> I feel that XTypes may provide the answer to this, but couldn't really
>>> get my head around how it would work, in practice.
>>>
>>> --
>>> 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 [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/2df447f0-c12d-4947-9bf4-9a2ab9491411n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/weewx-user/2df447f0-c12d-4947-9bf4-9a2ab9491411n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/e033d8fb-4ec7-4d63-ae5a-d8df1da26dcen%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/e033d8fb-4ec7-4d63-ae5a-d8df1da26dcen%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEALGZY0GzVrFx5SWO-35MprpmEiEtwFY-O4FQ2WVzUXLA%40mail.gmail.com.

Reply via email to