Xuaimi_aqara.click to control xiaomi fan.zhimi_fan_v2 Fan On and Off

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

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

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!

Looks like it worked :relaxed:
Glad to help !
Happy automation !

1 Like