Zigbee button and automation trouble

Hi all,

I’ve just set up my Sonoff Zigbee Bridge and SNZB-01 Button and integrated with the AlexIT addon. It’s working in the ewelink app and i can see the button as a binary sensor in the Entities.

Now I’m trying to make it so when I push the button once, it turns on a light, if I double press the button, turn on a different light.

I tried an automation for when the button state = On, but it’s never triggering. Also I added it to the UI to see its state and noticed when I double click, it turns on and single clock turns it off. Long hold doesn’t do anything to the state.

Any idea how I can use it in automation or to toggle other devices?