• 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
#51
@framp
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).

Guenter
 
Reply
#52
(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?
 
Reply
#53
@framp
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.

Günter
 
Reply
#54
(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?


regards

Joerg
 
Reply
#55
@Joergsh
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.
 
Reply
#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
#57
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

Enjoy
Guenter
 
Reply
#58
Great new code drop. Thanks for sharing!
 
Reply
#59
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.
 
Reply
#60
@danieljo
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

Guenter
 
Reply
  


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

Forum Jump:


Browsing: 1 Guest(s)