contents of text file to text sensor

All kinds of 'OS' scripts

Moderator: leecollings

Post Reply
User avatar
Thuis
Posts: 281
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

contents of text file to text sensor

Post 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.
If you can not handle a computer, you buy a Mac. If you can not handle domotica, you use Homeassistant!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest