Automation with aqara cube (move action)

I’m trying to automate something with the aqara cube, with the “move” action. I’m doing this:

  trigger:
  - event_data: 
      entity_id: binary_sensor.cube_158d000231e5e7
      action_type: move
    event_type: xiaomi_aqara.cube_action
    platform: event
  condition: []
  action:
  - service_template: >  
        {%if trigger.event.data.action_value | string == 'move' %} 
             switch.turn_on
        {% endif %}

    entity_id: switch.plug_158d0001db060d

But i can’t make it work. Rotation action works with action: {%if trigger.event.data.action_value | float > 0 %}

Do you know how to make it work with the move action (and others).

Thanks!

Please use code blocks and syntax highlighting when posting configs and automations.

i did that before :confused:

Corrected thanks

you could simplify it and remove the template. All you need to is a service call to toggle the switch

action:
  service: switch.toggle
  entity_id: switch.plug_158d0001db060d

I like to complicate myself. And keep learning.

Thanks!