Changing light color in Aqara M1 Hub

I integrated an aqara M1 hub into home assistant using homekit controller. It show in integrations as one device and four entities. My question is how do I change the color of the light with a state change in another entity. I can change the color with a card on the desktop, but I would like to automate the change. My idea is to turn the light green when alarm panel is armed, and red when triggered. I do not even know where to begin.

[Solved] Found solution on you tube by “Salvamipc”. The title of the video is Home Assistant alarm Arm/Disarm With button or control.

Can you explain how you have done it ? The video doesn’t really explain how to change the color, only how to arm the alarm.