niceboygithub / AqaraGateway

Aqara Gateway/Hub integration for Home Assistant
523 stars 66 forks source link

How to listen for the button click event of the T1 switch? #251

Closed mcmichaelchan closed 7 months ago

mcmichaelchan commented 7 months ago

I have added the T1 switch to my M1S gateway, but I only found the power status and a switch sensor. How can I listen for the button click event and tell which button is clicked in HA?

image image
CharmingCheung commented 7 months ago

You should first learn about the relationship between Devices and Entities in HA. The click state of your Aqara T1 is an entity provided by this device. So, you should be listening to the Entity, not Device.

Such as: image

mcmichaelchan commented 7 months ago

You should first learn about the relationship between Devices and Entities in HA. The click state of your Aqara T1 is an entity provided by this device. So, you should be listening to the Entity, not Device.

Such as: image

Thank you🥰