Dashboard Widget: Two Operations

I am using the old Dashboard Pallet on my Mac, running Node-Rec v3.10

I built a flow using the EXEC node to open a file on my Mac. For example:

"open /Users/alanblind/Documents/AudioHijack/Goyo_On.ahcommand"

When I use any dashboard widget, to trigger the EXEC node, it takes two clicks on the widget to get a msg.payload output and trigger the EXEC node. I have tried several dashboard widgets with the same result.

If I remove the wire to the EXEC node, so it does not trigger the EXEC node, on every click, the dashboard widget works just fine.

There appears to be an "invisible" interaction between the EXEC command to open a file, and the Dashboard Widget??

Below is a test flow, using a button and EXEC node, to demonstrate. Change the filepath to open for your testing.

Any ideas how to correct this behavior?

Alan

[
    {
        "id": "76f77705e7a22a6e",
        "type": "exec",
        "z": "736a5b30bbc4c6f5",
        "command": "open /Users/alanblind/Documents/AudioHijack/Goyo_On.ahcommand",
        "addpay": "",
        "append": "",
        "useSpawn": "false",
        "timer": "",
        "winHide": false,
        "oldrc": false,
        "name": "On",
        "x": 1250,
        "y": 200,
        "wires": [
            [
                "c32244664fd60b0d"
            ],
            [],
            []
        ]
    },
    {
        "id": "ef82d023d91a4469",
        "type": "exec",
        "z": "736a5b30bbc4c6f5",
        "command": "open /Users/alanblind/Documents/AudioHijack/Goyo_Off.ahcommand",
        "addpay": "",
        "append": "",
        "useSpawn": "false",
        "timer": "",
        "winHide": false,
        "oldrc": false,
        "name": "Off",
        "x": 1250,
        "y": 300,
        "wires": [
            [
                "522bb171ce63d177"
            ],
            [],
            []
        ]
    },
    {
        "id": "3c289c37ba2fc16d",
        "type": "ui_button",
        "z": "736a5b30bbc4c6f5",
        "name": "On",
        "group": "eabc5ef371203f41",
        "order": 1,
        "width": "3",
        "height": "1",
        "passthru": false,
        "label": "On",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "trigger",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 910,
        "y": 200,
        "wires": [
            [
                "76f77705e7a22a6e",
                "afa73ad4a91301e6"
            ]
        ]
    },
    {
        "id": "676e2fdac8d986ab",
        "type": "inject",
        "z": "736a5b30bbc4c6f5",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 1080,
        "y": 60,
        "wires": [
            [
                "76f77705e7a22a6e"
            ]
        ]
    },
    {
        "id": "1accbcc89e3358ab",
        "type": "ui_button",
        "z": "736a5b30bbc4c6f5",
        "name": "Of",
        "group": "eabc5ef371203f41",
        "order": 1,
        "width": "3",
        "height": "1",
        "passthru": false,
        "label": "Of",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "trigger",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 910,
        "y": 300,
        "wires": [
            [
                "ef82d023d91a4469",
                "c475a3ae8e43eb74"
            ]
        ]
    },
    {
        "id": "167ccf4c7b526f1e",
        "type": "inject",
        "z": "736a5b30bbc4c6f5",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 1080,
        "y": 480,
        "wires": [
            [
                "ef82d023d91a4469"
            ]
        ]
    },
    {
        "id": "c32244664fd60b0d",
        "type": "debug",
        "z": "736a5b30bbc4c6f5",
        "name": "debug 1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1470,
        "y": 180,
        "wires": []
    },
    {
        "id": "522bb171ce63d177",
        "type": "debug",
        "z": "736a5b30bbc4c6f5",
        "name": "debug 2",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1460,
        "y": 280,
        "wires": []
    },
    {
        "id": "afa73ad4a91301e6",
        "type": "debug",
        "z": "736a5b30bbc4c6f5",
        "name": "debug 3",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1060,
        "y": 160,
        "wires": []
    },
    {
        "id": "c475a3ae8e43eb74",
        "type": "debug",
        "z": "736a5b30bbc4c6f5",
        "name": "debug 4",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1040,
        "y": 360,
        "wires": []
    },
    {
        "id": "eabc5ef371203f41",
        "type": "ui_group",
        "name": "Audio HiJack",
        "tab": "3ed6823a2db5f54a",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "3ed6823a2db5f54a",
        "type": "ui_tab",
        "name": "Tab 1",
        "icon": "dashboard",
        "order": 1
    }
]

