Circadian/Adaptive Lighting NodeRed

[{"id":"09e8f85672b69e6e","type":"group","z":"76d268b99378117f","name":"Flux","style":{"label":true},"nodes":["c17fcdbf5c1601ca","87212c336e7a404e","221d625268d9d855","4ad115d03bf1bcc7","5075f9dec136e667","d48847fecb73ea12","28b68907a6c1c3bd","9a8c4b9aa821571a","ad73ab52dfc9464c","fc891a29a6a02cf6","65e26660fdb518f7","68dc351f6676efdf","f50f5dda01a96a73","bc170d8c185b8efb","b2c7396b076ed660","f35368edf8c8803b","9ef36a6101fdccfa","7e118ca8606a48b2","db4ac02069939580","9ea0ef28bf1e7c2d"],"x":74,"y":79,"w":1032,"h":242},{"id":"e2f79ea771014cac","type":"subflow","name":"Flux","info":"","category":"","in":[{"x":40,"y":60,"wires":[{"id":"d0d248ff9c3c9cdf"}]}],"out":[{"x":1440,"y":60,"wires":[{"id":"355aab77a1f28f1b","port":0}]}],"env":[],"meta":{},"color":"#DDAA99","inputLabels":["any message"],"outputLabels":["Info"],"icon":"node-red-contrib-sun-position/sun-white.png"},{"id":"0962fbe8cc6ef7bd","type":"switch","z":"e2f79ea771014cac","name":"Times","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"night","vt":"str"},{"t":"eq","v":"dusk","vt":"str"},{"t":"eq","v":"dawn","vt":"str"},{"t":"eq","v":"day","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":490,"y":180,"wires":[["9f45b66901c4535e"],["ec545b23a267c011","b8d8297010775689"],["1fd17b9f356de574","8f412a5f3bd9ab17"],["8ddd9d8ea3158cf4"]]},{"id":"1fd17b9f356de574","type":"spline-curve","z":"e2f79ea771014cac","name":"dawn brightness","output_key":"payload","input_key":"payload","points":[{"x":0,"y":0},{"x":0.071,"y":0.02},{"x":0.254,"y":0.297},{"x":0.654,"y":0.877},{"x":1,"y":1}],"x":720,"y":200,"wires":[["8dd7b7cc157b67c5"]]},{"id":"ec545b23a267c011","type":"spline-curve","z":"e2f79ea771014cac","name":"dusk brightness","output_key":"payload","input_key":"payload","points":[{"x":0,"y":1},{"x":0.25,"y":0.8},{"x":0.75,"y":0.1},{"x":1,"y":0}],"x":720,"y":120,"wires":[["8dd7b7cc157b67c5"]]},{"id":"8f412a5f3bd9ab17","type":"spline-curve","z":"e2f79ea771014cac","name":"dawn temperature","output_key":"payload","input_key":"payload","points":[{"x":0,"y":0},{"x":0.1,"y":0.01},{"x":0.25,"y":0.05},{"x":0.4,"y":0.2},{"x":0.573,"y":0.6},{"x":1,"y":1}],"x":730,"y":240,"wires":[["904e1e2afcc897c1"]]},{"id":"b8d8297010775689","type":"spline-curve","z":"e2f79ea771014cac","name":"dusk temperature","output_key":"payload","input_key":"payload","points":[{"x":0,"y":1},{"x":0.019,"y":0.918},{"x":0.162,"y":0.541},{"x":0.536,"y":0.121},{"x":1,"y":0}],"x":730,"y":160,"wires":[["904e1e2afcc897c1"]]},{"id":"6c8eec59a8ad5310","type":"function","z":"e2f79ea771014cac","name":"Times of Day","func":"var newmsg = { topic: \"flux\", current: {}, times: {} };\nnewmsg.sunpos = JSON.parse(JSON.stringify(msg)).payload;\n\n//https://github.com/rdmtc/node-red-contrib-sun-position/wiki/Base-Functions#sun-times\nevalPeriod('dawn', newmsg, \"goldenHourDawnEnd\", \"amateurDawn\");\nevalPeriod('day', newmsg, \"sunsetStart\"); //sunsetStart\nevalPeriod('dusk', newmsg, \"23:00\"); //astronomicalDusk\nevalPeriod('night', newmsg);        //amateurDawn\n\nreturn [newmsg,\n    {\n        topic: newmsg.current.name,\n        payload: newmsg.current.perc\n    }\n];\n\nfunction evalPeriod(nme, obj, end = null, start = null) {\n    let d;\n    let ret = {\n        name: nme,\n        hm_delta:   null,\n        hm_start:   null,\n        hm_end:     null,\n        ts_start:   null,\n        ts_end:     null\n    };\n    ret.start = start ? ( obj.sunpos.times[start] === undefined ? Human2Epoch(start) : obj.sunpos.times[start].ts ) : Object.values(obj.times).at(-1).end;\n    ret.end   = end   ? ( obj.sunpos.times[end]   === undefined ? Human2Epoch(end)   : obj.sunpos.times[end].ts   ) : Object.values(obj.times).at(0).start;\n    \n    // to cover range starting before midnight and ending after it.\n    if (ret.start > ret.end) {\n        if (ret.start < obj.sunpos.ts) {\n            d = new Date(ret.end);\n            d.setUTCDate(d.getUTCDate() + 1);\n            ret.end = d.getTime();\n        } \n        else if (ret.end > obj.sunpos.ts) {\n            d = new Date(ret.start);\n            d.setUTCDate(d.getUTCDate() - 1);\n            ret.start = d.getTime();\n        }\n    }\n\n\n    ret.delta = ret.end - ret.start;\n    ret.hm_delta = Epoch2Duration(ret.delta);\n    ret.hm_start = Epoch2Human(ret.start);\n    ret.hm_end = Epoch2Human(ret.end);\n    ret.ts_start = Epoch2iso(ret.start);\n    ret.ts_end = Epoch2iso(ret.end);\n\n    obj.times[nme] = ret;\n    if (ret.start <= obj.sunpos.ts && obj.sunpos.ts < ret.end) {\n        obj.current = ret;\n        obj.current.perc = (obj.sunpos.ts - ret.start) / ret.delta;\n    }\n}\nfunction Human2Epoch(human) {\n    let d1 = new Date();\n    let d2 = new Date(d1.toLocaleDateString() + \" \" + human);\n    return d2.getTime();\n}\nfunction Epoch2Human(epoch) {\n    var myDate = new Date(epoch);\n    return myDate.toLocaleString(\"fr-FR\");\n}\nfunction Epoch2iso(epoch) {\n    let d = new Date(epoch);\n    return d.toISOString();\n}\nfunction Epoch2Duration(epoch) {\n    let sec_num = Math.floor(epoch / 1000)\n    let hours = Math.floor(sec_num / 3600);\n    let minutes = Math.floor((sec_num - (hours * 3600)) / 60);\n    let seconds = sec_num - (hours * 3600) - (minutes * 60);\n\n    if (hours < 10) { hours = \"0\" + hours; }\n    if (minutes < 10) { minutes = \"0\" + minutes; }\n    if (seconds < 10) { seconds = \"0\" + seconds; }\n    return hours + ':' + minutes + ':' + seconds;\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":60,"wires":[["355aab77a1f28f1b"],["0962fbe8cc6ef7bd"]]},{"id":"8dd7b7cc157b67c5","type":"range","z":"e2f79ea771014cac","minin":"0","maxin":"1","minout":"15","maxout":"100","action":"clamp","round":true,"property":"payload","name":"","x":980,"y":160,"wires":[["3091475fc030904a"]]},{"id":"904e1e2afcc897c1","type":"range","z":"e2f79ea771014cac","minin":"0","maxin":"1","minout":"2700","maxout":"6500","action":"clamp","round":true,"property":"payload","name":"","x":990,"y":200,"wires":[["2a2604373b10dddb"]]},{"id":"d0d248ff9c3c9cdf","type":"sun-position","z":"e2f79ea771014cac","name":"","positionConfig":"72018d9177e1240e","rules":[],"onlyOnChange":"true","topic":"","outputs":1,"start":"","startType":"none","startOffset":0,"startOffsetType":"num","startOffsetMultiplier":60000,"end":"","endType":"none","endOffset":0,"endOffsetType":"num","endOffsetMultiplier":60000,"x":150,"y":60,"wires":[["6c8eec59a8ad5310"]]},{"id":"8ddd9d8ea3158cf4","type":"change","z":"e2f79ea771014cac","name":"Day","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":280,"wires":[["9db8ab7a3a8ee31c"]]},{"id":"9f45b66901c4535e","type":"change","z":"e2f79ea771014cac","name":"Night","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":80,"wires":[["e07d1484bd27c46d"]]},{"id":"2a2604373b10dddb","type":"change","z":"e2f79ea771014cac","name":"Move","rules":[{"t":"delete","p":"topic","pt":"msg"},{"t":"move","p":"payload","pt":"msg","to":"current.temperature","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":200,"wires":[["355aab77a1f28f1b"]]},{"id":"3091475fc030904a","type":"change","z":"e2f79ea771014cac","name":"Move","rules":[{"t":"delete","p":"topic","pt":"msg"},{"t":"move","p":"payload","pt":"msg","to":"current.brightness","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":160,"wires":[["355aab77a1f28f1b"]]},{"id":"355aab77a1f28f1b","type":"join","z":"e2f79ea771014cac","name":"","mode":"custom","build":"merged","property":"current","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"1","count":"12","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":1330,"y":60,"wires":[[]]},{"id":"9db8ab7a3a8ee31c","type":"junction","z":"e2f79ea771014cac","x":840,"y":280,"wires":[["904e1e2afcc897c1","8dd7b7cc157b67c5"]]},{"id":"e07d1484bd27c46d","type":"junction","z":"e2f79ea771014cac","x":840,"y":80,"wires":[["8dd7b7cc157b67c5","904e1e2afcc897c1"]]},{"id":"72018d9177e1240e","type":"position-config","name":"Home","isValide":"true","angleType":"deg","timeZoneOffset":"99","timeZoneDST":"0","stateTimeFormat":"3","stateDateFormat":"12","contextStore":""},{"id":"b62e4b55.b6e888","type":"subflow","name":"Sub User","info":"","category":"","in":[{"x":280,"y":140,"wires":[{"id":"3e282b34a50bc378"}]}],"out":[{"x":1080,"y":140,"wires":[{"id":"86c52c65d7f47c12","port":0}]}],"env":[],"meta":{},"color":"#DDAA99","icon":"font-awesome/fa-user-circle-o"},{"id":"833cfa89.049518","type":"json","z":"b62e4b55.b6e888","name":"","property":"payload","action":"obj","pretty":false,"x":670,"y":140,"wires":[["2bd011b4.4f829e"]]},{"id":"2bd011b4.4f829e","type":"function","z":"b62e4b55.b6e888","name":"","func":"var user_id = msg.data.context.user_id;\n//var user_id = msg.data.new_state.context.user_id;\n//var user_id = (msg.data.context !== undefined) ? msg.data.context.user_id : msg.data.new_state.context.user_id;\n//    user_id = msg.data.event.new_state.context.user_id;\nvar user_name = \"\";\nvar user_system = null;\n\nfor (var i = 0; i < msg.payload.data.users.length; i++) {\n    \n    var user = msg.payload.data.users[i];\n    \n    console.log(user.id);\n    \n    if (user.id == user_id) {\n        user_name = user.name;\n        user_system = user.system_generated;\n        break;\n    }\n}\nmsg.data.context.user_name = user_name == \"Hass.io\" ? \"Home Assistant\" : user_name;\nmsg.data.context.user_system = user_system;\n\ndelete msg.filename; \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":140,"wires":[["86c52c65d7f47c12"]]},{"id":"3e282b34a50bc378","type":"change","z":"b62e4b55.b6e888","name":"Move","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload","tot":"flow","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":140,"wires":[["d8869e406b4716da"]]},{"id":"86c52c65d7f47c12","type":"change","z":"b62e4b55.b6e888","name":"Move","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload","tot":"flow","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":140,"wires":[[]]},{"id":"d8869e406b4716da","type":"file in","z":"b62e4b55.b6e888","name":"auth","filename":"/data/ha/auth","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":530,"y":140,"wires":[["833cfa89.049518"]]},{"id":"c17fcdbf5c1601ca","type":"inject","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"","props":[],"repeat":"300","crontab":"","once":true,"onceDelay":"1","topic":"","x":170,"y":120,"wires":[["7e118ca8606a48b2"]]},{"id":"87212c336e7a404e","type":"api-call-service","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Light","server":"8093ca4.46eb138","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["{{payload.entity_id}}"],"data":"{\t   \"brightness_pct\": current.brightness,\t   \"kelvin\": current.temperature,\t   \"transition\": payload.timeSinceChangedMs>30000?15:1\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1010,"y":120,"wires":[[]]},{"id":"221d625268d9d855","type":"server-state-changed","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Lights","server":"8093ca4.46eb138","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":["light.bedroom","light.guest","light.hallway","light.office_lamp","light.office","light.closet"],"entityidfiltertype":"list","outputinitially":false,"state_type":"habool","haltifstate":"true","halt_if_type":"bool","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":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":220,"wires":[["7e118ca8606a48b2"],["ad73ab52dfc9464c"]]},{"id":"4ad115d03bf1bcc7","type":"ha-get-entities","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Auto","server":"8093ca4.46eb138","version":0,"rules":[{"property":"entity_id","logic":"includes","value":"light.office,light.office_lamp,light.bedroom,light.guest,light.hallway,light.closet","valueType":"str"},{"property":"state","logic":"is","value":"on","valueType":"str"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":490,"y":120,"wires":[["65e26660fdb518f7"]]},{"id":"5075f9dec136e667","type":"trigger-state","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Evt","server":"8093ca4.46eb138","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":["light.bedroom","light.guest","light.hallway","light.office_lamp","light.office"],"entityidfiltertype":"list","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"},{"targetType":"this_entity","targetValue":"","propertyType":"previous_state","propertyValue":"old_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"}],"inputs":0,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":false,"x":170,"y":280,"wires":[["f50f5dda01a96a73"],[]]},{"id":"d48847fecb73ea12","type":"subflow:b62e4b55.b6e888","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Who","env":[],"x":490,"y":280,"wires":[["db4ac02069939580"]]},{"id":"28b68907a6c1c3bd","type":"change","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Lkp","rules":[{"t":"change","p":"topic","pt":"msg","from":"light.","fromt":"str","to":"input_boolean.flux_","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":240,"wires":[["9a8c4b9aa821571a"]]},{"id":"9a8c4b9aa821571a","type":"api-call-service","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Status","server":"8093ca4.46eb138","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_off","areaId":[],"deviceId":[],"entityId":["{{topic}}"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1010,"y":240,"wires":[[]]},{"id":"ad73ab52dfc9464c","type":"change","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Reset","rules":[{"t":"set","p":"payload.service","pt":"msg","to":"turn_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":240,"wires":[["28b68907a6c1c3bd"]]},{"id":"fc891a29a6a02cf6","type":"api-current-state","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Enabled","server":"8093ca4.46eb138","version":3,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","entity_id":"{{id_flux}}","state_type":"habool","blockInputOverrides":true,"outputProperties":[],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":820,"y":120,"wires":[["87212c336e7a404e"],[]]},{"id":"65e26660fdb518f7","type":"change","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Lkp","rules":[{"t":"set","p":"id_flux","pt":"msg","to":"payload.entity_id","tot":"msg"},{"t":"change","p":"id_flux","pt":"msg","from":"light.","fromt":"re","to":"input_boolean.flux_","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":120,"wires":[["fc891a29a6a02cf6"]]},{"id":"68dc351f6676efdf","type":"server-state-changed","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Enabled","server":"8093ca4.46eb138","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.flux_","entityidfiltertype":"substring","outputinitially":false,"state_type":"habool","haltifstate":"true","halt_if_type":"bool","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":"topic","propertyType":"msg","value":"","valueType":"triggerId"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":160,"y":160,"wires":[["7e118ca8606a48b2"],[]]},{"id":"f50f5dda01a96a73","type":"switch","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Changed","property":"data.event","propertyType":"msg","rules":[{"t":"jsonata_exp","v":"data.event.old_state.attributes.brightness != data.event.new_state.attributes.brightness","vt":"jsonata"},{"t":"jsonata_exp","v":"data.event.old_state.attributes.color_temp != data.event.new_state.attributes.color_temp","vt":"jsonata"}],"checkall":"false","repair":false,"outputs":2,"x":340,"y":280,"wires":[["d48847fecb73ea12"],["d48847fecb73ea12"]],"outputLabels":["Brightness","Temperature"]},{"id":"bc170d8c185b8efb","type":"debug","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"flux","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1010,"y":180,"wires":[]},{"id":"b2c7396b076ed660","type":"ha-sensor","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Brightness","entityConfig":"96c46a37c4c1d229","version":0,"state":"current.brightness","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":650,"y":180,"wires":[["f35368edf8c8803b"]]},{"id":"f35368edf8c8803b","type":"ha-sensor","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Temperature","entityConfig":"b2de534c9548128e","version":0,"state":"current.temperature","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":830,"y":180,"wires":[["bc170d8c185b8efb"]]},{"id":"9ef36a6101fdccfa","type":"ha-sensor","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Period","entityConfig":"1f338bb84eea05a6","version":0,"state":"current.name","stateType":"msg","attributes":[{"property":"start","value":"current.ts_start","valueType":"msg"},{"property":"end","value":"current.ts_end","valueType":"msg"},{"property":"duration","value":"current.hm_delta","valueType":"msg"},{"property":"perc","value":"current.perc","valueType":"msg"}],"inputOverride":"allow","outputProperties":[],"x":490,"y":180,"wires":[["b2c7396b076ed660"]]},{"id":"7e118ca8606a48b2","type":"subflow:e2f79ea771014cac","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"Flux","env":[],"x":330,"y":120,"wires":[["9ef36a6101fdccfa","4ad115d03bf1bcc7"]],"icon":"node-red-node-suncalc/sun.png"},{"id":"db4ac02069939580","type":"switch","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"self","property":"data.context.user_name","propertyType":"msg","rules":[{"t":"neq","v":"nodered","vt":"str"}],"checkall":"false","repair":false,"outputs":1,"x":630,"y":280,"wires":[["28b68907a6c1c3bd"]]},{"id":"9ea0ef28bf1e7c2d","type":"switch","z":"76d268b99378117f","g":"09e8f85672b69e6e","name":"User","property":"data.context.user_system","propertyType":"msg","rules":[{"t":"false"},{"t":"null"}],"checkall":"false","repair":false,"outputs":2,"x":810,"y":280,"wires":[[],[]]},{"id":"8093ca4.46eb138","type":"server","name":"HA nodered","version":5,"addon":false,"rejectUnauthorizedCerts":false,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":true,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"96c46a37c4c1d229","type":"ha-entity-config","server":"8093ca4.46eb138","deviceConfig":"","name":"sensor config for Brightness","version":6,"entityType":"sensor","haConfig":[{"property":"name","value":"Flux Brightness"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:brightness-percent"},{"property":"unit_of_measurement","value":" %"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"resend":true},{"id":"b2de534c9548128e","type":"ha-entity-config","server":"8093ca4.46eb138","deviceConfig":"","name":"sensor config for Temperature","version":6,"entityType":"sensor","haConfig":[{"property":"name","value":"Flux Kelvin"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:temperature-kelvin"},{"property":"unit_of_measurement","value":" K"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"resend":true},{"id":"1f338bb84eea05a6","type":"ha-entity-config","server":"8093ca4.46eb138","deviceConfig":"","name":"sensor config for Period","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Flux Period"},{"property":"icon","value":"mdi:chart-timeline"},{"property":"entity_category","value":""},{"property":"entity_picture","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false}]

Yes it works now! Thank you.

Hello @dbrunt ,

Had any luck with the new Adaptive Lighting? I’ve used the automation to extend the window of brightness to a user defined wake and sleep time using this automation script. But the temperature doesn’t follow the new graph. It still just follows the default within AL. If you get something working can you keep people here posted?

I have become deeply immersed once again in the Adaptive Lighting custom component for HA and as such have disabled my NR routines and not looked at them in a while. I’ve not had any random turn-ons with the current version like before and am happy with the color/brightness of my office, kitchen, patio, bedroom and bathroom lights. Am currently testing it out for my aquarium H801 RGB controller which I want blue at night which so far seems to be working.

1 Like