Is it possible to use method from the API in a template?

Hello,

I’d like to use one of these function in a template:
http://dev-docs.home-assistant.io/en/master/api/util.html
Is that possible ?

I was looking for the color_RGB_to_hs function

Thank you
Fred

No these methods are not exposed to the template engine. Try it in the Developer Tools / Template editor.

I tried but I was not sure to use it correctly. Thank you for your answer!

What are you trying to accomplish?

There may be another way.

I have a zwave RGB controller (Fibaro) which contains one switch per color (0…255) and I wanted to have a template light to manage it like a regular RGB light.
So I started something like that

light:
  - platform: template
    lights:
      couloir_rgbw_controller_virtual:
        friendly_name: "Lumière couloir RGBW"
        level_template: "{{ state_attr('light.lumiere_couloir_current_value', 'brightness')|int }}"
        value_template: "{{ is_state('light.lumiere_couloir_current_value','on') }}"
        #temperature_template: "{{states('input_number.temperature_input') | int}}"
        #color_template: "{{[state_attr('light.lumiere_couloir_current_value_2', 'brightness')|int,state_attr('light.lumiere_couloir_current_value_3', 'brightness')|int,state_attr('light.lumiere_couloir_current_value_4', 'brightness')|int]}}"
        turn_on:
          service: light.turn_on
          data:
            entity_id: 
              - light.lumiere_couloir_current_value
        turn_off:
          service: light.turn_off
          data:
            entity_id: 
              - light.lumiere_couloir_current_value
        set_level:
          service: light.turn_on
          data:
            entity_id: light.lumiere_couloir_current_value
            brightness: "{{ state_attr('light.lumiere_couloir_current_value', 'brightness')|int }}"
        set_color:
          - service: light.turn_on
            data:
              entity_id: light.lumiere_couloir_current_value_2
              brightness: "255"
          - service: light.turn_on
            data:
              entity_id: light.lumiere_couloir_current_value_3
              brightness: "0"
          - service: light.turn_on
            data:
              entity_id: light.lumiere_couloir_current_value_4
              brightness: "255"

but the color_template required a tuple of hue sat values. In the line in comments I have set RGB colors.