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.

Scheduler - using eg.scheduler.AddTaskAbsolute

If you have a question or need help, this is the place to be.
Post Reply
jenno2001
Posts: 8
Joined: Wed Mar 04, 2015 12:32 pm

Scheduler - using eg.scheduler.AddTaskAbsolute

Post by jenno2001 »

I'm no programmer, but I stumble around using the forum and examples to create my domestic Heating Controls with a range of thermostat settings, schedules and overrides.

I've been able to list and cancel any Scheduled events, but I have and an issue trying to setup multiple Scheduled Events or looping an AddTask.....

Code: Select all

eg.scheduler.AddTaskAbsolute(sdsecs, OverrideStartTime, "Name")
where OverrideStartTime is setup in a def that includes

Code: Select all

    eg.TriggerEvent("Text", payload=(starttaskdate,endtaskdate,status,temp))
I have attempted to create some uniqueness by adding a counter to the Text and/or the payload of the Trigger as well as the AddTaskAbsolute "Name" , but the result ends up the same i.e. the payload for all listed events is overwritten by the last entry. I have read in some documentation or code comments that this is expected, but I wonder if there is any alternatives to stop the overwrite?

Like I say I'm not that knowledgeable, but could it be that payload is setup as some global or namespace and if so is there a way to workaround this?

If anyone can spare the time to help with any suggestions that would be much appreciated.
thank you, Jenno
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Scheduler - using eg.scheduler.AddTaskAbsolute

Post by krambriw »

I think it might be easier to help you if you share the complete python script. Or illustrate with a view from your configuration tree
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Scheduler - using eg.scheduler.AddTaskAbsolute

Post by kgschlosser »

Why not use the ScheduleGhost plugin instead of trying to do everything from scripts
If you like the work I have been doing then feel free to Image
jenno2001
Posts: 8
Joined: Wed Mar 04, 2015 12:32 pm

Re: Scheduler - using eg.scheduler.AddTaskAbsolute

Post by jenno2001 »

Many thanks for the offer of help, especially being amid the holiday season.
I have used my cobbled together scripts for quite a while and wanted to extend the logic on my heating system, so I was reluctant to start changing to other plugins. When trying to condense the script and post on the forum I started to get other results from scheduling multiple events e.g. unassigned variables.

The good news is I appear to have fixed my issue, rather than pass a single "myArguments"" to the eg.scheduler.AddTaskAbsolute command I passed the arguments individually. This maybe due to my ignorance of how strings/variables are handled, however the end result was the original payloads were retained for each loop.

I'm not sure if I have explained this correctly but I have the result I was looking for.
Once again many thanks for offering to help.
Jenno
Post Reply