Use Wireless Switch To Turn On/Off XiaoMi Yeelight
This is a simple rule to train the XiaoMi Wireless switch to act like a normal wall light switch.
- Add a new Automation rule as described in page 5 of this tutorial.
- Choose an appropriate name for this Automation (this will be shown in Overview).
- Leave the conditions empty. This means the action will always be fired when the trigger is activated.
- Fill in the Action portion like so, remember to substitute the entity_id with the one for your Zigbee device:
- Click the save icon in the lower right.
- Congratulations. You have just created your first Automation.
Now try it out by clicking the button.
You can expand on this simple rule by setting conditions, and it can be anything you want. For example, when you are in the house, or when the time is between 9am to 10pm and so on. You can specify multiple actions on a trigger (e.g. turn on the light and a power socket). The wireless switch support the following event types:
So far I have only tried
long_click_press. Not entirely sure what is
long_click_release (they may just be duplicates of long_click_press). In other words, you can specify at least 3 Automations for a XiaoMi Smart wireless switch.
Comment from: Diogo Visitor
in point 5, with version 2.66.2, I needed to press 5 times, or more, not in the blank area above the version, at the bottom of the screen
Comment from: Member
Thanks. Have updated the article.