Hi, I've been thinking and looking at python (and I didn't understand much of it) and other stuff, but I can't figure out how to achieve this. What I want to do is to have the macros as follows:
Monday
Tuesday
Wednesday
etc...
They should all be executed by the same trigger, but, as you probably already figured out, only on the corresponding day, also, if possible, to set certain macros, lets say, every other week also the macros saturday and sunday should be triggered.
Unfortunantly there's no, as far as I know, calendar plugin, I've looked at the Scheduler and ScheduleGhost plugins. but not yet figured out a good solution. Any help appreciated!
Thanks!
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Enable macro at certain day
Re: Enable macro at certain day
Schedulghost should be able to do the trick. Set several schedules to trigger events for each day when you want some macro to be disbabled or enabled.Samme wrote: I've looked at the Scheduler and ScheduleGhost plugins!
Create macro's to which you add actions that either enable or disable the actual macro's that you want to have enabled or disabled.
Move the event that occurs as a result of the scheduleghost schedules towards the macros as needed.
Re: Enable macro at certain day
Try a python script. I use the following to trigger an event at startup on weekdays (where %w is 1 [Monday] to 5 [Friday]) and if hour is after 1 PM and before 6 PM.
Note that %W (uppercase) represents week number (you could use that to trigger event every odd or even week number). Check out http://docs.python.org/library/time.html for all the directive descriptions.
kalia
Note that %W (uppercase) represents week number (you could use that to trigger event every odd or even week number). Check out http://docs.python.org/library/time.html for all the directive descriptions.
Code: Select all
from time import strftime
if 18 > int(strftime("%H")) >= 13 and 6 > int(strftime("%w")) > 0:
eg.TriggerEvent("test", payload=None, prefix="test", source=eg)
Re: Enable macro at certain day
Hi guys and thanks for helping me out, I've been thinking and trying various things, but I've come to the conclusion that the easiest way would be to generate a trigger at startup.
For example today, generate a trigger something like "day.wednesday" or something like that, could you help me with that?
Thanks alot!
For example today, generate a trigger something like "day.wednesday" or something like that, could you help me with that?
Thanks alot!
Re: Enable macro at certain day
I will start the script for you. You should be able to finish it off.
... and so on
Code: Select all
from time import strftime
if int(strftime("%w")) == 0:
eg.TriggerEvent("Sunday", payload=None, prefix="day", source=eg)
elif int(strftime("%w")) == 1:
eg.TriggerEvent("Monday", payload=None, prefix="day", source=eg)
elif int(strftime("%w")) == 2:
eg.TriggerEvent("Tuesday", payload=None, prefix="day", source=eg)
elif int(strftime("%w")) == 3:
eg.TriggerEvent("Wednesday", payload=None, prefix="day", source=eg)
Last edited by kalia on Thu Oct 18, 2012 12:17 am, edited 1 time in total.
Re: Enable macro at certain day
Thanks Kalia! I've completed the script, but I get errors,
"Error compiling script"
"SyntaxError: invalid syntax, line 5"
etc...
...and even if I don't have a "line 5" I still get that error. Weird! Any ideas?
"Error compiling script"
"SyntaxError: invalid syntax, line 5"
etc...
...and even if I don't have a "line 5" I still get that error. Weird! Any ideas?
Code: Select all
from time import strftime
if int(strftime("%w")) == 0:
eg.TriggerEvent("Sunday", payload=None, prefix="day", source=eg)
elseif int(strftime("%w")) == 1:
eg.TriggerEvent("Monday", payload=None, prefix="day", source=eg)
elseif int(strftime("%w")) == 2:
eg.TriggerEvent("Tuesday", payload=None, prefix="day", source=eg)
elseif int(strftime("%w")) == 3:
eg.TriggerEvent("Wednesday", payload=None, prefix="day", source=eg)
elseif int(strftime("%w")) == 4:
eg.TriggerEvent("Thursday", payload=None, prefix="day", source=eg)
elseif int(strftime("%w")) == 5:
eg.TriggerEvent("Friday", payload=None, prefix="day", source=eg)
elseif int(strftime("%w")) == 6:
eg.TriggerEvent("Saturday", payload=None, prefix="day", source=eg)
Re: Enable macro at certain day
Now that I think about it, it is strange there is not a simple plugin for Day / Time trigger.
Maybe someone can convince Pako or Walter to create a streamlined plugin that only monitors/triggers based on Days/Times. The existing Scheduler & SchedGhost are more complicated than I ever needed, and a bit confusing to the average user. Having a simple plugin that logged day and time wold allow users to set a trigger.
Maybe someone can convince Pako or Walter to create a streamlined plugin that only monitors/triggers based on Days/Times. The existing Scheduler & SchedGhost are more complicated than I ever needed, and a bit confusing to the average user. Having a simple plugin that logged day and time wold allow users to set a trigger.
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
Re: Enable macro at certain day
Sorry, it should be elif not elseif. I am new to Python.
Code: Select all
from time import strftime
if int(strftime("%w")) == 0:
eg.TriggerEvent("Sunday", payload=None, prefix="day", source=eg)
elif int(strftime("%w")) == 1:
eg.TriggerEvent("Monday", payload=None, prefix="day", source=eg)
elif int(strftime("%w")) == 2:
eg.TriggerEvent("Tuesday", payload=None, prefix="day", source=eg)
elif int(strftime("%w")) == 3:
eg.TriggerEvent("Wednesday", payload=None, prefix="day", source=eg)
elif int(strftime("%w")) == 4:
eg.TriggerEvent("Thursday", payload=None, prefix="day", source=eg)
elif int(strftime("%w")) == 5:
eg.TriggerEvent("Friday", payload=None, prefix="day", source=eg)
elif int(strftime("%w")) == 6:
eg.TriggerEvent("Saturday", payload=None, prefix="day", source=eg)