I am actualy facing the problem that all my temperatures within openhab are displayed as float with “,” as separator, but I am receiving mqtt messages with “.”. If I am right I can use rules to transform this without changing my complete system language.
But I really don’t understand how this works?
Hi thx,
Ok that is exactly what I am now trying. Now I am a the state that I can see all separators equal, but one is not shown in my graph, I am sure that this is maybe because of wrong data type string instead of float.
I created a transform script:
JS:MQTTTempConvert.js
var logger = Java.type(‘org.slf4j.LoggerFactory’).getLogger(‘org.openhab.rule FLOBO’);
(function(temp) {
var out_temp = parseFloat(temp);
logger.info(temp);
return out_temp;
})(input)
And added this within the channel (channel="mqtt:topic:82968fcf2f:ESP_HOCHBEET_INDOOR:temperature) below:
Incoming Value Transformations
JS:MQTTTempConvert.js
persist file:
Items {
// additionally persist Items
g_Temperature* : strategy = everyMinute -> displayed in graph correctly
persist_Group* : strategy = everyMinute -> rrd file existing and getting updated but not on graph
}
This seems to work I am getting the temperatures displayed in the item/log but not within the graph, this actually is the only value from MQTT every temperature from Homematic is getting displayed.
I am getting forward a little bit, and hopefully I understand the linking of scripts, items etc. soon
BR