Page 1 of 1

contents of text file to text sensor

Posted: Friday 01 July 2022 16:26
by Thuis
Hello im trying to get 3 (or more) words from a text log file into a text sensor. The thing is, it only takes the first word, because i dont know how to do this the right way.

I have this in a bash script and im running it from the command line:

Code: Select all

var=$(cat "/security/security.log")
curl -s "http://domoticzip:port/json.htm?param=udevice&type=command&idx=1385&nvalue=0&svalue="$var
It tells me this on the command line:
{
"status" : "OK",
"title" : "Update Device"
}
And when i look in the text sensor i only see the first word.

Could someone please give me some pointers to help me to get the contents (more than one word) of the file to the textsensor.