Time happens daily


#1

1) Give a description of the problem
Hi, i need a condition of a “Happens Daily between X and Y hours” but i cannot find it. I can only config for a certain exactly hour.

2) What is the expected behaviour?
I just want to make my Neato Robot to work once a day when im out, no matter what time is it.
I got the code correct and its working but i cannot insert the “once per day” condition.

Can anyone help me with this?

Thanks


#2

You can code it like…

variables
integer lastDay =;


If presence_device changes to away
and
$hour is between X and Y
and
$day is different from lastDay
  with your_device
     command here
     set variable lastDay = $day
  end with
end if

#3

Hi, Thanks! I don´t know how to funtion with variables, but im going to search for it! I got the process. Cheers!


#4

Post back if you get stuck. Someone would chime in.


#5

I think i got it right.

And if i want it to run in day 1, day 3, day 5, day 7,etc? Thanks


#6

It should be:
If $day is different from $lastDay
And If $Day is different than $LastDay + 1 right?

But i cannot set it…


#7

I think the first line should read

If presence1 and presence2 stays not present for 30 mins
and
$day is different than LastDay

#8

Yep, i just correct it thanks. And about the last question? Thanks


#9

You will have to enter the condition as an Expression… If $day is not an even number, then go do your thing.

Edit: You can also stack the Turn on, Send Push, and Set variable on top of each other


#10

Ok, that one i didn’t understand but i think i inserted it right.
The stack thing i didnt understand to :confused:

Thanks!


#11

This is what I meant by stacking…
image

Oh and to explain the one you just inserted in…

($day % 2) is checking if the $day value is divisible by 2, if false, then it’s an odd number day.


#13

Please stop using imgur.com

The forum has a built in image storage and this is what must be used. Nobody can guarantee that imgur links will always work into the future, and threads with missing images in years to come would be an annoyance for everyone.

Your posts in this thread were auto detected as spam and hidden due to the numerous imgur links, I’ve re-shown your posts on this occasion and will fix your posts to use locally stored images.


#14

Humm ok, just to simplify the code i see.
Like this?

Imagine i want to group all my lights to one, just to be more easy to set them on or off, what should i define? Thanks


#15

Personally I would use multiple pistons for grouping… Setup an ‘all on’ piston & all ‘all off’ piston, both without any triggers just actions that need to be run manually.

I would then execute ‘all on’ or ‘all off’ from a 3rd / 4th / nth ‘control’ piston.

This way, various different pistons can share the on / off function without needing repetition or having to change them all every time you add a new device.


#16

Hi @Robin,

My $previousEventDevice and $currentEventValue variable are always my home name, instead of the real device that trigger the piston. I want to get a push notification with the exaclty local, do you know why? Should i open another topic? Thanks!


#17

It depends where you position those variable references within the piston. Your example above does not use those variables therefore I am unable to comment.


#18

Hey @eibyer
I don’t mean to get off track here but just a quick question,
Is there a reason why you didn’t use a daily timer with your recommendation, or just a personal preference?


#19

He wanted it triggered by the departure of the presence device, not the time of day. If I remember correctly.