How to set the ui button that will on click it should send value 1 and after release it should send 0

I want to create a ui button for dashboard that will perform the following function

On Click it should send value one and after release it should send value 0 like a push button

I don't believe you can. Only the click event is defined.

You will need to use a ui_template node to create your own button and add the appropriate event handlers.

I was able to create it in ui template node is there a way to add some delay between the events

[
    {
        "id": "0700c9ae90deec91",
        "type": "ui_template",
        "z": "7cfb14150528f229",
        "group": "722e3efd98038504",
        "name": "PSU 1",
        "order": 15,
        "width": 3,
        "height": 1,
        "format": "<button class=\"resetButton\" ng-mousedown=\"send({payload: 1})\"   ng-mouseup=\"send({payload: 0})\" style=\"border-radius:20px;padding-top:7px;padding-bottom:7px; border: 1px solid #ffc65f;background-color: white;font-family:quicksand; margin-top:1px; \">Reset</button>\n<style>\n    .resetButton:hover{\n        background-color: #f9f9f9 !important;\n    }\n</style>",
        "storeOutMessages": true,
        "fwdInMessages": true,
        "resendOnRefresh": false,
        "templateScope": "local",
        "className": "",
        "x": 870,
        "y": 280,
        "wires": [
            [
                "bf6296581a8d70e6"
            ]
        ]
    },
    {
        "id": "722e3efd98038504",
        "type": "ui_group",
        "name": "Power Supply",
        "tab": "0770fd16725d9e83",
        "order": 9,
        "disp": true,
        "width": "23",
        "collapse": false,
        "className": ""
    },
    {
        "id": "0770fd16725d9e83",
        "type": "ui_tab",
        "name": "power supply",
        "icon": "dashboard",
        "order": 10,
        "disabled": false,
        "hidden": false
    }
]

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