This is the automation I made for my YNOA One touch dimmer and toggle light.
First needed listen on brightness_up and brightness_down. We always want to go up with the brightness unless a certain thresshold then the brightness is set to 1%
alias: Ynoa - Dimmer
description: ""
trigger:
- platform: device
domain: mqtt
device_id: <SNIP>
type: action
subtype: brightness_move_up
- platform: device
domain: mqtt
device_id: <SNIP>
type: action
subtype: brightness_move_down
condition: []
action:
- if:
- condition: numeric_state
entity_id: <SNIP>
attribute: brightness
above: 0
below: 250
then:
- service: light.turn_on
target:
device_id: <SNIP>
data:
brightness_step_pct: 25
else:
- service: light.turn_on
target:
device_id: <SNIP>
data:
brightness_pct: 1
enabled: true
mode: single
But I also want to toggle on/of the light. So made another automation
alias: Ynoa - Toggle
description: ""
trigger:
- platform: device
domain: mqtt
device_id: <SNIP>
type: action
subtype: "on"
- platform: device
domain: mqtt
device_id: <SNIP>
type: action
subtype: "off"
condition: []
action:
- service: light.toggle
target:
device_id: <SNIP>
data: {}
mode: single