Hi all! I’m gathering some data from aquara temperature sensors using the http binding and a deconz gateway. Unfortunately the gateway gives the values multiplied by 100 thus let’s say a temperature of 19.21 °C is displayed on the channel as 1921 °C. I apply a JS transform on the item associated and that’s ok in the basic UI interface, but GA would still display it as 1921 °C. I even tried to cascade to transformations in the things configuration file, but it looks like it is possible just when using the mqtt binding. Is there a way to apply a transformation even to the GA data when using the http binding? Here’s my code:
Type number : temperature1 "Temperature1" [ stateTransformation="JSONPATH:$.11.state.temperature" ]
Number T_LivingRoom "Temperatura soggiorno [JS(divide.js):%s]" <temperature> { channel="http:url:aquara:temperature1" , ga="TemperatureSensor"}
I did exactly this and of course removed the JS transformation in the items file, but I got either on GA and basic UI the value divided by just ten. Let’s say if the sensor tells 1639 I get 164… My transformation is:
(function(i) {
var a = parseInt(i, 10);
a = a/100;
return a.toFixed(1).toString().replace(".", ",") + "°C";
})(input)