Control Xiaomi Yi Dome hacked in HA

Hi, I hacked succesfully my Xiaomi Yi Dome 1080p with yi-hack-v3 firmware.
Now I’m able to show its images in HA standard dashboard.
I wish to control the camera via HA and activate recording function only when my AlarmSystem (by Runningman84) is armed in “away” mode… and deactivate recording when AlarmSystem isn’t armed.
How can I do it?