Homey flow cards & logic outside lights

All, I have a Homey for years but not worked much with flows so a newby. I have 2 questions:

  1. Using standard flow in the “If” statement it appears only a subset of cards is available for several functions in apps and system. When going to “Then” there are many more cards. Example: new flow → If (date & time) there is no card stating “it is night”. So why can I not create: “If it is night” then … etc. “It is night” is available in the “and” statement. What am I missing here?

  2. I have made a very simple flow for a Shelly device:
    If Shelly is off
    And time not between 23:00-06:00 & it is night
    Then Shelly switch on

I was expecting it to switch back on at 6:00, after which another flow will switch it of during the day. However it does not switch back on at 6:00. Sunrise at my location today is 07:54, twilight 06:03.

If I run the flow by hand it switches on. What am I doing wrong? Is Homey no supposed to check flow conditions all the time and in this case if true switch on? Or is “night” going from twilight to twilight and 6:00 was just too late to switch back on? I should use the “Zonnestanden” app for more accuracy?

Flows get triggered by events, and “It is night” is not an event, it’s a state.

No, the flow says “WHEN Shelly IS TURNED off”. That’s an event.

You need to split your flow into several flows:

    • WHEN “nighttime starts”
    • AND Shelly is off
    • AND it’s before 23:00
    • THEN turn on Shelly
    • WHEN it’s 23:00
    • AND Shelly is on
    • THEN turn off Shelly
    • WHEN it’s 6:00
    • AND Shelly is off
    • AND it’s nighttime
    • THEN turn on Shelly

The “nighttime starts” card does’t exist on Homey, you can either use “WHEN the sun sets in 0 minutes” or (more accurate) use the Zonnestanden app.

It might also be possible to create a single flow if you let it run every (say) 10 minutes or so:

  • WHEN Every 10 minutes
  • AND Shelly is off
  • AND it’s nighttime
  • AND the time is NOT between 23:00 and 06:00
  • THEN turn on Shelly
2 Likes

Ah very helpful answer, thanks for that! Explains a lot, also why not all cards are available in the WHEN statement.

I like your last suggestion and I had already considered something like that, since my original flow appeared to work when I did run it manually. Will implement this change!