text: [Solved] Help-- Textfile content as TempretureDevice | pimatic home automation forum
  [Solved] Help-- Textfile content as TempretureDevice
  I'm a pimatic beginner since Yesterday and like it really.
  pimatic-max, pimatic-ipcamera, pimatic-ping is working nice
  My Problem is i haven't found any Information how ican use the content of a Textfile as Temprature Sensor.
  I have a Raspberry Camera where is conected a DHT22 Sensor
  this Sensor updates every 5 Seconds a Textfile located on my Qnap with temprature and Humidy
  Or is it an other way to use this DHT22 who is connected on a other Raspberry??
  @nsession
  do you have access to the file from the raspberry where pimatic is running?
  then you can use the logreader device for that.
  if you post your logfile and the path to the logfile i could have a look for the match and will provide a device for you.
  Another way of doing this is to use a ShellSensor. See the example at https://github.com/pimatic/pimatic-shell-execute#shellsensor-device
  It should be fairly easy to adapt the example for your use case if it is possible to simply grep the temperature value from the file. If the file a more complex structure it might be easier to use logreader as @leader21 suggested.
  EDIT: Of course, it is also possible to use more complex command sequences, e.g. using sed and awk as show in the examples further down in the linked Readme. Another possibility is to write shell wrapper script which does the job. This way test the extraction of the temperature value independently from pimatic and it also keeps your device configuration as simple as possible.
  you're right, marcus. didn't think of shell sensor at first possible solution (since i am a logreader fan) ^^ if there's only one variable to read a shellsensor is the better option indeed.
  third possibility is to send the temperature via api to pimatic, requires a script that parses the logfile at the source device and pushes the data to pimatic with an curl command. but guess that's only a rare workaround for special requests
  You could let the Pi with the DHT push the values into a variable on a remote Pimatic over the HTTP API?
  I solve it an testet 2 different ways.
  Way one i have runing snmp deamon on the PI with the DHT22 an added the Sensor like this.
  "id": "Carport-humi",
  "name": "Carport Luftfeuchte",
  "attributeName": "Luftfeuchte",
  "command": "snmpget -c public -v1 10.x.x.x.1.3.6.1.2.1.25.1.8.1 | cut -c 35,36",
  Problem is on this way i didn't know enough to cut the better then in my commandline
  Way to is to pars e Text file.
  My Pi with the DHT22 writes humidy and temp to a textfile on m NAS to use this on a python Gui on a other pi so why not use this.
  "command": "cat /mnt/NASSHARE/humid.txt",
  The WebAPI option sounds nice so i would read more about the WebAPI also i will build a kivy interface to controll the pimatic with a Pi on the livingrom witch has the 7" raspberry Display attached.