HA control Axis camera

Hi,
I have a few Axis cameras and using the integration with HA, but really I am only using the motion detectors on the camera to trigger my alarm in HA, no video in HA.

I would like to send a “command” to the cameras to “record on motion” when my alarm in HA is armed. And then back again when disarmed.

I am on a very basic level and have not found anything related using the search function. I could use some pointers where to investigare further or (in the best of worlds) someone that has done it before. Maybe it is not possible, that would also be useful information of course.