Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Triggered event to turn stuff off
#1
Im just now delving into events and I want to create an event to mimick a sleeper timer for my tv/reciever/etc

I tried to search the forum for an example but no such luck. can someone point me to one? Or perhaps just give me a simple explaination.

Thanks
Reply
#2
I don't know if you'll find an exact example, but the easiest way would be something like:

1. Install the timer driver. Create at least one count down timer channel.
2. Set up a trigger on one of the power fields of the devices you are powering on
3. Set up a triggered event on that power field (going to true) that sets the count down timer to some value, like 4 hours or something
4. Set up a trigger on that count down field that pops when the timer goes to zero
5. Set up a triggered event on that count down timer field that just powers off the devices.


Something along those lines. If you want you can have a variables driver boolean field that is used as a manual override, and the #5 event above will check that and not do anything if the override field is True.
Dean Roddey
Explorans limites defectum
Reply
#3
Ok. Ill give that a try.

What i had done so far was use the timedfldchange to change the value of a variables driver field from false to true. that was working. i then configured a trigger event to run the shutdown code when the fld changed to true, but nothing is happening.

is my solution flawed?
Reply
#4
zra Wrote:Ok. Ill give that a try.

What i had done so far was use the timedfldchange to change the value of a variables driver field from false to true. that was working. i then configured a trigger event to run the shutdown code when the fld changed to true, but nothing is happening.

is my solution flawed?

Did you set up the variables driver field to send out a trigger when it changes to the desired value? Fields only send out triggers if configured. If every field sent out a trigger evey time it changed, it would kind of destroy the system. So you have to configure fields to send out triggers that you can trigger events from.
Dean Roddey
Explorans limites defectum
Reply
#5
Dean Roddey Wrote:Did you set up the variables driver field to send out a trigger when it changes to the desired value? Fields only send out triggers if configured. If every field sent out a trigger evey time it changed, it would kind of destroy the system. So you have to configure fields to send out triggers that you can trigger events from.


I did, Dean. I was sending it out (istrue). So the variable<system.shutdown> is set to false by default and then i set it to change to true with the timedfldchange. on the trigger event side i was setting up the number one filter (FldValEquals) to my variable driver <systemstate.shutdown> and the comp value <true>

is that make any sense?
Reply
#6
zra Wrote:I did, Dean. I was sending it out (istrue). So the variable<system.shutdown> is set to false by default and then i set it to change to true with the timedfldchange. on the trigger event side i was setting up the number one filter (FldValEquals) to my variable driver <systemstate.shutdown> and the comp value <true>

is that make any sense?

Make sure the trigger is going out. Open the CQC Command Prompt and run the CQCEventDump program. It'll dump out any event triggers that are being sent out, and make sure you see the trigger going out first.
Dean Roddey
Explorans limites defectum
Reply
#7
So I used some simple test code to run in the event of the trigger and that worked, so obviously something wrong with my code at least in the context of the event triggering system(are there limitations?), but the event system appears to be working.

the code i used that worked was to turn off my squeezebox
one thing i noticed was that the event trigger continues to run the code because i was unable to simply turn the squeezebox back on. it kept turning off until i paused the trigger. is that normal functionality? what i want to do is make it so the trigger executes only once. do i need to add code to reset or pause the trigger?

i also noticed that the timedfldchange appeared to need some sort of reset. is that correct? if so what is the best way to do that? or perhaps i should take your advice and install the timer driver? is that a better mechanism?
Reply
#8
after some more experimenting things are working a little better. ill have to keep testing to see why the squeezebox power gets stuck in power off. i tried more simple power off commands on some of my other devices disregarding all the code that is in my IV power off command and they are now working. i dont seem to have the "stuck" issue that i was having with the squeezebox.
Reply
#9
Any write to the field will cancel the timed field change, so that may be what is happening. It's assumed that if you explicitly write any value to the field, that you are wanting to override the timed change. The timer driver is probably a bit better for that kind of thing. The timed field change is more for things like turning on a light for five minutes and whatnot.
Dean Roddey
Explorans limites defectum
Reply
#10
Dean,

Does the event server have access to global variables? Can i test for values in the action area of the event server?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Status of Scheduled and Triggered Events gReatAutomation 4 1,494 04-21-2020, 12:58 PM
Last Post: gReatAutomation
  event and subsequent countdown timer question dogman 9 5,059 05-03-2018, 06:36 PM
Last Post: dogman
  your sched/triggered/tasker/IFTTT events IVB 17 9,275 01-18-2018, 07:41 AM
Last Post: RichardU
  Idea for a different kind of event processing mechanism Dean Roddey 0 1,597 03-20-2017, 09:29 AM
Last Post: Dean Roddey
  Best Way to Handle Wait Times within a Triggered Event kblagron 9 4,880 06-25-2016, 06:03 PM
Last Post: Dean Roddey
  Thingspeak event monitor potts.mike 5 3,569 05-09-2015, 06:11 PM
Last Post: wuench
  Overlay in an Overlay triggered by Widget Deane Johnson 4 3,778 11-09-2014, 10:29 AM
Last Post: Deane Johnson
  event scheduler ellisr63 8 4,118 04-11-2014, 02:43 PM
Last Post: ellisr63
  CQC & Event Ghost Read current state jdmevo123 3 2,802 12-05-2013, 06:49 PM
Last Post: wuench
  EmailURLImg in Triggered Events TurboSam 6 3,606 11-23-2013, 01:50 PM
Last Post: Dean Roddey

Forum Jump:


Users browsing this thread: 1 Guest(s)