Button not sending `topic` as I see it

Although it is the button node, it is more to do with the message coming out of it.

This is the node code:

[
    {
        "id": "89af2b10f87e66e9",
        "type": "ui_button",
        "z": "f6a2d75e7dd8f7ed",
        "name": "",
        "group": "66644b9721f1197e",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "Start",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "TRIP",
        "payloadType": "str",
        "topic": "TRAIN",
        "topicType": "msg",
        "x": 350,
        "y": 370,
        "wires": [
            [
                "0f5725cd2cbfc233",
                "a5d2da0031c49502"
            ]
        ]
    },
    {
        "id": "66644b9721f1197e",
        "type": "ui_group",
        "name": "Control",
        "tab": "530b9cb957853dd9",
        "order": 1,
        "disp": true,
        "width": "3",
        "collapse": false,
        "className": ""
    },
    {
        "id": "530b9cb957853dd9",
        "type": "ui_tab",
        "name": "Track Singal NEW",
        "icon": "dashboard",
        "order": 43,
        "disabled": false,
        "hidden": false
    }
]

The topic field is set to TRAIN.

But this is what I see when I press it:

Where's the topic?

Change the topic to string, not msg

Hi @Trying_to_learn Maybe you need to define first the msg.TRAIN property. Because you are asign msg.TRAIN to msg.topic, and msg.TRAIN is empty.

I share some examples:

Code:

[{"id":"ad061c48fbfd7f1a","type":"tab","label":"Flow 10","disabled":false,"info":"","env":[]},{"id":"7c08f886948a062c","type":"ui_button","z":"ad061c48fbfd7f1a","name":"","group":"1839522db6d21ee9","order":0,"width":0,"height":0,"passthru":true,"label":"button","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"TRIP","payloadType":"str","topic":"TRAIN","topicType":"str","x":850,"y":160,"wires":[["913cc5d5b3e72bcd"]]},{"id":"913cc5d5b3e72bcd","type":"debug","z":"ad061c48fbfd7f1a","name":"debug 14","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":980,"y":160,"wires":[]},{"id":"ec7f6b08633360bf","type":"inject","z":"ad061c48fbfd7f1a","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":730,"y":160,"wires":[["7c08f886948a062c"]]},{"id":"94a47739bd802c06","type":"ui_button","z":"ad061c48fbfd7f1a","name":"","group":"1839522db6d21ee9","order":0,"width":0,"height":0,"passthru":true,"label":"button","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"TRIP","payloadType":"str","topic":"TRAIN","topicType":"msg","x":850,"y":100,"wires":[["a6bf3b5257831bab"]]},{"id":"a6bf3b5257831bab","type":"debug","z":"ad061c48fbfd7f1a","name":"debug 15","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":980,"y":100,"wires":[]},{"id":"760c8d269517f784","type":"inject","z":"ad061c48fbfd7f1a","name":"","props":[{"p":"payload"},{"p":"TRAIN","v":"this is the topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":730,"y":100,"wires":[["94a47739bd802c06"]]},{"id":"1839522db6d21ee9","type":"ui_group","name":"Default","tab":"7394f2f3aeaeeb2d","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"7394f2f3aeaeeb2d","type":"ui_tab","name":"Tab 1","icon":"dashboard","disabled":false,"hidden":false}]

I hope it can helps you!!

When did this get introduced?

It may explain why a lot of stuff has stopped working recently too. :frowning: :cry:

Thanks both for the replies.

Seems I really stuffed myself up there.
Appreciated.

1 Like

I don't think the default setting has been changed, but in anycase it wouldn't alter any existing buttons

Well, maybe it hasn't "back rolled" to existing things, but I am writing a lot of stuff just now and it is failing hand over fist as in I am pressing buttons and things NOT happening.

I was simply doing what I always did and not seeing the qualifier has changed from text to msg so never even thought of seeing it.
(Familiarity blindness - I guess)

TBH I probably copy nodes more often than add new ones, so the text setting gets carried to the new node.

1 Like

I'm torn doing that only in that if the structure (more so for function nodes than button nodes) it spreads bad formatting/code.

I would like to type things so I develop the muscle memory on how to do things the better way rather than copy/paste.
There can be nasty things propagated that way too.

But, I do get what you are saying.

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