Author Topic: Adding additional Sensors to Steelseries on Leuven  (Read 1361 times)

0 Members and 1 Guest are viewing this topic.

Offline mhenkenis

  • Member
  • *
  • Posts: 6
    • Henkestrand
Adding additional Sensors to Steelseries on Leuven
« on: January 23, 2016, 02:56:02 AM »
I'm wanting to add some additional temp sensors to my Steelseries temp gauge, but am struggling to find the source of the data that the gauges use.  When I look at the wsgauges.js script, the data source seems to be realtime.txt and that that is generated from gauges\realtimeMH.php.  But I have no realtime.txt in my uploadMH directory and no realtimeMH.php in my guages directory.

The default gauges are working and showing the correct temperatures, so I know it's getting the data from somewhere, but I'm really scratching my head trying to figure out where the data is coming from.

Does anyone know the file that is the data source for the Steelseries guages in the Leuven template?  Or if it isn't a file, how it gets the data from the uploaded files to steelseries?

As mentioned, I'm on Leuven (new installation) and I'm using meteohub.

Thanks,

Mike

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Adding additional Sensors to Steelseries on Leuven
« Reply #1 on: January 23, 2016, 05:04:18 AM »
I'm wanting to add some additional temp sensors to my Steelseries temp gauge, but am struggling to find the source of the data that the gauges use.  When I look at the wsgauges.js script, the data source seems to be realtime.txt and that that is generated from gauges\realtimeMH.php.  But I have no realtime.txt in my uploadMH directory and no realtimeMH.php in my guages directory.

The default gauges are working and showing the correct temperatures, so I know it's getting the data from somewhere, but I'm really scratching my head trying to figure out where the data is coming from.

Does anyone know the file that is the data source for the Steelseries guages in the Leuven template?  Or if it isn't a file, how it gets the data from the uploaded files to steelseries?

As mentioned, I'm on Leuven (new installation) and I'm using meteohub.

Thanks,

Mike
Can you please check your profile as the globe on the left of your messages does not lead to your site but gives a 404 error.

I found your site and lets check one of the gauges displays: http://henkestrand.com/weather28/ws_gauge_frame.php?lang=en&wp=MH
You will need the following procedure when changing the gauges:
Use chrome (other browser can do this also) => right click => choose "inspect" => click network, wait until the 60 seconds are passed.

You can now inspect the network trafic and see that indeed the data is loaded from
http://henkestrand.com/weather28/ws_realtime.php?lang=en&wp=MH
and that the returned data looks like a JSON string which I shortened for this post:
Code: [Select]
{"date":"11:50","temp":"0","tempTL":"0","tempTH":"0","intemp":"2. . .  SHORTENED . . . ewpoi0","wchill:,"Cur
The Leuven template uses in general 2 files for the weatherdata.
  • 5 minute data, in your case tagsMH.txt (and an extra yesterday file as MH has no yesterday data)
  • realtime data, for MH (and a few others) the clientraw files are used
So as all other data-scripts (gauges/ajax/mwware) the gauges data-get-script: ws_realtime.php  reads current data and returns data in the JSON string so the gauges understand it.
What you should do:
1. use the latest gauges, the ones which include the clock, which are floating around in beta test
2. add extra fields to the json string , created in the central data handling script: wsAjaxDataLoad_v3.php starting line 95
3. find a solution to have multiple gauges of the same nature AND please tell us HOW you solved it.

You will find point 3 the most difficult, so my advise is to first try to display multiple temp gauges and use the same data for them. After you succeed with that, then update wsAjaxDataLoad_v3.php.

Also as noted in other posts, the 2.9 release (estimated June this year) will have multiple gauges of the same type and will have user defined fields added to the tags files,

Wim


 

Offline mhenkenis

  • Member
  • *
  • Posts: 6
    • Henkestrand
Re: Adding additional Sensors to Steelseries on Leuven
« Reply #2 on: January 24, 2016, 05:34:31 PM »
Thanks for the tips - I've got the new gauges in.

One thing that may make  it easier for me is that I'm not wanting an additional temp gauge - I'm just wanting to add some additional sensors to the existing gauge. (I want it to be similar to the dew gauge with multiple sensors)

I have the radio button working (added text to language.js and gauges_v3.php) and have added one of the sensors to the JSON string.  But when I try to modify the doTemp function in wsgauges_v3.js, it won't update the gauge.


I have tried changing the if else statement to add an else if option for the new sensor and to convert the if else to case statements like are used in the doDew function.

Another thing I'm trying to figure out is that the temp and dewpoint gauges aren't picking up the initial values, and the mobile site doesn't pick up the temperature for about a minute.

I've attached a link to my gauges_v3.js file in text format:  http://henkestrand.com/weather28/gauges/scripts/wsGauges_v3.js.txt

Any ideas?

Thanks,

Mike

Offline mhenkenis

  • Member
  • *
  • Posts: 6
    • Henkestrand
Re: Adding additional Sensors to Steelseries on Leuven
« Reply #3 on: January 25, 2016, 05:09:02 PM »
I've done a lot of inspecting today and unfortunately haven't come further - the code passes all the tests I can find, but no progress.

Could this be because the gauges aren't picking up the initial values?

Mike

Offline mhenkenis

  • Member
  • *
  • Posts: 6
    • Henkestrand
Re: Adding additional Sensors to Steelseries on Leuven
« Reply #4 on: January 26, 2016, 01:19:29 PM »
Going to try a fresh install and get everything working with the default installation - I'll start up a new thread if necessary.

Thanks!

Mike

 

anything