Help with automation - Ambient vs Ceiling lights

Hello,

I have a ceiling light and a tracklight in one of my room along with an ambient light.
There is automation that turns on/off the ambient light at sunset till 22h.
If at 19h, I wish to turn on the ceiling light or tracklight (or both), I want the ambient light to turn off after 10 seconds.
If I switch off the main lights, I want the ambient light to return to its previous on state.

I managed to do it in HA but with only the ceiling light, I couldn’t figure how to add the tracklight.
I figured in NodeRed it will work better, although I do not have much automations/experience.

Can anyone help?

my HA existing automation:

- id: '1627407248517'
  alias: 'Light: Main vs Ambient'
  description: If main is turned on, Ambient is turned off and vice versa
  trigger:
  - platform: state
    entity_id: switch.ceiling_light
    from: 'off'
    to: 'on'
    for: 00:00:10
  - platform: state
    entity_id: switch.ceiling_light
    from: 'on'
    to: 'off'
  condition: []
  action:
  - choose:
    - conditions:
      - condition: device
        type: is_on
        device_id: 153764e9087d11ebb1d2873a761d19ae
        entity_id: switch.ambient_light
        domain: switch
      sequence:
      - type: turn_off
        device_id: 153764e9087d11ebb1d2873a761d19ae
        entity_id: switch.ambient_light
        domain: switch
    - conditions:
      - condition: device
        type: is_off
        device_id: 153764e9087d11ebb1d2873a761d19ae
        entity_id: switch.ambient_light
        domain: switch
      sequence:
      - type: turn_on
        device_id: 153764e9087d11ebb1d2873a761d19ae
        entity_id: switch.ambient_light
        domain: switch
    default: []
  mode: single

I figured these two main lights inject into the ambient light state, then am at a lost.

[{"id":"171e1e1d.ecd1c2","type":"server-state-changed","z":"7d105d71.cc18e4","name":"","server":"6b1110b5.183a4","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.ceiling_light","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,"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":440,"y":3040,"wires":[["c9e5e0f9.aa34e8"],["a0121aa1.38bcd8"]]},{"id":"4455dbd5.976d24","type":"server-state-changed","z":"7d105d71.cc18e4","name":"","server":"6b1110b5.183a4","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.tracklight","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,"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":430,"y":3100,"wires":[["c9e5e0f9.aa34e8"],["a0121aa1.38bcd8"]]},{"id":"3b5f6983.dbf1ee","type":"api-current-state","z":"7d105d71.cc18e4","name":"","server":"6b1110b5.183a4","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.ambient_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1040,"y":3000,"wires":[["efb80978.da7858"],[]]},{"id":"f5504bd0.b69bc8","type":"api-call-service","z":"7d105d71.cc18e4","name":"","server":"6b1110b5.183a4","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.ambient_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":3000,"wires":[[]]},{"id":"efb80978.da7858","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1280,"y":3000,"wires":[["f5504bd0.b69bc8"]]},{"id":"a0121aa1.38bcd8","type":"time-range-switch","z":"7d105d71.cc18e4","name":"","lat":"","lon":"","startTime":"sunset","endTime":"22:00","startOffset":0,"endOffset":0,"x":780,"y":3160,"wires":[["eeb2c8db.36cf88"],[]]},{"id":"c9e5e0f9.aa34e8","type":"time-range-switch","z":"7d105d71.cc18e4","name":"","lat":"","lon":"","startTime":"sunset","endTime":"22:00","startOffset":0,"endOffset":0,"x":780,"y":3000,"wires":[["3b5f6983.dbf1ee"],[]]},{"id":"eeb2c8db.36cf88","type":"api-current-state","z":"7d105d71.cc18e4","name":"","server":"6b1110b5.183a4","version":2,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.ambient_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1040,"y":3160,"wires":[["fce6bf55.8d31c8"],[]]},{"id":"a731807d.e71c4","type":"api-call-service","z":"7d105d71.cc18e4","name":"","server":"6b1110b5.183a4","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.ambient_light","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":3160,"wires":[[]]},{"id":"fce6bf55.8d31c8","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1280,"y":3160,"wires":[["a731807d.e71c4"]]},{"id":"c041b2bd.d8acd","type":"comment","z":"7d105d71.cc18e4","name":"Time condition, current light state, delay, turn off ambient light","info":"","x":1060,"y":2940,"wires":[]},{"id":"4c658fa.c9359f","type":"comment","z":"7d105d71.cc18e4","name":"Time condition, current light state, delay, turn on ambient light","info":"","x":1060,"y":3100,"wires":[]},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]