Automation with Xiaomi Aqara Smart Plug Zigbee

Hi, I bought two Xiaomi Aqara Smart Plug Zigbee, I wish to create an automation that power on and power off them at a specific times via home assistant and not via Xiaomi Mi Home.
Can someone help me?

Where are you stuck ?

I have Hassio installation, usually I wrote someting like…

automation:
  trigger:
    platform: time
    after: '17:00:00'
    before: '23:59:00'
    from: 'off'
    to: 'on'
  service: ???
  entity_id: switch.plug_xxxxxxxxxxxx

but it doubt it will works…

I read this in documentation…

Example configuration.yaml entries

switch:
  - platform: xiaomi_miio
    name: Original Xiaomi Mi Smart WiFi Socket
    host: 192.168.130.59
    token: YOUR_TOKEN

but where I found the xiaomi plug TOKEN? and where I put this code?

May you help me?

xiaomi_miio platforms are for Xiaomi Wifi devices (not Zigbee), so it is not applicable to you.

For those Zigbee smart plugs you bought (which require a Xiaomi gateway, which I suppose you have working in HASS already), easiest way is for you to first add them via Mi Home app assigned to the gateway to which it will connect.

After this, a quick HASS restart will discover it and will start appearing as devices named like you mentioned (switch.plug_xxxxxxxxxxxx).

You know the rest already…

Right, what pplucky said.
You need a device that’s able to translate commands into Zigbee. Hence the Xiaomi gateway, which you can communicate to via WiFi, and the gateway handles the request to Zigbee devices.
Once you have the gateway installed, the rest should be easier for you as the zigbee devices will be auto-discovered.

I have a Xiaomi Gateway 3rd Edition I see them in Hassio which are listed as switch.plug_xxxxxxxxxx.

Now I wish to create a automation to order them to switch on and off at a specific time

alias: 'power on and off smart plug' 
trigger:
  platform: time 
    condition: time
    after: '17:00:00'
    before: '23:59:00'
action:
  service: switch.turn_on 
  entity_id: switch.plug_xxxxxxxx

Is right to use the service switch.turn_on???