Easily setting variable run time for morning routine piston


#1

I’ve been trying to figure out a solution for about 6 hours and I’m finally giving in and asking for help. I’ll try to be brief.

My use case is a morning routine that needs to start while I’m still asleep (so my heated floors can get up to temp before my feet touch them). The main complication is that my wake up time varies from 3am-9am, so I have to set a new time every night before bed.

My ideal solution would involve using Ask Alexa to run a macro and pass a (time) parameter into a piston which would update a variable that is used to fire the morning routine every 1 day at (variable) time. I’ve been able to follow the instructions here: http://thingsthataresmart.wiki/index.php?title=Using_Parameters_with_Ask_Alexa_and_webCoRE and can get a parameter passed (I see it come across in Smartthings Live Logging), but it doesn’t seem to actually fire the piston. I’m also not sure that Ask Alexa can pass a ‘time’ variable so I was using a very clunky “x minutes after midnight” formula just to see if I could get it working at all. Clearly I have not.

There are other conditions, triggers, and events I want as part of this routine, so it really will require webCore if I can get it working at all. Thanks for taking the time.

Your suggestions, better ideas, and ridicule are all welcome.

Cheers,
Kevin


#2

Hey @kkennedy22 - Did you by any chance get this figured out? I’m having EXACTLY the same issue but can’t seem to find it being discussed anywhere else.

Thanks!


#3

Just throwing something out here…perhaps a virtual dimmer named alarm clock? Set dimmer via Alexa to, say, 5. “Alexa, turn alarm clock to 5”. That would turn the virtual switch on and set to 5. The switch could then trigger the piston, and the piston could turn the switch back off along with running the routine.

Main difficulty would be trying to use a dimmer for something that isn’t an even hour. A dimmer can be 0-100. I guess it depends on how much math you want to do before bed. 45 could be 4:30. 50 for 5, 55 for 5:30, etc.

Just brainstorming…


#4

If you want to verbally set the morning routine time, @milhouse’s idea would work well.
(I think they are called “Simulated Dimmer Switches” when adding the new device in the IDE)

Once the Simulated Dimmer is connected to Alexa and webCoRE, you can set the number (from 1-100) using your voice. Then make a new piston in webCoRE that watches that dimmer’s levels. Whenever it sees a change, it sets a timer to initiate the morning routine.
(This method gives the most flexibility, but a voice command is required for it to change)


Alternatively, for a more automatic method, you could add a new command to the bottom of your normal “Good Night Routine”. Simply wait 6 hours and then start the morning routine.
(this is the easiest method, since you will not have to remember to set it every night)


EDIT :
If you do not want to use the Wait command, then either of the above two ideas could be slightly modified to work with global variables, as shown in the next post. :arrow_down:
(this is my preferred method, since you’ll have more control)


#5

I have also been successful using a global variable to pass the time such as this:
temp

Using this as my global variable:
temp


The one thing to watch for with this method is:
The piston does not automatically update when the global variable changes. To circumvent this, I have set mine to run a few times a day to get the current variable, and to update the time programmed.
(ideally, shortly before your earliest wake up, but it’s harmless to have it run a few times a day)

Stick something like this at the top of the piston:
temp
followed by:
temp

That first DO block was intentionally left blank.
It’s sole purpose is to grab the latest global, which will update the ‘Next scheduled’ time.


#6

I’ve been using tasker to pass my morning alarm time to a variable within Webcore and also initially faced the same problem you did with the timed piston not updating to the new variable time.
I got around this by pausing the “timed piston”, waiting 3 seconds and then un-pausing it again straight after the variable had been received. This seems to force the “timed piston” to update to the new variable and fire at the correct time.
image