node-red-dashboard icon indicating copy to clipboard operation
node-red-dashboard copied to clipboard

Switch node not accepting string as output

Open koos147 opened this issue 9 months ago • 3 comments

I used the script to install "4.0.9: Maintenance Release" on a raspberry pi 2 B After this i installed the "node-red-dashboard 3.6.5" from within the web gui.

When i add a switch its default is

Image

I will change this to the string 1 and 0 (not a number) Image When i save this and re-open the node. it shows

Image

As a workaround i tried to export the node config

When importing this the value looks good, but the node isn't working.

[
    {
        "id": "5cf2bec14b183a34",
        "type": "ui_switch",
        "z": "e2202e2fe14edf22",
        "name": "Gasfornuis",
        "label": "Gasfornuis",
        "tooltip": "Keuken",
        "group": "1dfeeb7fba195853",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": false,
        "decouple": "true",
        "topic": "topic",
        "topicType": "msg",
        "style": "",
        "onvalue": 1,
        "onvalueType": "str",
        "onicon": "",
        "oncolor": "",
        "offvalue": "0",
        "offvalueType": "str",
        "officon": "",
        "offcolor": "",
        "animate": false,
        "className": "",
        "x": 630,
        "y": 140,
        "wires": [
            [
                "da3e82555b386235"
            ]
        ]
    }
   ]

For the people reading dutch... no it is simply the light above the gas stove. not the stove itself.

koos147 avatar Mar 31 '25 13:03 koos147

https://github.com/node-red/node-red/pull/3481 removes the strict comparison in:

https://github.com/node-red/node-red/blob/23c44db30d0a97ca4ae86a4e56627272a0f8723b/packages/node_modules/%40node-red/editor-client/src/js/ui/editors/panes/properties.js#L160-L162

GogoVega avatar Mar 31 '25 14:03 GogoVega

For clarification

node-red/node-red#3481 removes the strict comparison in:

it was always un-strict

Diff: http://github.com/node-red/node-red/pull/3481/files#diff-9479454a4838f59360af16906d3e60835d054a2e1478d96c3b16ce2d658f6437L110

Steve-Mcl avatar Apr 01 '25 07:04 Steve-Mcl

I am not sure, see the pull request is open. I am not a die hard user. do i need to test something or is it best to wait for the next release?

koos147 avatar Apr 03 '25 06:04 koos147