Yeelight Automation

Hi all,
I’m new on HA and i’m trying to configure some automation with my yeelight, i did this two, the first is about turning on light in the morning, the second is about turning light at sunset:

automation:
          alias: "Accendi luce soggiorno alle 6:30am"
          trigger:
             - platform: time
               at: 06:30:00
          action:
          - service: light.yeelight_set_mode
automation 2: 
        alias: "Accendi luce soggiorno al tramonto"
        trigger:
           - platform: time
             at: '18:00:00'
        action:
        - service: light.yeelight_set_mode

both automation are not working, and i get this log in home-assistant.log:

2018-11-27 18:00:00 ERROR (MainThread) [homeassistant.core] Invalid service data for light.yeelight_set_mode: required key not provided @ data[‘mode’]. Got None
2018-11-28 06:30:00 ERROR (MainThread) [homeassistant.core] Invalid service data for light.yeelight_set_mode: required key not provided @ data[‘mode’]. Got None

i can’t understand what is missing, can someone help me?
EDIT: sorry, code formatted correctly :grin:
Thank you

Here is an example of mine that might help you. The light.hall in this example is a Yeelight.

# SUNSET - WHEN HOME #
- alias: Sunset - When Home
  hide_entity: true
  trigger:
    platform: numeric_state
    entity_id: sun.sun
    value_template: "{{ state.attributes.elevation }}"
    below: 10
  condition:
    condition: state
    entity_id: group.family
    state: 'home'
  action:
    - service: light.turn_on
      entity_id: light.hall

If you would like to have a certain color set with this automation, use this example.

- service: light.turn_on
  entity_id: light.table
  data:
    brightness: 60
    rgb_color: [0,0,255]
    transition: 3

Also, please follow the information at the top of the page regarding formatting your code. It is very hard to read otherwise.

Can you use the </> to format the code correctly? Makes it easier to read.

I think you are mixing the service and entity for the action.
It should look something like this:

- alias: Mik's room light on
  trigger: 
    platform: time
    at: "07:00:00"
  action:
    service: light.turn_on
    entity_id: light.Mik_light

For sunset or sunrise you can use the platform sun

- alias: Switch on xmas lights evening
  trigger:
    platform: sun
    event: sunset
    offset: +00:00:00
  action:
    service: light.turn_on
    entity_id: light.ground_floor_living_room

Edit: I was too slow :slight_smile:

If you want to use set_mode service you need to include which mode in the data: refer to this

for your needs i think light.turn_on is more appropriate