Holiday/Monthly Lights

I’m trying to figure out a way to change my outside lights based on the month.

Idea: two outdoor lights each different colors
turn on at sunset and off at sunrise
changes automatically at the 1st of each month
once set up wont change from year to year . ie jan 2022 will be the same as jan 2023
condensed

Below is what i’m trying to get to work. Using the cronoplus to set up each month.

Problem it doesnt work and have no clue where to even start debugging.

I know the lights are marked sept but they are in the august output. Weird thing is my lights still turn on and off at sunset/sunrise, however they are the wrong colors. This was a working HA automation that I personally would change month to month. Im converting everything to NR and would like something 100% automatic. I say weird because I deleted the HA automation so it should either work or not. Instead its workin with the wrong colors. When I inject directly into the lights it does the correct colors but when left alone its the wrong colors.

[{“id”:“93efbcef4c58d3f1”,“type”:“tab”,“label”:“Outside”,“disabled”:false,“info”:"",“env”:[]},{“id”:“9f8f28a28d5644c9”,“type”:“cronplus”,“z”:“93efbcef4c58d3f1”,“name”:“Month Calculator”,“outputField”:“payload”,“timeZone”:"",“persistDynamic”:false,“commandResponseMsgOutput”:“fanOut”,“outputs”:15,“options”:[{“name”:“Janurary”,“topic”:“topic1”,“payloadType”:“default”,“payload”:"",“expressionType”:“cron”,“expression”:“0 0 12 1 1 ? *”,“location”:"",“offset”:“0”,“solarType”:“all”,“solarEvents”:“sunrise,sunset”},{“name”:“Febuary”,“topic”:“topic2”,“payloadType”:“default”,“payload”:"",“expressionType”:“cron”,“expression”:“0 0 12 1 2 ? *”,“location”:"",“offset”:“0”,“solarType”:“all”,“solarEvents”:“sunrise,sunset”},{“name”:“March”,“topic”:“topic3”,“payloadType”:“default”,“payload”:"",“expressionType”:“cron”,“expression”:“0 0 12 1 3 ? *”,“location”:"",“offset”:“0”,“solarType”:“all”,“solarEvents”:“sunrise,sunset”},{“name”:“April”,“topic”:“topic4”,“payloadType”:“default”,“payload”:"",“expressionType”:“cron”,“expression”:“0 0 12 1 4 ? *”,“location”:"",“offset”:“0”,“solarType”:“all”,“solarEvents”:“sunrise,sunset”},{“name”:“May”,“topic”:“topic5”,“payloadType”:“default”,“payload”:"",“expressionType”:“cron”,“expression”:“0 0 12 1 5 ? *”,“location”:"",“offset”:“0”,“solarType”:“all”,“solarEvents”:“sunrise,sunset”},{“name”:“June”,“topic”:“topic6”,“payloadType”:“default”,“payload”:"",“expressionType”:“cron”,“expression”:“0 0 12 1 6 ? *”,“location”:"",“offset”:“0”,“solarType”:“all”,“solarEvents”:“sunrise,sunset”},{“name”:“July”,“topic”:“topic7”,“payloadType”:“default”,“payload”:"",“expressionType”:“cron”,“expression”:“0 0 12 1 7 ? *”,“location”:"",“offset”:“0”,“solarType”:“all”,“solarEvents”:“sunrise,sunset”},{“name”:“August”,“topic”:“topic8”,“payloadType”:“default”,“payload”:"",“expressionType”:“cron”,“expression”:“0 0 12 1 8 ? *”,“location”:"",“offset”:“0”,“solarType”:“all”,“solarEvents”:“sunrise,sunset”},{“name”:“September”,“topic”:“topic9”,“payloadType”:“default”,“payload”:"",“expressionType”:“cron”,“expression”:“0 0 12 1 9 ? *”,“location”:"",“offset”:“0”,“solarType”:“all”,“solarEvents”:“sunrise,sunset”},{“name”:“October”,“topic”:“topic10”,“payloadType”:“default”,“payload”:"",“expressionType”:“cron”,“expression”:“0 0 12 1 10 ? *”,“location”:"",“offset”:“0”,“solarType”:“all”,“solarEvents”:“sunrise,sunset”},{“name”:“November”,“topic”:“topic11”,“payloadType”:“default”,“payload”:"",“expressionType”:“cron”,“expression”:“0 0 12 1 11 ? *”,“location”:"",“offset”:“0”,“solarType”:“all”,“solarEvents”:“sunrise,sunset”},{“name”:“December”,“topic”:“topic12”,“payloadType”:“default”,“payload”:"",“expressionType”:“cron”,“expression”:“0 0 12 1 12 ? “,“location”:”",“offset”:“0”,“solarType”:“all”,“solarEvents”:“sunrise,sunset”},{“name”:“schedule13”,“topic”:“topic13”,“payloadType”:“default”,“payload”:"",“expressionType”:“cron”,“expression”:" * * * * *”,“location”:"",“offset”:“0”,“solarType”:“all”,“solarEvents”:“sunrise,sunset”}],“x”:310,“y”:400,“wires”:[[],[],[],[],[],[],[],[“9c517f1358cabe1d”,“24a55f0f2089e917”],[],[],[],[],[],[],[]]},{“id”:“ca02b1bd70fa7453”,“type”:“time-range-switch”,“z”:“93efbcef4c58d3f1”,“name”:"",“lat”:“41.458630”,“lon”:"-81.781418",“startTime”:“sunset”,“endTime”:“sunrise”,“startOffset”:0,“endOffset”:0,“x”:320,“y”:180,“wires”:[[“9f8f28a28d5644c9”],[“bae51afb9ac9fff9”]]},{“id”:“9c517f1358cabe1d”,“type”:“api-call-service”,“z”:“93efbcef4c58d3f1”,“name”:“Sept North Light”,“server”:“b75227ff.1e17a8”,“version”:5,“debugenabled”:false,“domain”:“light”,“service”:“turn_on”,“areaId”:[],“deviceId”:[],“entityId”:[“light.sengled_bulb_north_level_light_color_on_off”],“data”:"{“rgb_color”:[244,128,55]}",“dataType”:“jsonata”,“mergeContext”:"",“mustacheAltTags”:false,“outputProperties”:[],“queue”:“none”,“x”:580,“y”:140,“wires”:[[]]},{“id”:“24a55f0f2089e917”,“type”:“api-call-service”,“z”:“93efbcef4c58d3f1”,“name”:“Sept South Light”,“server”:“b75227ff.1e17a8”,“version”:5,“debugenabled”:false,“domain”:“light”,“service”:“turn_on”,“areaId”:[],“deviceId”:[],“entityId”:[“light.sengled_light_south_level_light_color_on_off”],“data”:"{“rgb_color”:[124,252,0]}",“dataType”:“jsonata”,“mergeContext”:"",“mustacheAltTags”:false,“outputProperties”:[],“queue”:“none”,“x”:590,“y”:180,“wires”:[[]]},{“id”:“bae51afb9ac9fff9”,“type”:“api-call-service”,“z”:“93efbcef4c58d3f1”,“name”:“Lights off”,“server”:“b75227ff.1e17a8”,“version”:5,“debugenabled”:false,“domain”:“light”,“service”:“turn_off”,“areaId”:[],“deviceId”:[],“entityId”:[“light.sengled_bulb_north_level_light_color_on_off”,“light.sengled_light_south_level_light_color_on_off”],“data”:"",“dataType”:“jsonata”,“mergeContext”:"",“mustacheAltTags”:false,“outputProperties”:[],“queue”:“none”,“x”:420,“y”:40,“wires”:[[]]},{“id”:“739d4c22993a16ea”,“type”:“server-state-changed”,“z”:“93efbcef4c58d3f1”,“name”:"",“server”:“b75227ff.1e17a8”,“version”:4,“exposeToHomeAssistant”:false,“haConfig”:[{“property”:“name”,“value”:""},{“property”:“icon”,“value”:""}],“entityidfilter”:“sun.sun”,“entityidfiltertype”:“exact”,“outputinitially”:false,“state_type”:“str”,“haltifstate”:“sunset”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“outputs”:2,“output_only_on_state_change”:true,“for”:“0”,“forType”:“num”,“forUnits”:“minutes”,“ignorePrevStateNull”:false,“ignorePrevStateUnknown”:false,“ignorePrevStateUnavailable”:false,“ignoreCurrentStateUnknown”:false,“ignoreCurrentStateUnavailable”:false,“outputProperties”:[{“property”:“payload”,“propertyType”:“msg”,“value”:"",“valueType”:“entityState”},{“property”:“data”,“propertyType”:“msg”,“value”:"",“valueType”:“eventData”},{“property”:“topic”,“propertyType”:“msg”,“value”:"",“valueType”:“triggerId”}],“x”:120,“y”:200,“wires”:[[“ca02b1bd70fa7453”],[“ca02b1bd70fa7453”]]},{“id”:“b75227ff.1e17a8”,“type”:“server”,“name”:“Home Assistant”,“addon”:true}]

I made a date and time node here: Date & Time Node Example
Use that to extract the month in either a number, a short abbreviation or the full name and then react to it in a switch node.

Date time formatter does this as well. You can set the output to month

[{"id":"652ad46d7f782637","type":"debug","z":"f80b6c338afd5483","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1250,"y":1020,"wires":[]},{"id":"edf631987b52d224","type":"moment","z":"f80b6c338afd5483","name":"","topic":"","input":"payload","inputType":"msg","inTz":"America/New_York","adjAmount":0,"adjType":"days","adjDir":"add","format":"MMMM","locale":"C","output":"payload","outputType":"msg","outTz":"America/New_York","x":1080,"y":1020,"wires":[["652ad46d7f782637"]]},{"id":"887fc17d78d9883b","type":"inject","z":"f80b6c338afd5483","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":900,"y":1020,"wires":[["edf631987b52d224"]]}]

use the within-time node from within time · rdmtc/node-red-contrib-sun-position Wiki · GitHub

This can be set to trigger on different months - so you could have 12 of them and just cascade

It has two outputs - the first output is if the condition is matched - the 2nd if it fails

So you have your test for January at the top and then cascade on failure to a 2nd node that tests for February etc

Craig