Harmony works in one script and not another, what is wrong here

turn_off_tv:
alias: Turn Off TV
sequence:

  • data:
    command:
    • PowerOff
      device: Sony TV
      entity_id: remote.harmony_hub
      service: remote.send_command

arm_home:
alias: Night Mode
sequence:

  • entity_id: scene.night
    service: scene.turn_on
  • data:
    command:
    • PowerOff
      device: Sony TV
      entity_id: remote.harmony_hub
      service: remote.send_command
  • service: rest_command.blue_iris_night
  • data:
    code: ‘XXXX’
    entity_id: alarm_control_panel.alarm_control_panel
    service: alarm_control_panel.alarm_arm_home

Ok, so the Turn Off TV script always works. It rarely works, like 1 out of 10, when I run my Night mode script, what am I doing wrong here? Is it some weird delay I need to add or something?

Plz format your code make easer for us to read and help u

Oops, sorry, thought it was put in blocks, will edit shortly, it’s a pain from my phone

turn_off_tv:
  alias: Turn Off TV
  sequence:
  - data:
      command:
      - PowerOff
      device: Sony TV
    entity_id: remote.harmony_hub
    service: remote.send_command

arm_home:
  alias: Night Mode
  sequence:
  - entity_id: scene.night
    service: scene.turn_on
  - data:
      command:
      - PowerOff
      device: Sony TV
    entity_id: remote.harmony_hub
    service: remote.send_command
  - service: rest_command.blue_iris_night
  - data:
      code: 'XXXX'
    entity_id: alarm_control_panel.alarm_control_panel
    service: alarm_control_panel.alarm_arm_home

So the Turn Off TV always works, but when I run my Night Mode script, it works like 1 out of 10 maybe, sometimes less than that. Do I need to put it last, do a wait, do I have a format issue?

What happens in scene.night?

- id: scene_night
  name: Night
  entities:
    switch.garage_lights:
      state: off
    switch.garage_workbench_lights:
      state: off
    switch.carport_door_light:
      state: on
    light.playroom_lamp:
      state: off
    switch.playroom_light:
      state: off
    light.keeping_room:
      state: off
    light.kitchen:
      state: off
    light.den_lamp:
      state: off
    light.den:
      state: off
    light.frontdoor:
      state: off
    light.entryway_lamp:
      state: on
    light.entryway:
      state: off
    light.dining_room_chandelier:
      state: off
    light.dining_room_hutch_light:
      state: off

Everytime it failed when calling script night mode, the second I hit script turn off TV it worked…

I decided to add it to the first call and the last call in the script and we will see how that does