Help now IFTTT has gone with an automation

Hello, As a newbie to HA I am still learning and have this problem. I used to have a sonoff lightswitch (no load connected to the output) controlling a scene from smartlife to turn on 3 bulbs. This worked fine with IFTTT and I now need to control it via HA. All my sonoffs and smartlife bulbs and scenes can be controlled via the lovelace interface, but using the Configuration / Automations area I can only get the lights to turn on (when the switch is on), and cannot find any way of controlling the lights to go off (when the switch is off). Is that because its not possible with the interface and I need to do it via code in my yaml.config? I was hoping it would be easily done via that interface. Any help greatly received. Thanks

Perfectly possible. The automation trigger would be the switch entity going to the off state, and then the actions would be turning off those bulbs.

thanks for the promt reply, however I cannot see anywhere to add the off state. This is what I have for turning on

It’s worth taking the time to read the automation docs - particularly the state trigger section.

That will activate the scene on every change of that switch entity. You need to specify that it triggers when the switch has gone from off to on. Then you can use the reverse logic for turning the lights off.