• 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
#41
http://www.pilight.org/get-started/eventing/

And a little creativity. Also, there is the eventing forum for just support questions.
 
Reply
#42
(03-02-2015, 10:16 PM)framp Wrote: ... execute
Code:
piSetup.py Location='yourTown' LogID='yourIDcode'
I get
Code:
geopy.geocoders import Nominatim - No module names geopy.geocoders.

Maybe the installation failed. Please look at Welcome to GeoPy’s documentation!

Below the line: To geolocate a query to an address and coordinates: you find instructions to use geopy.
On a terminal start 'python' and try the the commands in the box, also with your 'Location'.
If that fails there is a problem with the installation.
Please report back.
 
Reply
#43
(03-02-2015, 11:03 PM)curlymo Wrote: http://www.pilight.org/get-started/eventing/

And a little creativity. Also, there is the eventing forum for just support questions.
I already saw the rules/action part. But I'm sorry, but I have no clue how to get my switches to turn on/off depending on the current sunrise/sunset with pilight. piSwitch documents this in detail.
 
Reply
#44
(03-03-2015, 12:51 AM)gneandr Wrote: Maybe the installation failed. Please look at Welcome to GeoPy’s documentation!
Your installer doesn't install geopy correctly. THe link you provided helped me to figure out what's missing:
Code:
pip install geopy
Then I was able to start piScheduler and logon to the Web frontend. I was able to get my location information (Daily schedule prefs) but when I try to edit the pref file I get
Code:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 862, in _handle
    return route.call(**args)
  File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 1732, in wrapper
    rv = callback(*a, **ka)
  File "/home/pi/piScheduler/piWeb.py", line 275, in edit
    devices = getConfig1('devices')
  File "/home/pi/piScheduler/piWeb.py", line 56, in getConfig1
    response = urllib2.urlopen(request).read()
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 401, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 419, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1211, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1181, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno 111] Connection refused>
even I invoked piSchedule.py as root. Do you have any idea what's wrong there?
 
Reply
#45
@framp
The listing points to
Code:
File "/home/pi/piScheduler/piWeb.py", line 275, in edit
and I think piWeb.py has a hardcoded url with port 5001 .. which shouldn't! --> bug
For the moment, can you edit piWeb.py #53 with your correct port no., please

And thanks for pointing to the missing pip Wink
 
Reply
#46
I modified line 53 to use port 82 which was reported by piSchedule instead of 5001 which was used in the code - and now I get a busy browser loop when I try to connect to port :82
 
Reply
#47
(03-03-2015, 11:47 PM)framp Wrote: I modified line 53 to use port 82 which was reported by piSchedule instead of 5001 which was used in the code - and now I get a busy browser loop when I try to connect to port :82

Sorry, at piWeb.py #53 you need to have the port 'pilight' is running with. Look at your 'pilight webgui' page, use the port shown there.
 
Reply
#48
I can use the GUI now Smile. I changed the port of pilight to 80 - so I now modified the port in piWeb.py also to use port 80.

I tried to create rules with the GUI and got UNDEF in the time at some point in time (e.g. 00:15:undef) so there seams to be some bug. Actually I'm not able to reproduce this because until now I didn't get the syntax and sematic Crying. I'm also not able to activate the schedule I created. And when I tried to activate a schedule in the commandline I got a hanging command line. Looks like I have to spend some more time on this Surprised

I'm also not able to connect from my Android smartphone. I tried port 82 which is my pilight port# +2 but no success. Any idea what may be wrong there?

I managed to get my switch to turn on and off every 1 min now with piScheduler :-)

Nice tool ! You did a great job !

Unfortunately I get an error message when I start piSchedulder - but it works nevertheless. So maybe you have an idea what's wrong there.
Code:
piSchedule   vers.0.3   2015-03-04 23:12:05  ( 2015-03-05)  192.168.0.12:82
  GeoLocation
     Foo  ***
     Sunrise:  ***
  Day Schedule     [schedule.ini]    [/home/pi/piScheduler/Wednesday.log]
--------------------------
schedule.ini - Job >AS1;on,time,+:01;off,time,+:01;on,time,+:01;off,time,+:01;on,time,+:01;off,time,+:01;on,time,+:01;off,time,+:01<
**** unknown string >> err:time <<<
   delta + :  +:01
   xTime   :  2015-03-04 23:13:05   ::  on,time,+:01   ::  AS1
**** unknown string >> err:time <<<
   delta + :  +:01
   xTime   :  2015-03-04 23:14:05   ::  off,time,+:01   ::  AS1
**** unknown string >> err:time <<<
   delta + :  +:01
   xTime   :  2015-03-04 23:15:05   ::  on,time,+:01   ::  AS1
**** unknown string >> err:time <<<
   delta + :  +:01
   xTime   :  2015-03-04 23:16:05   ::  off,time,+:01   ::  AS1
**** unknown string >> err:time <<<
   delta + :  +:01
   xTime   :  2015-03-04 23:17:05   ::  on,time,+:01   ::  AS1
**** unknown string >> err:time <<<
   delta + :  +:01
   xTime   :  2015-03-04 23:18:05   ::  off,time,+:01   ::  AS1
**** unknown string >> err:time <<<
   delta + :  +:01
   xTime   :  2015-03-04 23:19:05   ::  on,time,+:01   ::  AS1
**** unknown string >> err:time <<<
   delta + :  +:01
   xTime   :  2015-03-04 23:20:05   ::  off,time,+:01   ::  AS1
It seems to me there is no way to have different schedules for different weekdays - in particular on the weekend and working day. Would be great to get this feature in the next version.
 
Reply
#49
Last post for today: I don't understand following doc
Code:
Devices defined with pilight can be switched by piSchedule with calls like:

    http:// + server + ':' + port + Job

server and port are read from the pilight configuration file /etc/pilight/config.json. piSchedule uses the pilight port and the two next ports also.

Job is build in consistence with the pilight configuration and holds device and switch with state on/off with time values.
I suspect the url has to be
Code:
http:// + server + ':' + port + '/' + Job
But it's not clear to me what Job has to map to. Does this has to be the .ini filename?
 
Reply
#50
@framp
Great getting your feedback .. it shows some handling problems with the GUI, or .. there are some situations which are not correctly handled by the program.

You get a log like this:
Code:
**** unknown string >> err:time <<<
   delta + :  +:01
   xTime   :  2015-03-04 23:20:05   ::  off,time,+:01   ::  AS1
I think you have added a new job with the setting of "time". With that the time is calculated as:
-- for ON the time is set to the current time.
-- for OFF if it's on the same line as ON, the OFF time is calculated related to the ON time on the line. If OFF is on an extra line, also the time is related to the actual time.

The "unknown string >> err:time <<<" seems to be a bug. I'll go for it.

What was the schedule definition you entered on the command line?
(see piConsole)

About the smartphone/Android: which version? I'm on a tablet with Android 4.1.1, but a smartphone with an old version (2.3.6) doesn't work!

Absolutely correct, on the docu Overview it has to be:
Code:
http:// + server + ':' + port + '/' + Job
Will correct it.
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.

Keep going!
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)