- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "bedroom_switch"
internal: true
on_multi_click:
- timing:
- ON for at most 0.8s
- OFF for at most 0.5s
- ON for at most 0.8s
- OFF for at least 0.2s
then:
- logger.log: "Double Clicked"
- homeassistant.service:
service: cover.toggle
data:
entity_id: cover.curtain
- timing:
- ON for at least 0.8s
then:
- logger.log: "Single Long Clicked"
- if:
condition:
binary_sensor.is_on: binary_sensor_moonlight
then:
- logger.log: "normal"
- homeassistant.service:
service: yeelight.set_mode
data:
entity_id: light.yeelight_ceiling
mode: normal
else:
- logger.log: "moonlight"
- homeassistant.service:
service: yeelight.set_mode
data:
entity_id: light.yeelight_ceiling
mode: moonlight