# (Beginner) Sunset, timer, blinds

**URL:** <https://discourse.nodered.org/t/beginner-sunset-timer-blinds/57567>\
**Category:** General\
**Created:** [31 January 2022 19:48 UTC](https://discourse.nodered.org/t/beginner-sunset-timer-blinds/57567 "2022-01-31T19:48:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZzZzleepy](https://avatars.discourse-cdn.com/v4/letter/z/8dc957/32.png) [@ZzZzleepy](https://discourse.nodered.org/u/ZzZzleepy)\
**Post date:** [31 January 2022 19:48 UTC](https://discourse.nodered.org/t/beginner-sunset-timer-blinds/57567/1 "2022-01-31T19:48:56Z")

</div>

Hi  
I am totaly new to this and struggeling to find the right nodes for the job

I want to roll up my blinds at 06:20 in the morning and roll down my blinds at sunset, if sunset is before 21:00

I have the blinds working with a simple doorsensor for testing purpose.

Is there a kind person who can help a newbie out 😃

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [31 January 2022 20:26 UTC](https://discourse.nodered.org/t/beginner-sunset-timer-blinds/57567/2 "2022-01-31T20:26:23Z")

</div>

Welcome to the forum!

You could do this with just 2 nodes; `node-red-contrib-simple-gate` & `node-red-contrib-cron-plus`.

Create 4 schedules in Cron+ to;

1. Open the blinds at 06:20
2. Close the blinds at sunset
3. Close the simple-gate node at 21:00
4. Open the simple-gate node at 0600

If you check the readme for the simple-gate, you can set 3) & 4) above to the Control topic, so at 21:00 the gate will close and prevent further messages reaching the blinds until it's opened again at 06:00.

![cron](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/8/985e036dd9a3ce60dbb638fa205f6f5cebda259c.jpeg)

---

<div class="post-metadata">

**Author:** ![ZzZzleepy](https://avatars.discourse-cdn.com/v4/letter/z/8dc957/32.png) [@ZzZzleepy](https://discourse.nodered.org/u/ZzZzleepy)\
**Post date:** [31 January 2022 22:27 UTC](https://discourse.nodered.org/t/beginner-sunset-timer-blinds/57567/3 "2022-01-31T22:27:32Z")

</div>

I must admit i am almost as green as they come 😁

Took me a little while to figure out how the gate works  
i imported the Examples Basic Operation, i think i got the hang of the gate now... awesome node

But in Cron-plus i cant figure out how to trigger the control topic  
Can you enlighten me ?

And thanks alot for your help !

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [31 January 2022 22:39 UTC](https://discourse.nodered.org/t/beginner-sunset-timer-blinds/57567/4 "2022-01-31T22:39:11Z")

</div>

Ok, take a look at the example flow below.  
The 2 inject nodes open & close the gate to show you how it works.  
The Cron+ node will do exactly the same, but at 21:00 and 06:00.

```auto
[{"id":"b3bc4f31328ab115","type":"cronplus","z":"217df193.d774ce","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"Close gate","topic":"control","payloadType":"str","payload":"close","expressionType":"cron","expression":"0 0 21 * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"Open gate","topic":"control","payloadType":"str","payload":"open","expressionType":"cron","expression":"0 0 06 * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":725,"y":395,"wires":[["90da55b0a09e9d60"]]},{"id":"90da55b0a09e9d60","type":"gate","z":"217df193.d774ce","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"storeName":"RAM","x":895,"y":335,"wires":[[]]},{"id":"145f06f76daf5d73","type":"inject","z":"217df193.d774ce","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"open","payloadType":"str","x":715,"y":320,"wires":[["90da55b0a09e9d60"]]},{"id":"871419e5ee7e76b1","type":"inject","z":"217df193.d774ce","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"close","payloadType":"str","x":715,"y":355,"wires":[["90da55b0a09e9d60"]]}]

```

---

<div class="post-metadata">

**Author:** ![Hypnos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hypnos/32/7566_2.png) [@Hypnos](https://discourse.nodered.org/u/Hypnos)\
**Post date:** [31 January 2022 22:40 UTC](https://discourse.nodered.org/t/beginner-sunset-timer-blinds/57567/5 "2022-01-31T22:40:35Z")

</div>

Hallo,

the package `node-red-contrib-sun-position` has a lot of nodes for time control and also a blind-control node integrated.

For the blind control only one node is needed, where the rules could be defined. Over the import examples could be added.

---

<div class="post-metadata">

**Author:** ![ZzZzleepy](https://avatars.discourse-cdn.com/v4/letter/z/8dc957/32.png) [@ZzZzleepy](https://discourse.nodered.org/u/ZzZzleepy)\
**Post date:** [1 February 2022 21:24 UTC](https://discourse.nodered.org/t/beginner-sunset-timer-blinds/57567/6 "2022-02-01T21:24:54Z")

</div>

I got it working  
i skipped the gate but the cron+ did the job! 😃  
thanks alot for the help 😃

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [2 April 2022 21:25 UTC](https://discourse.nodered.org/t/beginner-sunset-timer-blinds/57567/7 "2022-04-02T21:25:04Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
