LIRC: when key pressed, automation pressing another key

Hello, I’ve installed Lirc and I want to use only a remote in my living. Using tv’s remote I want to control also the soundbar, so I wrote this in automations.yaml (button name as setted in .lircrc):

  • alias: Accendi spegni
    trigger:
    -platform: event
    event_type: ir_command_received
    event_data:
    button_name: KEY_POWER
    action:
    service: shell_command.accendi_soundbar

In configuration.yaml I wrote this (key_power as setted in lircd.conf, NOT .lircrc, is it right? From Terminal this command works. In .lircrc it is named KEY_POWER2 so it’s different from TV KEY_POWER):

shell_command:
accendi_soundbar: ‘irsend send_once Soundbar KEY_POWER’

Nothing is happening.
Trying with SSH, both ircat and irsend are working. The “Accendi spegni” automation is “on” from dev-state panel. Anyone could understand why doesn’t work this automation? Thank you!

Solved, It worked After a restart