Do you mean that the debug node on the output of the button node shows nothing the first time you click the button?

Please open a command window, stop node red and start it again, click the button and then copy/paste the startup log here. Copy/paste please, not screenshot.

Q - Do you mean that the debug node on the output of the button node shows nothing the first time you click the button?
A- Yes. No msg.payload on every other click of the button. Only when wired into the EXEC node.

Logs below. I did not see any new log entries when pushing the Button Widget.

Alan

+++++++++++++++++++++++

Last login: Sat Sep 30 08:22:37 on ttys000

caffeinate node-red

alanblind@Alans-Mac-Studio ~ % caffeinate node-red

30 Sep 11:53:42 - [info]

Welcome to Node-RED

===================

30 Sep 11:53:42 - [info] Node-RED version: v3.1.0

30 Sep 11:53:42 - [info] Node.js version: v18.18.0

30 Sep 11:53:42 - [info] Darwin 23.0.0 arm64 LE

30 Sep 11:53:43 - [info] Loading palette nodes

30 Sep 11:53:44 - [info] Dashboard version 3.6.0 started at /ui

30 Sep 11:53:44 - [info] Settings file : /Users/alanblind/.node-red/settings.js

30 Sep 11:53:44 - [info] Context store : 'default' [module=memory]

30 Sep 11:53:44 - [info] User directory : /Users/alanblind/.node-red

30 Sep 11:53:44 - [info] Projects directory: /Users/alanblind/.node-red/projects

30 Sep 11:53:44 - [info] Server now running at http://127.0.0.1:1880/

30 Sep 11:53:44 - [info] Active project : AudioHijack

30 Sep 11:53:44 - [info] Flows file : /Users/alanblind/.node-red/projects/AudioHijack/flows.json

30 Sep 11:53:44 - [warn] Using unencrypted credentials

30 Sep 11:53:44 - [info] Starting flows

30 Sep 11:53:44 - [info] Started flows

Last login: Sat Sep 30 08:22:37 on ttys000

caffeinate node-red

alanblind@Alans-Mac-Studio ~ % caffeinate node-red

30 Sep 11:53:42 - [info]

Correction:

The FIRST click of the dashboard widget has a msg.payload, triggers the EXEC node to command the file to open, then the second widget click on ANY widget, does not give a msg.payload. There after it is every other click is good/not good.

Triggering the EXEC command to open a file seems to cause the next click of a widget to not work, then, it works again......trigger the EXEC to open a file.....Repeat.

Alan

Configure the debug node to ouput to the console (which is the log) as well as the browser. Start node red in a command window as before and see whether you get the debug output in the log

Also can you try a different browser?

Thanks Colin

To be clear, after the Dashboard Widget fires the EXEC node to open a file, NONE of the Dashboard widgets show an output. Then, after pushing a widget, with no output....all is good again.....then repeat.

Good news...I switched from Mac Safari to Mac Chrome.....all good.

Tried again on Safari, still problem.

Are we at the end of the road?

Alan

A year ago this would have read "internet explorer". Safari is earning itself a bad rep me thinks.

Update

I tried Safari on a different Mac Safari (Intel) instead of the problem Mac Safari (M2). All good.

My problem now. Sorry for taking up the bandwidth.

Alan

hmmm - yes I have been seeing some weird click behaviour with Safari recently. Like main click not registering and right click behaving like main click on release.

I now see what is happening. It is not browser or Node-Red related.

The file I am opening with the EXEC node is a script that controls the API in a Mac Application, Audio Hijack.

When the script runs, the focus changes to AudioHijack, away from the Web Browser.

Hence, the "appearance" the second click on the Node-Red widget does not work.....because the browser is no longer in focus.

Clicking again on the browser, a second time, brings the browser into focus, then the Node-Red widget works.

Alan

Problem now understood and solved.

I added a second command, to return focus to the web browser application.

Now, the script runs and moves focus to AudioHijack. Second command runs, opens Safari (returning it to focus). All good.

Alan

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.