What is the best logic for this flow?

This category is created to show, and explain the working of specific Flows in homey.

I have added the lamps to my TV on flow. But was concerned the 2 min delay in the lamp flow would affect the TV flow. Not sure which (if any) are correct?

Please let me know your thoughts?

The idea with the lamps is to turn them on at the same time that the television turns on and they will turn off after two minutes unless the TV doesn’t turn on. I have used the light strip behind the TV to determine whether the TV is turned on or not as it is a Phillips Hue lightstrip tied to the TV.

Many Thanks

A dim level can’t be negative, so the flow will never continue after ‘dim level is less then 0’. So in the first flow only Angela’s lamp will turn on. Better use ‘dimlevel is exactly 0’.

I think you want both conditions (dimlevel is 0 and time between 23:30 and 3:00) to be true to continue. So you have to add an ALL-card.

In the second and third flow the lamp will dim to 20% and turn off after 2 minutes after every motion, even if you are watching TV. I think you want them to stay on while watching TV.

The flow above tackles most of your wishes?

The flow will turn on the TV only once after 23:30 because the dimlevel is set to 0 at 23:30. When the TV is turned on the lamps are also dimmed to 20%.So the dimlevel is no longer 0. So the conditions are no longer both true.

After 2 minutes I added an extra condition: TV must be off.

Next thing to decide: how do you want the lamps to react on motion when you turn off the TV and go to sleep.

Awesome, thank you :folded_hands:t3:

I am starting to understand the logic better.

@Wim_Post Thanks for your Flow description. I decided that when the TV turns on it uses a Hue light strip behind the TV and behind the headboard, so there is plenty of light without turning on the lamps, but have added a failsafe to turn on the lamps if the TV doesn’t turn on, after a 5 second delay, although maybe 3 seconds would be more acceptable? measured by the TV light strip dim level. I believe this Flow is correct but would love your thoughts.

When I turn off the TV I use a button by my bedside which in Apple Home activates the virtual switch to start this Flow

In turn the final virtual switch action activates a good night scene and HomePod playing sleep sounds.

Then I have the lamps set to turn on by motion between 1am-8am at a very low level (2 motion sensors for each side of the bed and corresponding lamp.

I have been creating more flows this evening to replace a number of my Apple Home Automations by laying multiple automations on to a single canvas. Everything has tested positively, with a few tweaks!

The single most frustrating card has been the Device On for an AND card but not an Off option. Discovering I can just invert the card to an Off position has made me happy :blush:

I shall continue with more conversions tomorrow.

1 Like

Yes, some options are ‘hidden’ in the context menu (right click). Inverting a flow card is perhaps the most common one. Not only for the device state (on/off), but also e.g. for some of the logic cards.

Another example of such a hidden option is that for dimmable lights, in most cases, you can use the ‘duration’ option to indicate within how many seconds/minutes the dim level is to be reached. This way you can smoothly transition into the desired dim level, instead of an instant change.

That’s awesome, I’ll have a play with that later today. Thanks :folded_hands:t3: