Controlling External Lights based on Solar Events

Just wanted to share my version of managing my external lights based on Solar events. I know there are some other posts on this topic, but I haven’t seen anyone using the sunEvents node which makes this very simple.

The flow handles both mornings and evenings.
In the morning, the lights are turned on at nautical dawn and off at the end of the sunrise.
At night they come on at the start of sunset and are turned off at a random time between 23:01 and 23:15.

[
   {
      "id":"32cb8da3.eeffc2",
      "type":"tab",
      "label":"Sun Driven Exterior Lights",
      "disabled":false,
      "info":""
   },
   {
      "id":"2d8758dc.922e08",
      "type":"inject",
      "z":"32cb8da3.eeffc2",
      "name":"Initial",
      "props":[
         {
            "p":"topic",
            "vt":"str"
         }
      ],
      "repeat":"",
      "crontab":"",
      "once":true,
      "onceDelay":0.1,
      "topic":"",
      "x":110,
      "y":140,
      "wires":[
         [
            "58c171f7.59b7a"
         ]
      ]
   },
   {
      "id":"ae9be1e3.2e7ab",
      "type":"sun events",
      "z":"32cb8da3.eeffc2",
      "testmode":false,
      "verbose":true,
      "topic":"SunEvent",
      "name":"SunEvent",
      "x":440,
      "y":180,
      "wires":[
         [
            "bc8949dd.24ef18"
         ]
      ]
   },
   {
      "id":"58c171f7.59b7a",
      "type":"change",
      "z":"32cb8da3.eeffc2",
      "name":"GPS coords",
      "rules":[
         {
            "t":"set",
            "p":"payload.latitude",
            "pt":"msg",
            "to":"36.376981",
            "tot":"num"
         },
         {
            "t":"set",
            "p":"payload.longitude",
            "pt":"msg",
            "to":"-94.281342",
            "tot":"num"
         }
      ],
      "action":"",
      "property":"",
      "from":"",
      "to":"",
      "reg":false,
      "x":270,
      "y":180,
      "wires":[
         [
            "ae9be1e3.2e7ab"
         ]
      ]
   },
   {
      "id":"c0aa61b0.223ae",
      "type":"inject",
      "z":"32cb8da3.eeffc2",
      "name":"Daily",
      "props":[
         {
            "p":"topic",
            "vt":"str"
         }
      ],
      "repeat":"",
      "crontab":"00 12 * * *",
      "once":false,
      "onceDelay":0.1,
      "topic":"",
      "x":110,
      "y":220,
      "wires":[
         [
            "58c171f7.59b7a"
         ]
      ]
   },
   {
      "id":"bc8949dd.24ef18",
      "type":"switch",
      "z":"32cb8da3.eeffc2",
      "name":"Event Type",
      "property":"sunevent.name",
      "propertyType":"msg",
      "rules":[
         {
            "t":"eq",
            "v":"sunsetStart",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"nauticalDawn",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"sunriseEnd",
            "vt":"str"
         },
         {
            "t":"else"
         }
      ],
      "checkall":"false",
      "repair":false,
      "outputs":4,
      "x":610,
      "y":180,
      "wires":[
         [
            "b36a9d44.30715"
         ],
         [
            "b36a9d44.30715"
         ],
         [
            "33628e3a.0f0ab2"
         ],
         [
            
         ]
      ]
   },
   {
      "id":"b36a9d44.30715",
      "type":"api-call-service",
      "z":"32cb8da3.eeffc2",
      "name":"Exterior Lights On",
      "server":"89e3a442.daf8c8",
      "version":1,
      "debugenabled":false,
      "service_domain":"light",
      "service":"turn_on",
      "entityId":"light.exterior_night",
      "data":"",
      "dataType":"jsonata",
      "mergecontext":"",
      "output_location":"",
      "output_location_type":"none",
      "mustacheAltTags":false,
      "x":830,
      "y":160,
      "wires":[
         [
            
         ]
      ]
   },
   {
      "id":"b4a90928.64a9d8",
      "type":"inject",
      "z":"32cb8da3.eeffc2",
      "name":"23:00 Daily",
      "props":[
         {
            "p":"payload"
         },
         {
            "p":"topic",
            "vt":"str"
         }
      ],
      "repeat":"",
      "crontab":"00 23 * * *",
      "once":false,
      "onceDelay":0.1,
      "topic":"",
      "payload":"",
      "payloadType":"date",
      "x":430,
      "y":260,
      "wires":[
         [
            "eb924eea.c65d3"
         ]
      ]
   },
   {
      "id":"33628e3a.0f0ab2",
      "type":"api-call-service",
      "z":"32cb8da3.eeffc2",
      "name":"Exterior Lights Off",
      "server":"89e3a442.daf8c8",
      "version":1,
      "debugenabled":false,
      "service_domain":"light",
      "service":"turn_off",
      "entityId":"light.exterior_night",
      "data":"",
      "dataType":"jsonata",
      "mergecontext":"",
      "output_location":"",
      "output_location_type":"none",
      "mustacheAltTags":false,
      "x":830,
      "y":220,
      "wires":[
         [
            
         ]
      ]
   },
   {
      "id":"eb924eea.c65d3",
      "type":"delay",
      "z":"32cb8da3.eeffc2",
      "name":"1 - 15 mins",
      "pauseType":"random",
      "timeout":"5",
      "timeoutUnits":"seconds",
      "rate":"1",
      "nbRateUnits":"1",
      "rateUnits":"second",
      "randomFirst":"1",
      "randomLast":"15",
      "randomUnits":"minutes",
      "drop":false,
      "x":610,
      "y":260,
      "wires":[
         [
            "33628e3a.0f0ab2"
         ]
      ]
   }
]