Script stopping itself?

I’m setting up a BroadLink RM4 Pro to raise and lower my projector screen and for some reason my remote control button press scripts are turning themselves off? The scripts (PS Up and PS Down) run with no error and call the service and I see that they have run inside of HA when I run them manually but they don’t move the screen.

Here is what I’m seeing in the log and a few other screenshots.

Thanks for any help you can provide.




It’s showing you the state of itself. It’s not turning it self off.

Scripts are on when running and off when not running.

Well damn… I wonder why the script is not firing off the service call. Any suggestions on where to look?

Thank for the response!

Click the 3 dots and download the trace and post it here.

When I manually run the script I only see what is shown on the screenshots above in my first post when clicking on the “Traces” link. When clicking on the three dots I don’t see a download trace option.

it’s in the menu next to the edit script button.

Found it. Thanks!

{
  "trace": {
    "last_step": "sequence/0",
    "run_id": "6570c6992a25fbed3a8d37a3e35ebea7",
    "state": "stopped",
    "script_execution": "finished",
    "timestamp": {
      "start": "2024-03-05T15:39:54.244721+00:00",
      "finish": "2024-03-05T15:39:54.248794+00:00"
    },
    "domain": "script",
    "item_id": "psup",
    "trace": {
      "sequence/0": [
        {
          "path": "sequence/0",
          "timestamp": "2024-03-05T15:39:54.246220+00:00",
          "changed_variables": {
            "this": {
              "entity_id": "script.psup",
              "state": "off",
              "attributes": {
                "last_triggered": "2024-03-05T15:35:00.686717+00:00",
                "mode": "single",
                "current": 0,
                "icon": "mdi:projector-screen",
                "friendly_name": "PSUP"
              },
              "last_changed": "2024-03-05T15:35:00.691850+00:00",
              "last_updated": "2024-03-05T15:35:00.691850+00:00",
              "context": {
                "id": "01HR7M1YTE6JXEFSVAPFANAP0Q",
                "parent_id": null,
                "user_id": "ed009351b0c84c369e7999baf2ea03e2"
              }
            },
            "context": {
              "id": "01HR7MAXG46AZ8Z8J2T0GED6ZG",
              "parent_id": null,
              "user_id": "ed009351b0c84c369e7999baf2ea03e2"
            }
          },
          "result": {
            "params": {
              "domain": "remote",
              "service": "send_command",
              "service_data": {
                "device": "PS",
                "command": "Up",
                "entity_id": [
                  "remote.blr"
                ]
              },
              "target": {
                "entity_id": [
                  "remote.blr"
                ]
              }
            },
            "running_script": false
          }
        }
      ]
    },
    "config": {
      "alias": "PSUP",
      "sequence": [
        {
          "service": "remote.send_command",
          "target": {
            "entity_id": "remote.blr"
          },
          "data": {
            "device": "PS",
            "command": "Up"
          }
        }
      ],
      "mode": "single",
      "icon": "mdi:projector-screen"
    },
    "blueprint_inputs": null,
    "context": {
      "id": "01HR7MAXG46AZ8Z8J2T0GED6ZG",
      "parent_id": null,
      "user_id": "ed009351b0c84c369e7999baf2ea03e2"
    }
  },
  "logbookEntries": [
    {
      "when": 1709653194.244897,
      "state": "on",
      "entity_id": "script.psup",
      "icon": "mdi:projector-screen",
      "context_user_id": "ed009351b0c84c369e7999baf2ea03e2"
    },
    {
      "when": 1709653194.247616,
      "state": "off",
      "entity_id": "script.psup",
      "icon": "mdi:projector-screen",
      "context_user_id": "ed009351b0c84c369e7999baf2ea03e2",
      "context_state": "on",
      "context_entity_id": "script.psup"
    }
  ]
}

Are there any errors in your logs that coincides with the trace time?

No, no errors popping up in the logs. That’s what has me confused. Everything says it should be working but it does not. When I manually use the remote send command on the service it works. It’s only when the script calls the service that’s the problem.

Are you sure command and device is correct?

Put the settings into developer tools → services tab, switch to yaml mode. Compare.

I had to come into the office. I’ll take a look tonight when I get back home. Thanks for all your help!

Before I left I did notice one this. My broadlink_remote_MACADDRRESS_codes file has my Up and Down services inside, but the broadlink_remote_MACADDRESS_flags file has no services inside.

I’m new to services… is this normal?

sorry, not familiar with those files

Ok, when I call any of the services with your suggestion above I get a green checkmark and no error. But my screen does not go up or down. I tried both my Up and Down commands which are in the service.

No errors in the logs either.

Sounds like you don’t have the correct commands then