Conflicting Light Flows

I have a bedroom routine flow that turns off the common area lights using a 10 second transition.

The issue I’m having is that it sets the entity status to off, before the 10 seconds have finished. I have a seperate flow that decides what brightness to set the living room lamp to based on time of day / sun position. This flow is dependent on a state-change node for the living room lamp.

Before the transition flow has finished, the state changes to on and then the light brightens back to full. If i disable the flow that sets the brightness based on time of day, the transition works without issue.

If anyone has any ideas, I’d be super grateful!

This is the flow that sets the brightness, alongside the node that turns off the lamp before bed:

[{"id":"3334dcbf.661ab4","type":"api-call-service","z":"d2b15d3a.380008","name":"Set brightness to max","server":"48b6dc20.3e4a34","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"","data":"{\"entity_id\":\"light.sengled_living_room_lamp\",\"brightness_pct\":\"100\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":622,"y":80,"wires":[["9bded5f8.bd25b8"]]},{"id":"a90478da.c67cc","type":"api-call-service","z":"d2b15d3a.380008","name":"Set brightness to dim","server":"48b6dc20.3e4a34","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.sengled_living_room_lamp","data":"{\"brightness_pct\":\"5\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":622,"y":180,"wires":[["9bded5f8.bd25b8"]]},{"id":"e7f25693.472688","type":"api-call-service","z":"d2b15d3a.380008","name":"Set brightness to relax","server":"48b6dc20.3e4a34","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.sengled_living_room_lamp","data":"{\"profile\":\"relax\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":622,"y":130,"wires":[["9bded5f8.bd25b8"]]},{"id":"9bded5f8.bd25b8","type":"api-call-service","z":"d2b15d3a.380008","name":"Add log to HA","server":"48b6dc20.3e4a34","version":1,"debugenabled":false,"service_domain":"logbook","service":"log","entityId":"","data":"{\"name\":\"Living room lamp brightness automation\",\"message\":\"ran successfully\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":860,"y":140,"wires":[[]]},{"id":"a7c45811.e9aac8","type":"within-time-switch","z":"d2b15d3a.380008","name":"","positionConfig":"669a23d3.09980c","startTime":"sunrise","startTimeType":"pdsTime","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"sunset","endTimeType":"pdsTime","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"tsCompare":"0","lastMsgOnStartOut":false,"lastMsgOnEndOut":false,"x":320,"y":80,"wires":[["3334dcbf.661ab4"],[]]},{"id":"fa60bab1.28ebc","type":"within-time-switch","z":"d2b15d3a.380008","name":"","positionConfig":"669a23d3.09980c","startTime":"sunset","startTimeType":"pdsTime","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"23:59","endTimeType":"entered","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"tsCompare":"0","lastMsgOnStartOut":false,"lastMsgOnEndOut":false,"x":322,"y":128,"wires":[["e7f25693.472688"],[]]},{"id":"38d102f0.28d0de","type":"within-time-switch","z":"d2b15d3a.380008","name":"","positionConfig":"669a23d3.09980c","startTime":"00:00","startTimeType":"entered","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"sunrise","endTimeType":"pdsTime","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"tsCompare":"0","lastMsgOnStartOut":false,"lastMsgOnEndOut":false,"x":322,"y":174,"wires":[["a90478da.c67cc"],[]]},{"id":"31d99fb1.dff7b8","type":"api-call-service","z":"d2b15d3a.380008","name":"Turn off common area lights","server":"48b6dc20.3e4a34","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.common_area_lights","data":"{\"transition\":10}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1280,"y":140,"wires":[[]]},{"id":"bfb1dff1.738dd","type":"server-state-changed","z":"d2b15d3a.380008","name":"Living Room Lamp","server":"48b6dc20.3e4a34","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"light.sengled_living_room_lamp","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":110,"y":140,"wires":[["a7c45811.e9aac8","fa60bab1.28ebc","38d102f0.28d0de"],[]]},{"id":"48b6dc20.3e4a34","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true},{"id":"669a23d3.09980c","type":"position-config","z":"","name":"Toronto","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":"99","timeZoneDST":"0","stateTimeFormat":"3","stateDateFormat":"12"}]

Unable to find the within-time-switch node, so I’m not sure what they do. I noticed there’s no transition defined in your light actions though…so it’s a bit confusing what the problem actually is.

Sorry for the confusion!

The “Turn off common area lights” node is the one with the transition for 10 seconds. The within-time-switch specifies that if the light turns on between sunrise and sunset, or sunset and midnight, etc, what brightness to set the lamp to.

The “common lights” node is part of a different flow, hence the conflict.

You just need to add logic that disables this entire automation when you run your bedroom routine, because it is probably more variable than the sun tracking (which in itself is variable throughout the year.)

You could set a global variable when the bedroom routine is run, then add a switch into this automation to check for that variable before the time-checks to see if it should proceed. Then, when you know it’s safe, add a change node routine to clear the variable while you sleep, or something like that.

I actually thought that may work, thanks! I’ll give that a try, probably end up tying it to the bedroom door closing.