How to get datas from RaZberry+Aeotec Door sensor
Posted: 18 Jul 2019 00:42
Hi,
I am able to get datas from z-way-server.log file and display it on the terminal. But I want to get datas with python script and send the datas maybe to server. I do not want to use log file, it only gets the last line of the file and display it. But I do not how to do it, is there a topic or tutorial?
I am able to get datas from z-way-server.log file and display it on the terminal. But I want to get datas with python script and send the datas maybe to server. I do not want to use log file, it only gets the last line of the file and display it. But I do not how to do it, is there a topic or tutorial?
Code: Select all
#!/bin/bash
FILEPATH="/var/log/z-way-server.log"
while :
do
DATA=$(sudo tail -n1 "$FILEPATH" | grep --line-buffered device-info | sed -r 's/.{115}//; s/.{15}$//')
sleep 1
echo "$DATA"
done