Homey Community Forum

Running action every X hours

Can someone help me out here - I feel there is an easy way to do this but I can’t see it

I want a flow which turns on a device (my underfloor heating) for 1 hours, then off for 2 hours - I’ve worked out that this is the most energy efficient way to power it by using insights

But, I can’t see an easy way to do this in a flow - I tried the below, but you can only have 3 OR statements
There doesnt seem to be a logic tag associated with time, so I can’t do a calculation against it, (and there doesnt even seem to be a time is exactly x for that matter either)

Am I missing something obvious?

This flow will definitely not work, as it cannot be simultaneously between 23:55 - 00:05, 02:55 - 03:05 and so on. Maybe you just want to show what times you need with this flow, I don’t know.

Why are there so many users who always want to realize everything in just one flow? Why don’t create multiple flows?
For example, for my “You have mail” automation, I created 15 flows. This is not a problem for Homey.
And if the flows are well structured and named, then it’s also no problem for the user to keep track of them.

For your use case you need 3 flows to turn on the heater, and 3 flows to turn off the heater. So that’s not many flows.
I am not familiar with Homey Script, but it should be possible to realize it with one flow, maximum 2 flows.

Yeah I know it won’t work. I wanted each of those in OR (as stated), but it maxes out at 3 OR

It should be very simple to do in one flow - the three OR is arbitrary restriction

There is no way to do it with three flows without some shared logic unless I’m mistaken… And as stated, there appears to be no way to get logic from the time variable

I could do every 3 hours, but then how does the off flow know that it’s not one of the on times?

This is something you have to discuss with Athom.

Turning underfloor heating on

Flow 1 of 3
If…
– Every hour
And…
– The time is 00:00
Or
– The time is 03:00
Or
– The time is 06:00
Then…
– Turn on

Flow 2 of 3
If…
– Every hour
And…
– The time is 09:00
Or
– The time is 12:00
Or
– The time is 15:00
Then…
– Turn on

Flow 3 of 3
If…
– Every hour
And…
– The time is 18:00
Or
– The time is 21:00
Then…
– Turn on

Turning underfloor heating off

Flow 1 of 3
If…
– Every hour
And…
– The time is 01:00
Or
– The time is 04:00
Or
– The time is 07:00
Then…
– Turn off

Flow 2 of 3
If…
– Every hour
And…
– The time is 10:00
Or
– The time is 13:00
Or
– The time is 16:00
Then…
– Turn off

Flow 3 of 3
If…
– Every hour
And…
– The time is 19:00
Or
– The time is 22:00
Then…
– Turn off

If I’d written code like that in university I’d have failed
But yeah, it’ll do the job I guess…

Why not:
Every 3 hours
Switch ON
Switch OFF with a delay of 1 hour

4 Likes

Legend. That’s a great idea!

1 Like

That’s what I thought too (although there might be an issue with an OFF not being executed if Homey reboots between the start of the flow and the end of the delay).

1 Like

Turns out if you run the flow manually at any point it messes things up

These are very unclear information!

Change the flow to “Every 3 minutes” and a delay of 1 minute and use a lamp to switch on and off (instead of the underfloor heating). Then you can check relatively quickly whether the flow works or not.

I would do I like this using the “Countdown app”

First make a numeric variable “Underfloor_Steps”
Second make a timer using the countdown app “Underfloor Heating”

THEN
Copy these 2 flows and start it using the test flow function

1 Like

That could also be boiled down to a single flow I think by adding an else clause. And to shrink it further, maybe skip the variable and use the state of the pump in the “And…” statement.

There is a way however.

  • Invert the condition cards
  • Use ‘And’ instead of ‘Or’
  • The desired action cards should be placed at “THEN ELSE”
  • At the “THEN” section, a dummy card has to be inserted, like FlowComments / Timeline / Toggle an unused Bool variable etc.

2 Likes