Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How To: Modify Scheduled Events from the IV
#31
It's getting messed up in weekly events. Using the code posted here to affect various days 'on/off' state and to affect the time both mess up the 'start event at' so that when combined with the other confusingly named time setting, the event never runs.
Reply
#32
I'll look at it. I thought that some folks verified it was working OK after that, but I'll take another look at it.
Dean Roddey
Software Geek Extraordinaire
Reply
#33
For those following along at home, this appears to be fixed in 3.1.4. Thanks Dean!
Reply
#34
Does anyone still have a template with this or some other code to change scheduled events from within the IV? Thanks.
Reply
#35
Oh, IVB let his domain go. What a shame. He'll pipe up before too long.

Russ..
Reply
#36
pilotguy7ca Wrote:Does anyone still have a template with this or some other code to change scheduled events from within the IV? Thanks.
I'm pretty sure I still do. PM if you would like a copy of the template. Or I guess I could just post a copy of the code here (at work so can't do it now).
Reply
#37
which template? the one where you can press buttons right on the screen? I"ll export it, but I don't use that anymore, not sure how much still works in the latest CQC version.
------------------------------------
Devices I can't stand and wish I could replace: SmartThings, Hue, Concerto, VRUSB
My vlogs: https://www.youtube.com/c/IVBsHomeAutomation
Reply
#38
Yeah one with buttons on the screen. I tried to follow your first instructions but got a little lost in some of the details. Unless there is now an different/easier way of changing the schedules from with the IV? Thanks.
Reply
#39
Actually, there is. I vaguely recall now being able to directly interact with events somehow from the GUI.

Dean (or anyone else), can you educate us on what that new capability is? I'm sure its quite old by now...
------------------------------------
Devices I can't stand and wish I could replace: SmartThings, Hue, Concerto, VRUSB
My vlogs: https://www.youtube.com/c/IVBsHomeAutomation
Reply
#40
It's more or less the same now, but maybe just more capabilities are exposed. The action commands are exposed through the EventSrv target. These are defined in the Action Reference technical document, towards the end where it provides the list of action commands for the event server target.

You can get and set the info for scheduled (daily, weekly, monthly) or sun based events. So you would query the info for the one you want, use it to set up some static widgets for selecting new info. And have a button the user can press to say, OK, I've made the changes, send them back. Grab the info from the static widgets and build up the values to send back.

For scheduled events there are two values, the time of the day (or day plus time for monthly ones) to run it (which is in the form dd hh mm, i.e. day number, hour number, and minute number space separated.) Use zero for the day for daily and weekly since there is no day involved. They are all one based values.

And then there is the mask (which is only used for weekly and monthly ones.) For weeklies it is something like 10001001, which would run it on sunday, thursday and saturday. For monthlies it is 12 such 1s or 0s indicating the months. So, to set up a weekly to run at 11pm on monday and thursday, you would pass the two values:

0 11 00
0100100

And that would update the event appropriately. So, for something that would let you, say, adjust the days of the week to run an event, you could query the event, and pull out the 0s and 1s one at a time and set up a set of static check boxes, which would then show the current days that are enabled and disabled. The user clicks the ones he wants to turn days on and off. Then he pressed a Do It type button and you grab the current values of those check boxes and build back up that same string and pass it back in along with the original dd hh mm value you got when you queried it.

That sort of thing. Back in Vivek's original implementation days it might have required variable driver fields because of not having static type widgets at that time, I dunno.
Dean Roddey
Software Geek Extraordinaire
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)