Hi I'm trying to get a Google gauge to show the value of a temperature sensor.
So far I can get the sensor valued displayed as a number on my web page
In the script part:
//temp_out is the DS18B20 device name specified in config file
tmp = new Temperature("temp_out");{
setInterval(updateUI, 1000);
}
function updateUI() {
tmp.getCelsius(temperatureCallback);
}
// callback function used to display the temperature
function temperatureCallback(tmp, data) {
// jQuery functions
//$("#bt_heater").text(data + " °C");
$("#temp_o").text(data);
In the body part:
<div id="temp_o"></div>
But the google gauge requires a number as input inside a Java function.
google.load('visualization', '1', {packages:['gauge']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Label', 'Value'],
['T out', xxxx],
]);
Where xxxx is a real number.
How do I get the temperature reading in there!?