Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

<temptrend> - difference in realtime.txt and websitedata.json

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
User avatar
Dador
Posts: 352
Joined: Thu 24 Nov 2011 2:22 pm
Weather Station: Davis VP2 Plus & Ecowitt
Operating System: Windows 10
Location: Rybnik, Poland
Contact:

<temptrend> - difference in realtime.txt and websitedata.json

Post by Dador »

Hi,

I noticed that there is a difference in the presentation of data for the <temptrend> and <presstrendval> tags in realtime.txt and websitedata.json.

In realtime.txt if the trend is positive, there is a "+" in front of the value, but not in websitedata.json it. Conversely, if the trend is negative, then "-" is here and here. Why?

For example, my files:
https://cmx.pogodarybnik.pl/realtime.txt
https://cmx.pogodarybnik.pl/websitedata.json
water01
Posts: 3670
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10/11 64bit Synology NAS
Location: Burnham-on-Sea
Contact:

Re: <temptrend> - difference in realtime.txt and websitedata.json

Post by water01 »

Presumably the code assumes it is positive unless there is a negative sign in front of it?
David
Image
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: <temptrend> - difference in realtime.txt and websitedata.json

Post by mcrossley »

realtime.txt uses a text string, websitedata uses a numeric value.
User avatar
Dador
Posts: 352
Joined: Thu 24 Nov 2011 2:22 pm
Weather Station: Davis VP2 Plus & Ecowitt
Operating System: Windows 10
Location: Rybnik, Poland
Contact:

Re: <temptrend> - difference in realtime.txt and websitedata.json

Post by Dador »

mcrossley wrote: Sat 15 Oct 2022 11:54 am realtime.txt uses a text string, websitedata uses a numeric value.
Ok, but for example the tag <TempChangeLastHour> works fine in json, i.e. as it grows it is +, as it falls it is - in front of a numerical value.
So I don't see any consistency in CMX when it comes to presenting trend data.
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: <temptrend> - difference in realtime.txt and websitedata.json

Post by mcrossley »

So, websitedata.json does not contain <#temptrend> :?

It does contain <#TempChangeLastHour>, and that is a string and does have a leading "+" if positive.

So, I'm not sure what the problem is?
User avatar
Dador
Posts: 352
Joined: Thu 24 Nov 2011 2:22 pm
Weather Station: Davis VP2 Plus & Ecowitt
Operating System: Windows 10
Location: Rybnik, Poland
Contact:

Re: <temptrend> - difference in realtime.txt and websitedata.json

Post by Dador »

I believe that whether there is a + or - sign before the value matters.
Let's see the picture below.

Image

Suppose a visitor comes to my page where I have a CMX template and data from websitedata.json and sees such data. What thinks? He knows that there has been a change in pressure, but he does not know whether it is falling or rising (assuming that he does not know Polish and does not translate the page through a translator).

If the value was -0,4hPa/hr or +0,4hPa/hr, it would be immediately known how the pressure trend behaves.

Hence, I believe that the temperature and pressure data in the json file should also contain "+", just as they do contain "-" . It is, in my opinion, both practical and logical.


PS.
mcrossley wrote: Sat 15 Oct 2022 7:55 pm So, websitedata.json does not contain <#temptrend> :?
That's right, I added a lot of tags myself to keep the data on the website up-to-date. ;)
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: <temptrend> - difference in realtime.txt and websitedata.json

Post by mcrossley »

Ok, sorry I missed the subtlety of the difference between rain and pressure trend. I'll look at that, I would have expected the pressure to have the leading + as well...
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: <temptrend> - difference in realtime.txt and websitedata.json

Post by mcrossley »

OK, I have had a look and yes, the "trend" values sent by the various tags are inconsistent.

The numeric values are:
- presstrendval = numeric
- PressChangeLast3Hours = numeric
- TempChangeLastHour = numeric string with +
- temptrend = numeric


I do not think there is a clean way to fix this legacy, so I propose to add new tags for numeric values as strings for:
- presstrendvalstr
- PressChangeLast3HoursValStr
- temptrendvalstr

And a new numeric tag:
- TempChangeLastHourVal

Thoughts?
User avatar
Dador
Posts: 352
Joined: Thu 24 Nov 2011 2:22 pm
Weather Station: Davis VP2 Plus & Ecowitt
Operating System: Windows 10
Location: Rybnik, Poland
Contact:

Re: <temptrend> - difference in realtime.txt and websitedata.json

Post by Dador »

As for me, I see no problem. I can edit and add new tags to webstiedataT.json
User avatar
Dador
Posts: 352
Joined: Thu 24 Nov 2011 2:22 pm
Weather Station: Davis VP2 Plus & Ecowitt
Operating System: Windows 10
Location: Rybnik, Poland
Contact:

Re: <temptrend> - difference in realtime.txt and websitedata.json

Post by Dador »

I noticed that the temperature and pressure trends now have a "+" in front of the value if they are increasing. This is in the main CMX window. Have the <#temptrend> and <#presstrendval> tags been changed?
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: <temptrend> - difference in realtime.txt and websitedata.json

Post by mcrossley »

No
Post Reply