• 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
I have changed the code for the two points you mentioned ('port' in piWeb.py and 'err:time' in piSchedule.py)

On the documentation page 'Overview' find an instruction how to update your piSchedule installation without overwriting the INI/LOG files.

framp Wrote:I'm also not able to activate the schedule I created.
Could you please post your piSchedule.ini definitions (or send a PM).

(03-05-2015, 01:01 AM)gneandr Wrote: ...The "unknown string >> err:time <<<" seems to be a bug. I'll go for it...
I now use sunset instead of tim and edit the init file with vi. That's much faster than to use the GUI.
Quote:...What was the schedule definition you entered on the command line?
(see piConsole)
In the meantime I figured out why I had issues to start the schedule: I was too impatient when I stopped piScheduler and typed CTRL-C and CTRL-Z. At some point in time I detecte there are multiple instances of piScheuler running because I killed piScheduler in it's shutdown and cleanup phase Blush
Quote:For "Job" just go two lines further and see:
Job is build in consistence with the pilight configuration and holds device and switch with state on/off with time values.
I saw this, but I frankly don't understand this sentence. I suggest to add an example in the doc - or at least give me an example in this thread Smile

You missed a question Ihad: is it possible to have different schedules in the week and at the weekend?
No question a direct edit with whatever editor is much faster than using the GUI. The intention for the GUI was to offer a method for the not so technical oriented user to add/delete/edit schedule jobs.
So it's fine the way you go Wink

For "Job" on the 'Overview' page I'll add an example. On the other side it's a technical aspect which isn't that relevant for the 'normal' user. It's just an explanation how piSchedule works together with pilight. Maybe I should move that to a less prominent position.

About the "different schedules in the week and at the weekend": a good idea. Basically you can change the INI file, but there is not automatic procedure for that right now.

(02-03-2015, 11:03 AM)gneandr Wrote: You know I have started with piSchedule time before eventing was available in the need to have schedule plan for lighting my home. Limited as is was (compared to the today available eventing), based on that first attempt my goal was to improve the user experience to be able to setup and edit scheduling with a web interface. Today's piSchedule status gives IT un-experienced users the freedom to control scheduling easily ... I hope.

Would it not be possible that You rewrite Your Web Interface to generate and change the events of pilight directly?


Are you looking to switch pilight at a given day time directly from within piSchedule?
Yes you can: see on the page "piSchedule Edit" (open with second button on the Main Menu). On there, select the last menu item [Add 'Job' to Day Schedule] (below the horizontal separator and the list of your .ini files) which opens the Job definition part only. For that you have the right hand menu with [Exececute 'Job'].
That way you add a Job definition for the current day **only**. That is, next day piSchedule will only execute the content of your current *.ini file.
@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:

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

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

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

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

echo "Starting piScheduler with $1 now"
startPiScheduler.sh $1
startPiScheduler is another script which starts piScheduler in a screen session.
cd /home/pi/piScheduler
if [[ $# < 1 ]]; then

/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
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.
A late arrival for Easter .. surprise, surprise ..

I'm proud the next piSchedule version is ready with some important improvements
  • easier startup with selection of Day Schedule
  • Location for Sunrise/Sunset is automatically resolved
    .. no more extra call before startup
  • WEB-GUI now supports editing / restart of Day Schedule
    .. no need to go to low level linux console .. but you can Wink
  • Multi language support
    .. switch piSchedule during session, default is EN, optional DE
    .. more can be implemented with JSON file extension
    .. how about NL or any other? (give me a call to support it)
  • Documentation available for EN and DE
  • Link to installation/update
    .. previous version can be updated easily with a one step link
Many thanks goes to framp, he did a great job to make the a clean and easy-to-use version

Great new code drop. Thanks for sharing!
I hope it is allowed to post problems or bugs with piScheduler. Unless please tell me.

In the last days i installed the latest pilight and the piSchduler plugin.

It set up a simple switch in config.json of pilight. Called it "swtich1"

In piScheduler it is displayed me "switch" ok i set a rule to switch ON "13:20" and OFF "13:21" only for testing. I added the rules, saved it in *.ini file and was load it in piScheduler.

PiScheduler displays me the right rule and tell me the next actions. But if piScheduler set ON and OFF in pilight nothing is changed.

Next Problem is i set in piScheduler config my latitude and longtitude and the location name/value but it will overwrite after i start piScheduler. The changes was saved as piScheduler was stopped.
First thanks for the feedback. Feel free to give feedback.
Quote:PiScheduler displays me the right rule and tell me the next actions. But if piScheduler set ON and OFF in pilight nothing is changed.
Hope I understand it right, don't expect to see any pilight change back in piSchedule. But if piSchedule executes an ON/OFF you should see that with pilight.

For the other point: with piSchedule vers.0.4 the geolocation details are read at startup and with day change, always. The values are stored to the prefs file. So yes it's overwriting as you mentioned. It's by design .. expecting you work at the location the raspberry/pilight/piSchedule is installed. The geolocation data is based on your network IP.

Note: Please follow this thread the next days, I'm preparing an update for vers. 0.4


Possibly Related Threads...
Thread Author Replies Views Last Post
  Connect pilight to your hue bridge hannemann 4 4,228 10-26-2020, 02:08 PM
Last Post: Michelebup
  Does piSchedule work with pilight 8.1.1-nightly Peter S 0 2,365 06-29-2018, 07:57 PM
Last Post: Peter S
  pilight-console - an LCD / keypad interface for pilight frenchie71 3 2,404 11-21-2017, 11:15 PM
Last Post: curlymo
Wink PHP class using pilight socket connection Dan 0 2,152 11-03-2016, 11:41 AM
Last Post: Dan
  Controlling a RGB Led Strip over pilight mightyuhu 2 3,332 08-06-2016, 09:10 PM
Last Post: JohannK
  HomeBridge with pilight on raspbian Jurre 10 15,763 04-06-2016, 07:45 AM
Last Post: tomtom
  pilight voice commands kniazio 11 8,577 01-29-2016, 07:51 PM
Last Post: sral
  Python Ping pilight detect mobilephone Cryptomaster 0 2,755 01-10-2016, 04:17 PM
Last Post: Cryptomaster
  pilight config editor ktams 16 11,640 01-06-2016, 02:42 PM
Last Post: ktams
  command processing between pilight and openhab royhofman1989 3 3,730 07-13-2015, 11:26 AM
Last Post: curlymo

Forum Jump:

Browsing: 1 Guest(s)