Saving random HS colors and recalling

I have been trying to make what would appear to be a simple task happen for over a year with my system. My last attempt failed after trying to create a virtual bulb…wasted a whole afternoon and got nowhere.
I want to have a random HS color value assigned at a specific time of day that I can reference when turning on particular color bulbs.
I currently have an automation that sets all the color bulbs at sunset but if I change the scene in a room I cant get that same daily assigned color back via an automation - it randomly makes a new one?
I am very challenged when it comes to coding and have found the HA very challenging. I mostly rely on blueprints for my system. I wish I could write a simple motion light but even that IO need blue prints. Any help or pointers would be greatly appreciated

Current code

if:
  - condition: sun
    before: sunrise
    after: sunset
then:
  - service: light.turn_on
    data:
      hs_color:
        - "{{ (range(1, 360)|random) }}"
        - "{{ (range(90, 100)|random) }}"
    target:
      entity_id:
        - light.kitchen_aquarium_led
        - light.kitchen_color_lights

this seems to work

service: input_number.set_value
data:
  value: "{{ (range(1, 360)|random) }}"
target:
  entity_id: input_number.hs_color_of_the_day_hue

How do I get my other lights to take that random value?

service: light.turn_on
data:
  hs_color:
        -'{{ state_attr("input_number.hs_color_of_the_day_hue") }}'
        -'{{ state_attr("input_number.hs_color_of_the_day_saturation") }}'
target:
  entity_id: light.kitchen_color_lights

why is this line not working

hs_color: 60,70

error - None for dictionary value @ data[‘hs_color’]. Got None

apparently the data needs to be split up

data:
  hs_color: 
    - 199
    - 60
target:
  entity_id: light.foyer_ceiling_light_middle

Can anyone help me get HS_color values to load from the entity_id: input_number.hs_color_of_the_day_hue

service: light.turn_on
data:
  hs_color:
    - "{{ states('input_number.hs_color_of_the_day_hue') | int(0) }}"
    - "{{ states('input_number.hs_color_of_the_day_saturation') | int(0) }}"
target:
  entity_id: light.kitchen_color_lights

To get an entity’s state value, use the states() function, not state_attr()

If you are interested, you can create a Trigger-based Template Sensor that computes a random value for HS at the start of every day.

That did the trick
TY for the reply

You’re welcome!

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.

For more information about the Solution tag, refer to guideline 21 in the FAQ.