Terence_Ng
(Terence Ng)
September 20, 2021, 4:25pm
1
Hi,
I am trying to create an automation for a wireless switch that allows me to change the power on-off of a Mi Smart Pedestal Fan by pressing the same button, can It be done?
Unlike new model fan or light, the “Action” for this fan is only either “turn_on” and “turn_off”, there is no “toggle” action available. Thanks in advance.
@rytilahti
@syssi
alias: 'Baobei Bedroom: Wireless Switch - Right Button - Single Press - Fan On Off'
description: ''
trigger:
- platform: event
event_type: xiaomi_aqara.click
event_data:
entity_id: binary_sensor.wall_switch_right_158d000313xxxx
click_type: single
condition: []
action:
- device_id: f0400c0cfa7643895249acc3xxxxxxxx
domain: fan
entity_id: fan.zhimi_fan_v2
type: turn_off
mode: restart
SNoof85
(Sébastien)
September 20, 2021, 7:12pm
2
Hi,
You should probably not tag people directly. This is an unwanted behavior here : How to help us help you - or How to ask a good question
Then about your request here, as this entity is a fan, a service called fan toggle exists. You should try it ?
alias: 'Baobei Bedroom: Wireless Switch - Right Button - Single Press - Fan On Off'
description: ''
mode: single
trigger:
- platform: event
event_type: xiaomi_aqara.click
event_data:
entity_id: binary_sensor.wall_switch_right_158d000313xxxx
click_type: single
condition: []
action:
- service: fan.toggle
target:
entity_id: fan.zhimi_fan_v2
1 Like
Terence_Ng
(Terence Ng)
September 21, 2021, 4:31pm
3
Sorry, didn’t know that, I will not tagging anyone in my next post.
For the setting, I will try and update the result here.
Thanks!
SNoof85
(Sébastien)
September 22, 2021, 7:54pm
4
Looks like it worked
Glad to help !
Happy automation !
1 Like