I haven’t tested it with UCM, but it might work since UCM is based on asterisk and also provides AMI interface.
You will need to create AMI user on UCM. See: https://www.grandstream.com/hubfs/Product_Documentation/UCM_series_AMI_guide.pdf
Might also need to configure contexts in conf.yml
for UCM.