The service call looks fine.
You can extend it further to set the desired mode:
- service: alarmo.arm
data:
entity_id: alarm_control_panel.alarmo
code: '{{ trigger.event.data.args.code }}'
mode: home # can be any of away/home/night/vacation/custom
Note that a blueprint exists for connecting the Xfinity keypad to alarmo, see here: Zigbee2MQTT - Control Alarmo via keypad - #25 by gremblin.
It is written for zigbee2mqtt so all mqtt related lines would have to be modified, but perhaps you can use it as starting point.