Amazon Dash Button Toggle Rule

I am trying to write a rule for the Amazon Dash Button but somehow it will not work.

rule "Dash button pressed"
    when
        Channel "amazondashbutton:dashbutton:0a-47-d9-0e-bb-d3:press" triggered
    then
        Channel "miio:generic:039AA2D5:toggle"
end

Another channel would be “miio:generic:039AA2D5:power” but I dont know what to use at the end of Channel to toggle or switch on off.

Ok I have found it

rule "Dash button pressed"
    when
        Channel "amazondashbutton:dashbutton:0a-47-d9-0e-bb-d3:press" triggered
    then
        if (PhilipsCeilingToggle.state!=ON)      // item OFF or uninitialized
                PhilipsCeilingToggle.sendCommand(ON)
        else
                PhilipsCeilingToggle.sendCommand(OFF)
end