Problem with ws_calc

Fragen, Anregungen zur PC-Wetterstations-Software

Moderatoren: Werner, Tex, weneu

Antworten
Steph

Problem with ws_calc

Beitrag von Steph »

Hi everybody,

I have problems in templates, first with ws_calc: i try to make a month summary with current month values, last year and the difference.
It seems to work with some variables, but not all.
Ex. : for rain i have
%rainmonth% %rainlastmonthyear% %ws_calc[-]=%rainmonth%~%rainlastmonthyear%~1%
and for rainy days
%rain0month% %rain0days_mpast[%ws_month2%~-001]% %ws_calc[-]=%rain0month%~%rain0days_mpast[%ws_month2%~-001]%~0%
I get the right value for rainy days but "rainmonth%~ 48,4~1%" for rain quantity.
I tried with ws_calc1, but it doesn't work.

Also, is there a way to get values (max, total...) of additional time sensor (rain duration) and sun duration in hours:minutes instead of fraction of hours ? I tried to convert in minutes, but i went to the limit of 2 times the same var per line trying not to show 0 values...

Can somebody help me ?

Greetings
Benutzeravatar
weneu
Site Admin
Beiträge: 11572
Registriert: 22 Feb 2002 01:00
Wohnort: Donauwörth
Danksagung erhalten: 18 mal
Kontaktdaten:

Beitrag von weneu »

Hello,
do not group variables like you did in one line
%rainmonth% %rainlastmonthyear% %ws_calc[-]=%rainmonth%~%rainlastmonthyear%~1%
but do it like this:
%unit_off%%ws_calc[-]=%rainmonth%~%rainlastmonthyear%~1%
and it will work
Steph

Beitrag von Steph »

Hi Werner,

Thanks for the quick answer.
It works when i split on two lines, but the file i want to generate is plain text, so i want to keep the 3 values on the same line for alignment, like this :

Code: Alles auswählen

Pluie (mm)
  Total :               20,8                       48,4                  x
                                                                                    -27,6
  Jours :                6                          9                   -3
    >  2,0               4                          6                   -2
    >  5,0               1                          4                   -3
    > 10,0               0                          1                   -1
    > 20,0               0                          0                    0
  Durée :                2,58                       6,63                -4,05
    Max :                0,83 ( 6)                  1,75 (30)
The -27,6 should be at the X place. I use the same formulation for rainy days and it works (with version 2.92.5).

I could use html tables as a workaround...

Any idea for time sensors representation (durée and max) ?

Best regards,

Stéphane
Benutzeravatar
weneu
Site Admin
Beiträge: 11572
Registriert: 22 Feb 2002 01:00
Wohnort: Donauwörth
Danksagung erhalten: 18 mal
Kontaktdaten:

Beitrag von weneu »

Hallo Stèphane,
do you think of Variables like %sunday_s%?
This will show you the time in the following way: 4:00 h
or %sunmonth_s% for the whole month and so on.
And when you take a variable like %sunday_d% you will get it decimal.
Antworten