Setup yeelight brightness with rotate_right event of xiaomi cube

HI Guys,

was trying to make an automation to manage my yeelights with my xiaomi cube and I cannot find the right syntax, when I try to input my action on the automation UI form it gives me the error message "Message malformed: extra keys not allowed @ data[‘data_template’]"

The action Im trying to use is the below:

  entity_id: light.la_luz_de_la_mesa
      brightness: >
        {%if trigger.event.data.action_value | float > 0 %}
        {{ brightness | int + 50 }}
        {% else %}
        {{  brightness | int - 50 }}
        {% endif %}

Can someone help me find out how can I write this on the automation UI without getting this error or let me know what am I doing wrong

Thanks

Hi,

I own a cube. What’s the trigger you are using?