On the first weewx generation cycle the extreme temperatures are not updated

52 views
Skip to first unread message

areax99

unread,
Jun 2, 2024, 11:24:34 AM6/2/24
to weewx-user

i have created this json template
#encoding UTF-8
#import datetime
#errorCatcher Echo
{
    "current": {
        "datetime": "$current.dateTime",
        "datetime_raw": "$current.dateTime.raw"
    },
    "day": {
        "outTemp": {
            "max": "$day.outTemp.max",
            "max_formatted": "$day.outTemp.max.formatted",
            "maxtime": "$day.outTemp.maxtime",
            "min": "$day.outTemp.min",
            "min_formatted": "$day.outTemp.min.formatted",
            "mintime": "$day.outTemp.mintime"
            }
        },
    "yesterday": {
        "outTemp": {
            "max": "$day($days_ago=1).outTemp.max",
            "max_formatted": "$day($days_ago=1).outTemp.max.formatted",
            "maxtime": "$day($days_ago=1).outTemp.maxtime",
            "min": "$day($days_ago=1).outTemp.min",
            "min_formatted": "$day($days_ago=1).outTemp.min.formatted",
            "mintime": "$day($days_ago=1).outTemp.mintime"
        }
    }
}

but when weewx performs the first generation of the new day (00:00), the details of the previous day (and new day) are not updated. They are updated only in the next cycle.

{
"current": {
"datetime": "02/06/2024 00:00:00",
"datetime_raw": "1717279200"
},
"day": {
"outTemp": {
"max": "25,3 °C",
"max_formatted": "25,3",
"maxtime": "11:06:02",
"min": "18,1 °C",
"min_formatted": "18,1",
"mintime": "22:59:06"
}
},
"yesterday": {
"outTemp": {
"max": "24,3 °C",
"max_formatted": "24,3",
"maxtime": "12:59:41",
"min": "18,9 °C",
"min_formatted": "18,9",
"mintime": "03:22:26"
}
}
}


{
"current": {
"datetime": "02/06/2024 00:05:00",
"datetime_raw": "1717279500"
},
"day": {
"outTemp": {
"max": "18,7 °C",
"max_formatted": "18,7",
"maxtime": "00:01:07",
"min": "18,6 °C",
"min_formatted": "18,6",
"mintime": "00:00:04"
}
},
"yesterday": {
"outTemp": {
"max": "25,3 °C",
"max_formatted": "25,3",
"maxtime": "11:06:02",
"min": "18,1 °C",
"min_formatted": "18,1",
"mintime": "22:59:06"
}
}
}


I tried to use $yesterday.... but it gives me an error.

I have 5.0.2 version

michael.k...@gmx.at

unread,
Jun 6, 2024, 1:18:44 AM6/6/24
to weewx-user
At 00:00 on the current day, you don't have new values for the new day, although the day has started, it's duration is 0 so far. The newest, value is the last interval of the previous day. From the archive generation's  point of view, it is still yesterday. So everything OK.
Reply all
Reply to author
Forward
0 new messages