Airco commands not working

I have airco (haier)
I can turn it on and adjust temp.
But i want to start airco, in cool mode with specified temp.
I made this code but not working:

- alias: 'Aircos aan'
  trigger:
    platform: state
    entity_id: input_boolean.aircos
    to: 'on'    

  action:
    - service: climate.set_temperature
      target:
        entity_id: climate.slaapkamer
      data:
        temperature: 22
    - service: climate.set_hvac_mode
      target:
        entity_id: climate.slaapkamer
      data:
        hvac_mode: cool