How running Automation with 2 trigger

I try to use the automation tools to insert 2 conditions for the triggering according to the following logic:
1 - If 6:00 AM, send a command to my cell phone and my tablet to deactivate the vibration mode
2 - If 9:00 PM, send a command to my cell phone and my tablet to activate the vibration mode

I managed to perform these 2 operations in separate automations. I want to group them in the same automation.

Do you have any suggestions? Thank you for your help!

I am include Yaml on second automation;

alias: Mute_cellulaire_tablette_MRO
description: ‘’
trigger:

  • platform: time
    at: ‘21:00:00’
    condition: []
    action:
  • service: notify.mobile_app_sm_g986w
    data:
    message: command_ringer_mode
    title: vibrate
  • service: notify.mobile_app_sm_t970
    data:
    message: command_ringer_mode
    title: vibrate
    mode: single

First off, please see the sticky post on how to format code.

Secondly, if you want to do that you could use a trigger id and choose with a trigger condition.

Or just write two separate automations.

I don’t know the command you use to “deactivate the vibration mode” so I used ring in this example (change it to whatever is needed).

alias: Mute_cellulaire_tablette_MRO
description: ''
trigger:
  - platform: time
    at:
      - '06:00:00'
      - '21:00:00'
condition: []
action:
  - variables:
      cmd: "{{ 'vibrate' if now().hour == 21 else 'ring' }}"
  - service: notify.mobile_app_sm_g986w
    data:
      message: command_ringer_mode
      title: '{{ cmd }}'
  - service: notify.mobile_app_sm_t970
    data:
      message: command_ringer_mode
      title: '{{ cmd }}'

Thank you for your suggestions, I will do my tests and modify my “automations”.

For your information, I used to use IFTTT to set my cell phone and my digital tablet to “vibrate” or “normal”. With HA, it is possible thanks to the integration of the “sensors” of my cell phone to transmit commands to it. (Sensors | Home Assistant Companion Docs).

I was thus able to free myself from IFTTT.

In that case, replace ring with normal in the example I posted.