• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
piScheduler -- A pilight extension for the daily switch plan
#56
@Joergsh: Not sure what you are looking for. If you want to change the active .ini file on daily base just use the following small script and call it in the crontab for every day you want to get use a different .ini file. Just pass the .ini filename:
Code:
#!/bin/bash

if [[ $# < 1 ]]; then
   echo "Missing .ini"
   exit 127
fi

if ! ps -ef | grep "python.*piScheduler" | grep -v -q grep; then
   echo "No piScheduler active"
   exit 127
fi

kill -2 $(ps -ef | grep "python.*piScheduler" | grep -v grep | awk '{ print $2; }')

echo "Waiting for piScheduler to terminate..."
rc=0
until [ $rc != 0 ]; do
   v=$(ps -ef | grep "python.*piScheduler" | grep -v grep)
   rc=$?
   sleep 3
done

echo "Starting piScheduler with $1 now"
startPiScheduler.sh $1
startPiScheduler is another script which starts piScheduler in a screen session.
Code:
!/bin/bash
cd /home/pi/piScheduler
if [[ $# < 1 ]]; then
   ini="/home/pi/piScheduler/frampSchedule.ini"
else
   ini=$1
fi

/usr/bin/screen -dmS "piScheduler" sudo /home/pi/piScheduler/piSchedule.py $ini
Just in case that's what you're looking for. Feel free to use the scripts Smile

Just in case you're not familiar with screen:
1) Install screen with
Code:
sudo apt-get install screen
2) Search for screen in the net or visit a webpage I created which gives a brief summary about screen and some typical use cases. Scenario #3 is the one required for pilight.
 
Reply
  


Messages In This Thread
RE: piScheduler -- A pilight extension for the daily switch plan - by framp - 03-16-2015, 09:11 PM
piSchedule error - by donbucknall - 01-02-2016, 05:30 PM

Possibly Related Threads...
Thread Author Replies Views Last Post
  Does piSchedule work with pilight 8.1.1-nightly Peter S 0 2,019 06-29-2018, 07:57 PM
Last Post: Peter S
  pilight-console - an LCD / keypad interface for pilight frenchie71 3 1,833 11-21-2017, 11:15 PM
Last Post: curlymo
  Connect pilight to your hue bridge hannemann 3 3,282 01-03-2017, 11:26 PM
Last Post: hannemann
Wink PHP class using pilight socket connection Dan 0 1,783 11-03-2016, 11:41 AM
Last Post: Dan
  Controlling a RGB Led Strip over pilight mightyuhu 2 2,861 08-06-2016, 09:10 PM
Last Post: JohannK
  HomeBridge with pilight on raspbian Jurre 10 13,793 04-06-2016, 07:45 AM
Last Post: tomtom
  pilight voice commands kniazio 11 7,158 01-29-2016, 07:51 PM
Last Post: sral
  Python Ping pilight detect mobilephone Cryptomaster 0 2,460 01-10-2016, 04:17 PM
Last Post: Cryptomaster
  pilight config editor ktams 16 9,634 01-06-2016, 02:42 PM
Last Post: ktams
  command processing between pilight and openhab royhofman1989 3 3,250 07-13-2015, 11:26 AM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)