I have a flow designed to change LIFX Scenes based upon the date of the year (ie Halloween, Thanksgiving etc…). The http node works perfectly so long as I do not insert the function and switch nodes ahead of it.
Does anyone have any ideas as to why the http node will not work?
[{"id":"c8971be928290274","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"44234bbabc754f56","type":"inject","z":"c8971be928290274","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":80,"wires":[["672de771d448cd2e"]]},{"id":"672de771d448cd2e","type":"function","z":"c8971be928290274","name":"","func":"let d = new Date();\nif (d.getMonth() == 9) {\n\tmsg.payload = \"Halloween\";\n\treturn msg;\n}\nif (d.getMonth() == 10 && d.getDate() < 28) {\n\tmsg.payload = \"Thanksgiving\";\n\treturn msg;\n}\nif ((d.getMonth() == 11 && d.getDate() < 27) || (d.getMonth() == 10 && d.getDate() >= 28)) {\n\tmsg.payload = \"Christmas\";\n\treturn msg;\n}\nif ((d.getMonth() == 11 && d.getDate() > 26) || (d.getMonth() == 0 && d.getDate() < 2)) {\n msg.payload = \"NewYear\";\n return msg;\n}\nif ((d.getMonth() == 1) && (d.getDate() > 1 && d.getDate() < 15)) {\n msg.payload = \"Valentine\";\n return msg;\n}\n\nif ((d.getMonth() == 2) && (d.getDate() > 25 && d.getMonth() == 1 && d.getDate() >= 28)) {\n msg.payload = \"StPatricks\";\n return msg;\n}\n\nif ((d.getMonth() == 6) && (d.getDate() > 25 && d.getMonth() == 5 && d.getDate() >= 28)) {\n msg.payload = \"July4\";\n return msg;\n}\n\nmsg.payload = \"Nothing\";\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":180,"y":300,"wires":[["2c82c634ea7214c3"]]},{"id":"2c82c634ea7214c3","type":"switch","z":"c8971be928290274","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Halloween","vt":"str"},{"t":"eq","v":"Thanksgiving","vt":"str"},{"t":"eq","v":"NewYear","vt":"str"},{"t":"eq","v":"Valentine","vt":"str"},{"t":"eq","v":"StPatrick","vt":"str"},{"t":"eq","v":"July4","vt":"str"},{"t":"eq","v":"Christmas","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":8,"x":350,"y":320,"wires":[["e566972a913733af"],["01b3f58c67361f8c"],["1afd9a2205e0ba1c"],["778144ac1cfe16ca"],["4f7d27d1b803eed8"],["32065045da61cbe7"],["55a29d9553080bc4"],["cd54bf9f71890350"]]},{"id":"4f7d27d1b803eed8","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:51f316de-239c-4cbb-bd73-4a489743a758/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":320,"wires":[[]]},{"id":"1afd9a2205e0ba1c","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:5355b93f-a7aa-4c2b-a730-60d5f361c1ff/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":240,"wires":[[]]},{"id":"e566972a913733af","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:62a5d2e7-cdbb-4f61-b236-7a178c50e94a/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":160,"wires":[[]]},{"id":"778144ac1cfe16ca","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:abdf85a7-9968-4674-bb88-c2c350600b99/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":280,"wires":[[]]},{"id":"32065045da61cbe7","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:b0b618e9-0ce6-4095-a75d-21aa2370cf6c/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":360,"wires":[[]]},{"id":"01b3f58c67361f8c","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:e3aafe60-c8eb-45ce-9e84-159856f9ff2c/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":200,"wires":[[]]},{"id":"55a29d9553080bc4","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:b7862e1d-62e1-492c-9cba-95996ffe60f2/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":400,"wires":[[]]},{"id":"cd54bf9f71890350","type":"http request","z":"c8971be928290274","name":"","method":"PUT","ret":"txt","paytoqs":"ignore","url":"https://api.lifx.com/v1/scenes/scene_id:7f9e0ce0-1f7a-4527-86a6-2c20a0e86bea/activate","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"authorization","valueType":"other","valueValue":"Bearer c07735a5a7d3335050b0db8d9fe5b628f3ee9d27054ac24f4cd14def7606a365"}],"x":610,"y":440,"wires":[[]]}]