Page 1 of 1

Change soil moisture units in web interface

Posted: Sat 13 Feb 2016 8:44 pm
by Werk_AG
I'm trying to change the soil moisture units in the web interface from "CB" to "vwc".
I thought that I just need to edit the extra.html...

Code: Select all

<td>Sensor&nbsp;1&nbsp;</td>
<td><span id="SoilMoistureSensor1">--</span></td>
<td>vwc</td>
but, it always shows "CB", no matter I clean the browser cache, or change to another.
What I'm doing wrong?

Thanks

Re: Change soil moisture units in web interface

Posted: Sun 14 Feb 2016 8:48 am
by laulau
I think you have to stop Cumulus and restart it!

Re: Change soil moisture units in web interface

Posted: Sun 14 Feb 2016 9:48 am
by steve
Look at extrasensors.js - you'll see that the entire table is generated from json data read from MX using jQuery DataTables. The unit is built in to that json data (look at ...:8998/api/extra/soilmoisture.json)

If you want to change the units you will need to change extrasensors.js. Either modify the json data after it's read and before it's used to create the table, or don't use a Datatable but extract the values from the json data and just update the HTML elements using them. It's not as difficult as I'm making it sound ;)

Re: Change soil moisture units in web interface

Posted: Mon 15 Feb 2016 4:27 am
by Werk_AG
Now that I have a hint, I will try it.
Thank you Steve.