Page 1 of 1

Feels Like.....

Posted: Tue 23 Jun 2020 9:21 pm
by jon_iz
I've read a few posts about adding "Feels Like" temp to gauges and note that this probably isn't implemented at the moment.

However, i note from the local pages on the CMX local host, looking at the charts, "Feels Like" temp is plotted:
localhost.PNG
but on what appears on the highchart trends from what is send up to my webhost, the data is not plotted.
Weboutput.PNG
Is it available in an .ini file somewhere and I've missed a setting to enable it?

Re: Feels Like.....

Posted: Thu 25 Jun 2020 3:22 pm
by sfws
I was hoping somebody else who actually uses the standard web pages would reply to you, but as a couple of days have passed without anyone else being helpful, and there was another release yesterday, that I have just updated to, I took a look at the relevant files in new release, and do my best to give you an answer below.


Compare CumulusMX/interface/js/charts.js which feeds admin interface charts page

Code: Select all

 series: [{
                name: 'Temperature',
                zIndex: 99
            }, {
                name: 'Dew Point'
            }, {
                name: 'Apparent'
            }, {
                name: 'Feels'
            }, {
                name: 'Wind Chill'
            }, {
                name: 'Heat Index'
            }, {
                name: 'Inside',
                visible: false
            }],
and (yesterday's build 3086 version of) CumulusMX/webfiles/js/cumuluscharts.js

Code: Select all

series: [{
            name: 'Temperature',
            zIndex: 99
        }, {
            name: 'Dew Point'
        }, {
            name: 'Apparent'
        }, {
            name: 'Wind Chill'
        }, {
            name: 'Heat Index'
        }, {
            name: 'Inside',
            visible: false
        }],
The feels like highcharts code is missing from latter, in terms of series names.
I have not tried it, but you might be able to replace the latter by the former, as the json that uploads to the web site does contain the feels like data pairs ready for plotting,
of course you also need to change the code that reads the json file:

Code: Select all

 $.ajax({
        url: 'tempdata.json',
        cache: false,
        dataType: 'json',
        success: function (resp) {
            chart.hideLoading();
            chart.series[0].setData(resp.temp);
            chart.series[1].setData(resp.dew);
            chart.series[2].setData(resp.apptemp);
            chart.series[3].setData(resp.wchill);
            chart.series[4].setData(resp.heatindex);
            chart.series[5].setData(resp.intemp);
        }
by adding

Code: Select all

chart.series[6].setData(resp.feelslike);
I stress I only think this should work, as I have not tried it, and don't have time to try it at present, but I am trying to be helpful, as nobody else will.

Re: Feels Like.....

Posted: Thu 25 Jun 2020 4:30 pm
by mcrossley
That sounds reasonable - I did add the feels like data to temperature graph JSON file, so all that needs to be done is the add it into the cumuluscharts.js JavaScript file almost as you have it above.

The thing to note is that order must be the same in both the series declaration, and the data loading. So to append Feels Like at the end (easy option)....

Code: Select all

        series: [{
            name: 'Temperature',
            zIndex: 99
        }, {
            name: 'Dew Point'
        }, {
            name: 'Apparent'
        }, {
            name: 'Wind Chill'
        }, {
            name: 'Heat Index'
        }, {
            name: 'Inside',
            visible: false
        }, {
             name: 'Feels Like',
       }],
and as you had...

Code: Select all

        success: function (resp) {
            chart.hideLoading();
            chart.series[0].setData(resp.temp);
            chart.series[1].setData(resp.dew);
            chart.series[2].setData(resp.apptemp);
            chart.series[3].setData(resp.wchill);
            chart.series[4].setData(resp.heatindex);
            chart.series[5].setData(resp.intemp);
            chart.series[6].setData(resp.feelslike);