Can’t get this to run correctly


#11

@Eric182’s piston above (line 22-28) is just about the same direction I was going to take.

You should be able to insert your Echo commands in place of his “Music Player 3” block.

One small note:
The line “Set variable {lastDay} = {$day}” should be the very last command… (After all the Echo commands have been sent) This is because you are using a Wait, so you do not want to change that variable until all the commands have run successfully. (or you can set TCP to Never, as he did)


#12

Just for my learning purposes. Would you not want your motion sensor condition to be “changes to active” instead of “is active”?


#13

That was going to be my suggestion, but I did not want to critique @Eric182’s contribution.

If the trigger is “changes to active”, and you happen to be in the kitchen when the time becomes true, the commands will not be sent until you leave the kitchen, wait a few, and then return. Alternatively, if the trigger is “IS active”, then it should fire when the time enters the window, as long as someone is in the kitchen.

Personally, I would use “changes to active”, but I would make sure the time window started before I ever expect to be in the kitchen.


#14

Yes, trigger, not condition. I’m still struggling with those. :slight_smile:


#15

My question is same the OP : " How do I get this to run only once per day in the morning? ". Only once, or it will repeat every times the motion "changes to active " ? Thanks.


#16

The easiest way to remember the difference is:

  • a trigger is a precise instant in time (IE: changes to active)
  • a condition is a vague window of time (IE: IS active)

#17

For play news, what URL are you using?


#18

The Screenshot_2019-02-19%20webCoRE%20Community%20Forum should limit execution to only once a day.


#19

Here is a breakdown of this logic in it’s simplest form, showing both circumstances:

This logic can be applied in many different ways


#20

Thanks, I set up : motion change to active then Echo speak : Bla Bla Bla . I need the Echo only speak when : time is between X and Y, motion change to active , Echo speak, then 10 or 15 minutes later, if motion change to active , Echo speak , no more than 3 times per hour. How I use {lastRanOn} ? Thanks.


#21

Can you please post your current piston in a new thread so we don’t hijack this thread?


#22

Thanks @WCmore.


#23


NPR. Five minute headlines


#24

Still struggling folks. Is there a tutorial on what and how these functions are implemented. I could easily copy the pistons and adapt them but I’d rather know why and how they work. Like for example, I don’t even know how to and where to find the settings for they variables posted above. I’m particularly struggling on the ‘only run once per day’ settings.

Thanks all.


#25

There is so much that can be learned in each one of these…
(much more than can be summarized in any Wiki)


All that being said, the very best source of information is right here among your peers. Whenever there is a new discovery or implementation, it surfaces here…
(sometimes taking months before it is added to the Wiki)


For what it’s worth, I usually do not mention variables to someone who just installed webCoRE. It usually takes awhile before the tough questions get asked, and by that point, they already have a grasp on the core concepts. You are doing quite well, considering you are on day 2.

I generally recommend read, read, and read some more…

Then start with simple ideas for pistons, and work your way towards more advanced pistons… Asking questions along the way. It can also be helpful to copy other’s pistons, and then edit it to make it your own.

If you are anything like me, you will likely learn something new with every discussion you read here, and every piston you create…

Even now, I am constantly amazed at what is possible…


#26

I do not understand what you are asking specifically. (variables do not have settings)

Can you rephrase please?


#27

yeah sorry, i didnt phrase that correctly.
What i mean is i not sure what to select from all the drop down boxes when im wanting to set up the piston to run only once daily. Ive looked at the options and i cant see the , integer lastrun option so i can make this piston only run once per day.

Thanks


#28

Actually, this can be done directly from the Alexa app


#29

For a variable to be visible from a drop down menu when coding, it must first be created up top in the define section. (as shown here) That is also the area where you specify if the data is going to be an integer/decimal/string etc. In your case, you want the {lastRanOn} variable to be an integer, since it is only counting whole numbers.

Normally, I define the initial value up top like this:

temp

What this means is the variable will only change when the code below tells it to.


#30

Thanks man.