Send specific payload with input_boolean

Hello there,
i wanted to build a switch for my guestwifi with my fritzbox router. which works very nice inside node-RED with an inject node. to turn it on or off i need to send the JSON payload
‘{“NewEnable”:“1”}’ or ‘{“NewEnable”:“0”}’.
So how do i tell the input_boolean.guestwifi to send these two payloads when its toggled on or off?

maybe its so simple and i overthink this, but i cant get my head around this problem.
thanks!

Nobody? Or is it so obvious?

The input_boolean sends an on/off. You could easily do it this way:

You can use a function node to define the message yourself, or simply use a change node. Just change the payload from the Input_boolean to be the desired JSON Object. Before that you probably want to filter with a switch node for on & off state of the boolean.

Like this:

[
    {
        "id": "80b13b00.3bd6c8",
        "type": "server-state-changed",
        "z": "6b8efe0d.bc75e",
        "name": "",
        "server": "2fba4297.e4145e",
        "version": 1,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "input_boolean.abkuhlen",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 1,
        "output_only_on_state_change": true,
        "x": 880,
        "y": 540,
        "wires": [
            [
                "afabc574.ef25f8"
            ]
        ]
    },
    {
        "id": "afabc574.ef25f8",
        "type": "switch",
        "z": "6b8efe0d.bc75e",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "on",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "off",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 1110,
        "y": 540,
        "wires": [
            [
                "261d3bf9.b9dc54"
            ],
            [
                "cb1a415d.7371e"
            ]
        ]
    },
    {
        "id": "261d3bf9.b9dc54",
        "type": "change",
        "z": "6b8efe0d.bc75e",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "{\"NewEnable\":\"1\"}",
                "tot": "json"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1290,
        "y": 500,
        "wires": [
            []
        ]
    },
    {
        "id": "cb1a415d.7371e",
        "type": "change",
        "z": "6b8efe0d.bc75e",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "{\"NewEnable\":\"0\"}",
                "tot": "json"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1290,
        "y": 580,
        "wires": [
            []
        ]
    },
    {
        "id": "2fba4297.e4145e",
        "type": "server",
        "z": "",
        "name": "Home Assistant",
        "legacy": false,
        "addon": true,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true
    }
]