Homey Community Forum

Move from HC2 to Homey (Z-Wave)

The most important but also the most complex script is responsible for the automation of my shutters.
The script contains the following features:
Open shutters in the morning

  • x minutes after sunrise including random time between +/- 5-15 minutes open to 25 % (privacy protection), but not before e.g. 07:30 in the morning
  • then open to 100 % at random time between 15-30 minutes
  • open on weekends, holidays and public holidays at a fixed time, e.g. 8:30 a.m. (currently realized with the use of Google Calendar)

Roller shutters close in the evening

  • x minutes after sunset including random time between +/- 5-15 minutes close to 25% (privacy)
  • then close to 0 % and 9 % (different windows/doors) at random time between 15-30 minutes
  • if the patio door is still open, this roller shutter must not close until the door has been closed.

sun protection

  • in a definable time window (e.g. between 9:00 a.m. and 5:00 p.m.) and with an outside temperature of x °C and solar radiation of x lux, the roller shutters in the living room should close to 5%.
  • if the temperature falls below x °C and x Lux (check every 15 minutes), the roller shutters should open again, but no later than 17:00 p.m.
  • possibility to manually deactivate the automatic sun protection (the shutters should not open suddenly during a cinema afternoon)


  • the random times for opening and closing the roller shutters simulate a presence by manual opening/closing. It would be perfect if the privacy screen (currently open/closed to 25 %) could also be randomly varied with values, e.g. between 20-28 %.
  • weekends, holidays and public holidays are defined by a variable, which is set by a Lua script and the Google Calendar Api query. The Google Calendar script checks at 00:05 a.m. for an all-day event. If so, then the variable is set. The roller shutter script determines at 00:15 a.m. the daily current values for sunrise and sunset, as well as the Google calendar variable.

And no, I didn’t write this script by myself, I just made some adjustments and added the Google Calendar request.

On the basis of various posts, tutorials, apps which I have read and informed myself about, I think that the “roller shutter script” could be realized at least theoretically almost. But just theoretically, I can’t try anything for myself yet.

At a quick glance, I cant see anything there which cant be done using flows. But also keep in mind if there is also a scripting language which can be used (HomeyScript) if the flows start getting ‘crazy’

Though honestly, its super super rare to see HomeyScript even mentioned on these forums as the flows are actually very powerful.

All your sunset/sunrise is built into Homey, but if you need even more advance uses you can check out the sun events app

Weekends etc are all also built into Homey and if you want to use public holidays you can download this app here : https://apps.athom.com/app/no.almli.publicholidays

Hope this answers your questions.

Thank you very much for your answer @Jamie.
Most of my questions were answered. At least now I’m pretty sure that my shutter flow can be realized in such a way that I’ll be satisfied with the result.

I haven’t created a single flow yet because I don’t own a homey yet.
But what I have read so far and what works well with Fibaro is the use of variables in such complex scenarios. Would you agree with me?