Button doesn't run scripts - scripts work if run manually

I created these two scripts, that basically turn on/off a bunch of led lights and screens.

I then added this in configuration.yaml

command_line:
  - switch:
      name: Samurai Mode
      command_on: script.samurai_on
      command_off: script.samurai_off

and created a button that uses the entity “Samurai Mode”

2

But the button is not doing anything.

If I run the scripts manually, everything is working as expected.

But why is the button not working?

Do you get any traces for the scripts or do the ‘Last triggered’ timestamps update when you press the button?

Hi. I’ve never used a Button, so this is a total guess…
Don’t you need an Automation and Trigger to capture the button.press event and initiate the relevant script(s)?
See Button - Home Assistant
A Button is not a Switch, if I understand the Docs correctly…
But I may well be completely off the path there… If so, sorry.

using this worked perfectly.

switch:
  - platform: template
    switches:
     samuraimode:
        friendly_name: "Samurai Mode"
        turn_on:
            - service: script.samurai_on
        turn_off:
            - service: script.samurai_off

Thanks