logInfo dif display in OH3 instead of OH2

Hi guys

Since i move from OH2 to OH3 i got an issue displaying in logs my temp using DHT 22

This is the script that i`m running to collect all the info, it looks like for last line soemthing is not good because after each variable " TEMP and HUMID" in logs i got a new line , any idea why ?

Line for LogInfo from Script :

    logInfo("Keller", "Temperatur: " + TEMP + "°C, Feuchte: " + HUMID.toString() + "%")

Output :

Can you help ?

Thank you

There’s a newline character in your HUMID variable. Not much else we can say, from supplied information.

Here is the whole script :

rule “keller_temp”
Time cron “0 */1 * * * ?”
var TEMP = executeCommandLine(Duration.ofSeconds(60), “/usr/bin/sshpass”,"-p",“hotsauce”,“ssh”,"-o",“StrictHostKeyChecking=no”,"pi@","’’/usr/bin/python3","/var/www/rfoutlet/temp.py’’",“5000”)
if (TEMP.toString().length <= 5) tmp_keller.postUpdate(TEMP)
var HUMID = executeCommandLine(Duration.ofSeconds(60), “/usr/bin/sshpass”,"-p",“hotsauce”,“ssh”,"-o",“StrictHostKeyChecking=no”,"pi@","’’/usr/bin/python3","/var/www/rfoutlet/hum.py’’",“5000”)
if (HUMID.toString().length <= 5) humidity_keller.postUpdate(HUMID)
logInfo(“Keller”, "Temperatur: " + TEMP + "°C, Feuchte: " + HUMID.toString() + “%”)


That’s nice. Are you going to change your python script not to add newline character, or (safer perhaps) remove it in the rule?

Yes , but i dont know how to do that .... i dont see where is the new line in variable …

Return strings from shell commands almost always end in a newline character. If they didn’t then the standard output (what you see in the terminal) would be one long, run-on line and far less readable. The executeCommandLine function reliably returns the entire standard output of the command, so this would include the new line character at the end. Therefore, the culprit is your TEMP and HUMID variables.

Got it … thanks for explication, Its strange that in OH2 i dont have this issue and the output is in one line :slight_smile:

This are the logs from OH2


That may help: