IFTTT trigger and complex automation

Hi,
i am trying to set up a complex automation (for me). let me describe what it have to do:

when Ismart alarm through IFTTT is set on arm between 21:00 and 07:00
switch off all the lights except two lights (osram plug through hue seems like lights) that are used for usb mobile phone chargers.
If not in that time range the automation switch off all lights (also the osram plugs)
and in the mean time call TTS service on google home “alarm armed”

Here my script and automations:

- alias: spegnitutto
  #initial_state: true
  trigger:
   - platform: event
     event_type: ifttt_webhook_received
     webhook_id: spegnitutto
  action: 
    - service: script.turn_on
      entity_id: script.allarme_inserito_webhook
  condition: 
      condition: and
      conditions:
        - condition: time
          after: '21:00:00'
          before: '07:00:00' 

allarme_inserito:
  alias: "allarme inserito"
  sequence:
    - service: tts.google_say
      entity_id: media_player.google_home_mini_sala
      data_template:
        message: "allarme inserito"
        language: it
        cache: false

allarme_inserito_webhook:
  alias: "allarme inserito webhook"
  sequence:
    - alias: spegni luci
      service: homeassistant.turn_off
      data:
      entity_id: group.luci
    - alias: accendi alimentatore1
      service: light.turn_on
      data:
      entity_id: light.alimentatore_cellulare1
    - alias: accendi alimentatore2
      data:
      service: light.turn_on
      entity_id: light.alimentatore_cellulare2

I would like to merge the scripts and call them with the automation.

Thanks to anyone who can help me.

Marco

Try this:

- alias: spegnitutto
  #initial_state: true
  trigger:
   - platform: event
     event_type: ifttt_webhook_received
     webhook_id: spegnitutto
  action: 
    - service: script.allarme_inserito_webhook
    - service: script.allarme_inserito
allarme_inserito_webhook:
  alias: "allarme inserito webhook"
  sequence:
    - alias: spegni luci
      service: homeassistant.turn_off
      entity_id: group.luci
    - alias: alimentatore1 & alimentatore2
      service_template: >
        {% if 7 <= now().hour < 21 %}
          light.turn_off
        {% else %}
          light.turn_on
        {% endif %}
      entity_id:
        - light.alimentatore_cellulare1
        - light.alimentatore_cellulare2

Hi, sorry for not coming back to you.
Your suggestion worked till some weeks ago.

Now this automation works only in part.
When ifttt triggers it, the tts works and also it turn off the group.luci but the other group with service template doesn’t work anymore.

Any tips?
Thank you in advance
Marco