Hello, welcome to the forum. First, test IR in the Aqara home app.
In my lesson 18 I created automation for an air conditioner. You can read it for general development. Automation 2.0, lesson 18, creating temperature control automation using air conditioning