Sorry folks,
I know it is bad form to post non-working flows, and that is what I just did.
I have too many computers and I got the NEARLY WORKING one posted.
This one does work.
[{"id":"c80fa815.5af6c","type":"inject","z":"7c7f2d66.26e524","name":"","topic":"","payload":"","payloadType":"date","repeat":"3","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":290,"wires":[["f15f8bcd.7c043"]]},{"id":"f15f8bcd.7c043","type":"sunpos","z":"7c7f2d66.26e524","name":"","lon":"151.12","lat":"-33.51","start":"sunrise","startoffset":0,"end":"sunset","endoffset":0,"x":170,"y":330,"wires":[["5094f22d.d86584","76749b7e.a4e6dc","aaecda23.6d2a3"]]},{"id":"5094f22d.d86584","type":"change","z":"7c7f2d66.26e524","name":"Get Azimuth","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.azimuth","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"azimuth","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":330,"wires":[["385bf587.3b3742","cfaeae24.e073b"]]},{"id":"76749b7e.a4e6dc","type":"function","z":"7c7f2d66.26e524","name":"Sun in sky detector","func":"var foo = msg.payload.sunInSky;\n//node.warn(\"From the message \" + foo);\n\nif (foo === true)\n{\n //node.warn(\"Sun is in the sky\");\n node.status({fill:\"yellow\",shape:\"dot\",text:\"Sun in sky\"});\n msg = {payload: \"SUN\", topic:\"SUN\"};\n} else\nif (foo === false)\n{\n //node.warn(\"Sun is not in the sky\");\n node.status({fill:\"black\",shape:\"dot\",text:\"Sun not in sky\"});\n msg = {payload: \"SET\", topic:\"SUN\"};\n\n}\nreturn msg;","outputs":1,"noerr":0,"x":320,"y":380,"wires":[["385bf587.3b3742"]]},{"id":"aaecda23.6d2a3","type":"debug","z":"7c7f2d66.26e524","name":"Suntime","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":330,"y":290,"wires":[]},{"id":"385bf587.3b3742","type":"function","z":"7c7f2d66.26e524","name":"Check TOD (HS and HJ)","func":"var azimuth = flow.get('azimuth');\n//node.warn(\"Reference Azimuth is \" + azimuth);\n//node.warn(\"Incoming message is \" + msg.payload);\n\n// If it is sunrise open blinds to first stage.\n//if (msg.topic == \"SUN\")\nif (msg.topic !== \"azimuth\")\n{\n if (msg.payload == \"SUN\")\n {\n //node.warn(\"Sunrise detected\");\n \tmsg = {payload: \"Partly Open\", background: \"green\", font: \"black\"};\n \tnode.status({fill:\"green\",shape:\"dot\",text:\"Part Open\"});\n }\n \n // After a certain time (set by azimuth?) open blinds fully.\n //if (msg.payload < azimuth)\n if (msg.payload < azimuth)\n {\n \t//node.warn(\"Blinds fully open\");\n \tmsg = {payload: \"Open\", background: \"cyan\", font: \"black\"};\n \tnode.status({fill:\"blue\",shape:\"dot\",text:\"Open\"});\n }\n \n // Sunset has occured. Close blinds.\n //if (msg.topic == \"sunset\")\n if (msg.payload == \"SET\")\n {\n \t//\n \t//node.warn(\"Sunset detected\");\n \tmsg = {payload: \"Closed\",background: \"brown\", font: \"black\"};\n \tnode.status({fill:\"black\",shape:\"dot\",text:\"Closed\"});\n }\n return msg;\n}","outputs":1,"noerr":0,"x":620,"y":330,"wires":[["371d3b9c.af9614","ef23ba5.7923bc8"]]},{"id":"cfaeae24.e073b","type":"debug","z":"7c7f2d66.26e524","name":"Azimuth","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":490,"y":290,"wires":[]},{"id":"371d3b9c.af9614","type":"debug","z":"7c7f2d66.26e524","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":820,"y":330,"wires":[]},{"id":"ef23ba5.7923bc8","type":"ui_button","z":"7c7f2d66.26e524","name":"","group":"44285b5d.4ef84c","order":0,"width":0,"height":0,"passthru":false,"label":"{{msg.payload}}","color":"{{msg.font}}","bgcolor":"{{msg.background}}","icon":"","payload":"","payloadType":"str","topic":"","x":820,"y":370,"wires":[[]]},{"id":"44285b5d.4ef84c","type":"ui_group","z":"","name":"Sun Window Blind status","tab":"86714871.654fd8","order":1,"disp":true,"width":"6","collapse":false},{"id":"86714871.654fd8","type":"ui_tab","z":"","name":"Real World Control","icon":"dashboard","order":12}]