Conditional Broadlink Packets

About a month ago I managed to find a thread with some relevant help, but after an unexpected reset a cant figure out how I previously had it.

The aim is to have one automation that sends the broadlink packet depending on the current state of an input boolean.

Bonus problem, back when it was working every now and again the code would change itself. Adding in extra quotes and new lines. I think it has something to do with the user interface for automations.

Any help would be much appreciated :slight_smile:

My current code is:

Try putting single or double quotes round the packet data.