# New to Node-Red and HA. Requesting Feedback on a flow

**URL:** https://discourse.nodered.org/t/new-to-node-red-and-ha-requesting-feedback-on-a-flow/46181
**Category:** General
**Created:** [25 May 2021 00:54 UTC](https://discourse.nodered.org/t/new-to-node-red-and-ha-requesting-feedback-on-a-flow/46181 "2021-05-25T00:54:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ewalker101](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ewalker101/32/41528_2.png) [@ewalker101](https://discourse.nodered.org/u/ewalker101)
#### Post date: [25 May 2021 00:54 UTC](https://discourse.nodered.org/t/new-to-node-red-and-ha-requesting-feedback-on-a-flow/46181/1 "2021-05-25T00:54:15Z")

</div>

Hello everyone, I am new to hass, Node-Red and home automation. I have created a simple flow that turns on a nightlight in the evening and turns it off at sunrise. I was hoping that some of you would be able to look at the flow and suggest improvements. I was able to cobble this flow together and it works but I dont think that it is the most efficient way to complete the task. Any assistance would be appreciated.

```auto
[{"id":"ae573d8a.943b18","type":"tab","label":"2nd Floor Bathroom Nightlight","disabled":false,"info":""},{"id":"cf2b90b9.1aa1c8","type":"poll-state","z":"ae573d8a.943b18","name":"","server":"7a554823.e94b48","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"5","updateIntervalUnits":"minutes","outputinitially":false,"outputonchanged":false,"entity_id":"sun.sun","state_type":"str","halt_if":"below_horizon","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":170,"y":314,"wires":[["d87320ac.3d8938"],["d830917c.c0c7a"]]},{"id":"7cc38f42.6cb29","type":"api-call-service","z":"ae573d8a.943b18","name":"","server":"7a554823.e94b48","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.0003804224a16012def6","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":650,"y":240,"wires":[[]]},{"id":"d87320ac.3d8938","type":"timerswitch","z":"ae573d8a.943b18","name":"","ontopic":"","offtopic":"","onpayload":"","offpayload":"","disabled":false,"schedules":[{"on_h":"21","on_m":"45","on_s":"00","off_h":"07","off_m":"00","off_s":"00","valid":true}],"x":420,"y":240,"wires":[["7cc38f42.6cb29"]]},{"id":"d830917c.c0c7a","type":"api-call-service","z":"ae573d8a.943b18","name":"","server":"7a554823.e94b48","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.0003804224a16012def6","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":650,"y":320,"wires":[[]]},{"id":"7a554823.e94b48","type":"server","name":"Home Assistant","addon":true}]

```

---

<div class="post-metadata">

### Author: ![hklages](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hklages/32/23899_2.png) [@hklages](https://discourse.nodered.org/u/hklages)
#### Post date: [25 May 2021 18:00 UTC](https://discourse.nodered.org/t/new-to-node-red-and-ha-requesting-feedback-on-a-flow/46181/2 "2021-05-25T18:00:18Z")

</div>

Only users having installed `node-red-contrib-home-assistant-websocket` are able to understand your flow. So I suggest that you ask these kind of questions in the Home Assistant forum, topic integration Node-RED.

a) As the lights are simple Home Assistant entities and sunset/sunrise are Home Assistant build in events I don't see any need to use Node-RED for this case. You can use standard Home Assistant capabilies. There are several examples as Blueprints, ...

b) If you absolute want to use Node-RED for this I suggest to replace the polling for sunset/sundawn with a listening to event sunset/sunrise.

---

<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: [24 July 2021 18:00 UTC](https://discourse.nodered.org/t/new-to-node-red-and-ha-requesting-feedback-on-a-flow/46181/3 "2021-07-24T18:00:58Z")

</div>

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