# Light-Scheduler Help

**URL:** <https://discourse.nodered.org/t/light-scheduler-help/29601>\
**Category:** General\
**Created:** [6 July 2020 13:38 UTC](https://discourse.nodered.org/t/light-scheduler-help/29601 "2020-07-06T13:38:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![KC-MO](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@KC-MO](https://discourse.nodered.org/u/KC-MO)\
**Post date:** [6 July 2020 13:38 UTC](https://discourse.nodered.org/t/light-scheduler-help/29601/1 "2020-07-06T13:38:28Z")

</div>

Hi, I am having some issues getting the node-red-contrib-light-scheduler to work. I believe I have everything set up correctly but the node does not seem to be switching states (it stays "OFF"). I have set the coordinates for my location (added the angle of the sun just for debugging to confirm it was below horizon). I can't figure out why it is not changing states. I've added some screenshots. Is there something I am just not getting?

 ![Settings](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd4a465cc2ce53488187065a78e946a9202a6aa8.png) ![Sequence](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/7/977ab8298b296a2ba5b33d4a9af906aa71e3d6b5.png)

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [6 July 2020 13:46 UTC](https://discourse.nodered.org/t/light-scheduler-help/29601/2 "2020-07-06T13:46:04Z")

</div>

Hi, welcome to the forum.  
have you set the topic in the MQTT out nodes?

---

<div class="post-metadata">

**Author:** ![KC-MO](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@KC-MO](https://discourse.nodered.org/u/KC-MO)\
**Post date:** [6 July 2020 14:06 UTC](https://discourse.nodered.org/t/light-scheduler-help/29601/3 "2020-07-06T14:06:45Z")

</div>

Hi, thanks for the response. I have set the topics in the MQTT nodes. As a matter of fact, because the light-scheduler node is in the OFF state it was triggering them off (when it was dark outside and they should have been ON).

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [6 July 2020 14:09 UTC](https://discourse.nodered.org/t/light-scheduler-help/29601/4 "2020-07-06T14:09:35Z")

</div>

Please post your flow here, it will be easier to diagnose any problems.

---

<div class="post-metadata">

**Author:** ![KC-MO](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@KC-MO](https://discourse.nodered.org/u/KC-MO)\
**Post date:** [6 July 2020 14:16 UTC](https://discourse.nodered.org/t/light-scheduler-help/29601/5 "2020-07-06T14:16:05Z")

</div>

I have a couple of debug nodes I was playing with in here as well that can be ignored.

```auto
[{"id":"73f5f767.dad938","type":"tab","label":"lightsOutside","disabled":true,"info":""},{"id":"9fb7e3ee.675c4","type":"inject","z":"73f5f767.dad938","name":"FrontPorchOn","topic":"shellies/shelly1-500291ED341B/relay/0/command","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":60,"wires":[["9c776a8.a0b3198"]]},{"id":"b2f858b9.7632d8","type":"debug","z":"73f5f767.dad938","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":590,"y":220,"wires":[]},{"id":"25f0287a.e69c58","type":"mqtt in","z":"73f5f767.dad938","name":"","topic":"shellies/shelly1-500291ED341B/relay/0/command","qos":"0","datatype":"auto","broker":"a7903fbb.08a58","x":230,"y":220,"wires":[["b2f858b9.7632d8"]]},{"id":"9c776a8.a0b3198","type":"mqtt out","z":"73f5f767.dad938","name":"","topic":"","qos":"","retain":"","broker":"a7903fbb.08a58","x":370,"y":60,"wires":[]},{"id":"e28dbea4.8b623","type":"inject","z":"73f5f767.dad938","name":"Garage Light","topic":"shellies/shelly1-500291ED341B/relay/0/command","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":140,"wires":[["aaf9d7c1.ba2298"]]},{"id":"aaf9d7c1.ba2298","type":"mqtt out","z":"73f5f767.dad938","name":"","topic":"","qos":"","retain":"","broker":"a7903fbb.08a58","x":310,"y":140,"wires":[]},{"id":"365bc7cb.7d12e8","type":"light-scheduler","z":"73f5f767.dad938","settings":"5b73ffcf.5c1d9","events":"[]","topic":"","name":"Turn Off Outside Lights At Night","onPayload":"on","onPayloadType":"str","offPayload":"off","offPayloadType":"str","onlyWhenDark":true,"scheduleRndMax":0,"sunElevationThreshold":"6","sunShowElevationInStatus":true,"outputfreq":"output.statechange.startup","x":150,"y":360,"wires":[["bd3d1ba9.a413b8","a3f2af9c.adc89","36e73104.bffa6e"]]},{"id":"bd3d1ba9.a413b8","type":"mqtt out","z":"73f5f767.dad938","name":"Patio Light","topic":"cmnd/patio/POWER","qos":"2","retain":"","broker":"a7903fbb.08a58","x":430,"y":300,"wires":[]},{"id":"a3f2af9c.adc89","type":"mqtt out","z":"73f5f767.dad938","name":"Front Porch Light","topic":"cmnd/frontporch/POWER","qos":"2","retain":"","broker":"a7903fbb.08a58","x":450,"y":360,"wires":[]},{"id":"36e73104.bffa6e","type":"mqtt out","z":"73f5f767.dad938","name":"Garage Light","topic":"cmnd/garage/POWER","qos":"2","retain":"","broker":"a7903fbb.08a58","x":430,"y":420,"wires":[]},{"id":"a7903fbb.08a58","type":"mqtt-broker","z":"","name":"","broker":"192.168.1.246","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"5b73ffcf.5c1d9","type":"light-scheduler-settings","z":"","name":"Kansas City","latitude":"39.0570111","longitude":"-94.57455277777777"}]

```

---

<div class="post-metadata">

**Author:** ![KC-MO](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@KC-MO](https://discourse.nodered.org/u/KC-MO)\
**Post date:** [7 July 2020 21:34 UTC](https://discourse.nodered.org/t/light-scheduler-help/29601/6 "2020-07-07T21:34:19Z")

</div>

Hi - does anyone have any suggestions of what I could try? Am I doing something wrong?

---

<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:** [5 September 2020 21:34 UTC](https://discourse.nodered.org/t/light-scheduler-help/29601/7 "2020-09-05T21:34:21Z")

</div>

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