Turn off light while alarm armed

Hi I have some lights in the kitchen called candle lights. Through Tuya they open at sunset and shut of at 11PM.
I would like the lights to be turned off when I am not home when the alarm is armed.

What is the best way to integrate it to the following script I have already for my alarm?

Or if best use HA to turn on from sunset to 11pm and turn off if alarm is armed. Or not turn on at all if alarm is set before sunset

light is called switch.20808347bcddc2975aba

- alias: Random Away Lights
  initial_state: true
  hide_entity: false
  trigger:
  - platform: time_pattern
    minutes: /10
    seconds: 0
  condition:
  - condition: state
    entity_id: alarm_control_panel.my_house
    state: armed_away
  - condition: time
    after: '16:00:00'
    before: '23:30:00'
  action:
  - delay: 00:{{ range(5,15) | random | int }}:00
  - service: script.my_random_light
    data_template:
      random_group: group.alarm_lights
      random_entity_id: '{{ state_attr("group.alarm_lights","entity_id") | random }}'
      light_count_limit: 2
#see script file for continuation of this code


- alias: Random Lights off at 23:35
  initial_state: true
  hide_entity: false
  trigger:
  - platform: time
    at: '23:35:00'
  condition:
  - condition: state
    entity_id: alarm_control_panel.my_house
    state: armed_away
  action:
  - service: homeassistant.turn_off
    entity_id: group.alarm_lights
  id: 4ca46850adee4561b216c28317dd2824
- alias: Random Lights Off Disarmed
  initial_state: true
  hide_entity: false
  trigger:
  - platform: state
    entity_id: alarm_control_panel.my_house
    from: armed_away
    to: disarmed
  action:
  - service: homeassistant.turn_off
    entity_id:
      - light.53411381807d3a59486b #bedroom
      - light.53411381807d3a59491c #family room
      - light.73371318ecfabc9a8f79 #fireplace lights 
      - light.53411381807d3a597774 #kitchen ceiling
      - light.53411381807d3a5972d7 #kitchen Island
      - light.53411381807d3a597131 #living room ceiling lights
      - light.186036583c71bf278e13 #Dining Room Light   
      - switch.25206422807d3a7e6a7f #Office Light

Why is your first automation’s trigger checking every 10 minutes if the alarm control panel is armed_away? Why not just trigger when the panel’s state changes to armed_away?

I can write an entire story, but maybe just take a look at my automations, some are a bit messy, but hey they work!

Alarm Automations
Leave and Arrive Home Automations

I actually set the alarm automatically if no one is home. If no one is home the lights will turn off (depending on the time of day to select which lights will turn off/on). The same is in the opposite way, when I get home the alarm automatically disarms and the lights will turn on (depending on the time of day again). I don’t trigger the lights to turn on/off with the alarm, but with a person entity (device tracker) to tell HA if someone is home or not. I have this working for months now and it works flawlessly, we never have to arm/disarm the alarm as that goes fully automatic and it even knows which alarm to set (home/away) depending on if the dog is home or not.

good luck!

Don’t know , it is a script someone did and I modified it with help from this forum for my needs. It works great so I never touched it.
Can you help me with integrating my original question?

Thanks Jimz011 I will look at your scripts to see if I can integrate to my needs.
As for device tracker I can’t use as I have bell home hub 2000 and from other question posted I was told these devices are locked down; end-users only have access via the device’s web-interface and not via any API (Application Programming Interface) or even via telnet.
Can use other solutions like nmap and owntracks but apparently some say these are battery consumers for the phone. Therefore rather use through alarm system state. Thanks

Sorry no, not with the way the automation is currently written (which is one of your stated requirements). Good luck.