Switch only active during certain hours?

I’d like to enable a few items based on my being home, but NOT during the night.

I have Network Health binding in play for presence, and this works to turn items ON when I am home. I have another rule to kill everything (to save power), but as soon as presence is detected again, they turn back on.

I’d like Presence to ‘stop’ between the hours of midnight and say 8am, is this possible?

This is my rule for that kind of task:

rule "execute task only at certain time"
when
    Item ...
then
    if (now.getHourOfDay() >= 20 || now.getHourOfDay() <= 7  {
        //do stuff
}
2 Likes

Damn I’m forgetful - had these kind of rules before!

Thanks anyway, hopefully this might help someone else :slight_smile:

[quote=“Vini, post:3, topic:6030, full:true”]
Damn I’m forgetful [/quote]

Happens to me twice a day … :smile:

1 Like

I’d be happy if it was only twice! Thanks again!

If you want something more expansive (i.e. you have multiple times of day you want to track such as Day, Morning, Night, etc and multiple parts of your HA that care about what the time of day is) see this posting I made awhile back.

1 Like