Broadlink send_packet command in swith template does not work

Is there any good reason why this doesn’t work? The switch changes the state of the input_boolean, but the packet is never sent to the broadlink device.

switch:
  - platform: broadlink
    host: 192.168.2.10
    mac: 'xxx'
    friendly_name: 'RM pro+'
    type: rm2_pro_plus
        
    vive_sensor_power:
      value_template: '{{ states("input_boolean.vive_sensor_power") }}'
      friendly_name: 'Vive Sensor Power'
      turn_on:
        - service: switch.broadlink_send_packet_192_168_2_10
          data:
            packet: "xxx"  
        - service: input_boolean.turn_on
          data:
            entity_id: input_boolean.vive_sensor_power
      turn_off:
        - service: switch.broadlink_send_packet_192_168_2_10
          data:
            packet: "xxxx"  
        - service: input_boolean.turn_off
          data:
            entity_id: input_boolean.vive_sensor_power

input_boolean:
  vive_sensor_power:
    name: Vive Sensor Power

On the other hand, writing it as a script works as intended… Is it the tag “sequence” that is the reason why it’s working? I don’t understand why, the rest of the code is identical as far as I can tell:

script:
  vive_sensor_power:
    sequence:
      - service: switch.broadlink_send_packet_192_168_2_10
        data:
          packet: "xxx"
       - service: input_boolean.turn_on
         data:
           entity_id: input_boolean.vive_sensor_power

for broadlink switch platform only allow command on / command off not switch template

platform: broadlink
host: !secret ip_pro1
mac: !secret mac_pro1
timeout: 15
friendly_name: "Pro1"
type: rm
switches:
  kitchen_aircon:
    friendly_name: "Kitchen aircon"
    command_on: 'JgBAAGoAAUESMxESEBIQEhA0EBIREREREREREREREREREhERERESEBIyEhARMxIQEhASMhIQEhASMhIyETMSEBEADQUAAAAAAAAAAA=='
    command_off: 'JgBAAGYAAUYPNQ8TDxMPEw81DxMPEw8TDzYONg8TDxMPEw8TDxMPEw8TDxMPFA4TDxMQNA8UDjYREQ8TDxMPNQ8ADQUAAAAAAAAAAA=='      
  office_light:
    friendly_name: "Office main light"
    command_on: 'sgk0AAwjDCIMAAFeDCIkDCQMDCMMIyQMDCMkDCQMDSMMIyQMJAwMIyQMDSMkDAwjDCIkDAwjJAwAAAAA'
    command_off: 'si80AAwjDCMkDA0iJAwkDA0iDSIkDCQMDCMkDA0jJAwMIwwjJAwkDAwjDCMMIwwAAV4MIyQMJAwAAAAA'
  front_light:
    friendly_name: "Front light"
    command_on: 'sj00AAwjDCMkDAwiJAwkDAwjDCIkDCQMDCMkDAwjJAwMIgwjJAwNIwwjDCMjDAwAAV4NIiQMJAwAAAAA'
    command_off: 'siE0ACQMDSIlDA0jDCIlDA0iDCIkDA0iDAABXQwjJAwkDA0jDCIkDA0jJAwkDA0iDSIkDCQMDSMAAAAA'

Yeah, I was just being stupid… I’ve been toggling the input_boolean instead of the actual switch. It’s working perfectly now. :smiley: