# Move from HC2 to Homey (Z-Wave)

**URL:** <https://community.homey.app/t/move-from-hc2-to-homey-z-wave/20361>\
**Category:** Questions & Help\
**Created:** [November 7, 2019, 12:07pm UTC](https://community.homey.app/t/move-from-hc2-to-homey-z-wave/20361 "2019-11-07T12:07:02Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [November 9, 2019, 10:54am UTC](https://community.homey.app/t/move-from-hc2-to-homey-z-wave/20361/21 "2019-11-09T10:54:01Z")

</div>

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)

info

- 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.

---

<div class="post-metadata">

**Author:** ![Jamie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jamie/32/5274_2.png) [@Jamie](https://community.homey.app/u/Jamie)\
**Post date:** [November 12, 2019, 12:06am UTC](https://community.homey.app/t/move-from-hc2-to-homey-z-wave/20361/22 "2019-11-12T00:06:57Z")

</div>

> [@DirkG](#):
>
> 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

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](https://apps.athom.com/app/com.athom.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](https://apps.athom.com/app/com.cyclone-software.sunevents)

Weekends etc are all also built into Homey and if you want to use public holidays you can download this app here : [Public holidays App for Homey | Homey](https://apps.athom.com/app/no.almli.publicholidays)

Hope this answers your questions.

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [November 12, 2019, 8:17am UTC](https://community.homey.app/t/move-from-hc2-to-homey-z-wave/20361/23 "2019-11-12T08:17:43Z")

</div>

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?

[Previous page](https://community.homey.app/t/move-from-hc2-to-homey-z-wave/20361.md?page=1)
