Either one of the 3 above, will return the temperature reading for sensor 237, in this case it’s simply showing the value 23.7 on the returned web page.
so, parse your JSON return… how about using the jquery:
function getTemp(){
var tempURL = "http://192.168.1.234:3480/data_request?id=variableget&DeviceNum=237&serviceId=urn:upnp-org:serviceId:TemperatureSensor1&Variable=CurrentTemperature&output_format=json;
$.getJSON(tempURL, function(data) {
console.log(data); // Check out what your return actually looks like int he console...
document.getElementById("currentTemp").innerHTML = "Office Room Temp: " + parseFloat(data) + "°C";
});
}
Sadly I’m just someone who tries to adjust and learn from examples I find online/this forum and look to make them work for how I want them too. So unfortunately I don’t have a web developer background to fully understand all the differences and benefits of jQuery vs JavaScript.
So to incorporate your suggested code, do I do the following