# Switch Fibaro wall plug on/off

**URL:** <https://discourse.nodered.org/t/switch-fibaro-wall-plug-on-off/81394>\
**Category:** General\
**Created:** [17 September 2023 10:14 UTC](https://discourse.nodered.org/t/switch-fibaro-wall-plug-on-off/81394 "2023-09-17T10:14:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![barnyundmax](https://avatars.discourse-cdn.com/v4/letter/b/b38774/32.png) [@barnyundmax](https://discourse.nodered.org/u/barnyundmax)\
**Post date:** [17 September 2023 10:14 UTC](https://discourse.nodered.org/t/switch-fibaro-wall-plug-on-off/81394/1 "2023-09-17T10:14:08Z")

</div>

Hi all, i am quite new in using Node Red.  
I try to build a flow to switch a FIBARO wall plug on/off via a switch node.  
The wall plug is working when i switch it on/off via Z-WAVE JS -\> binary switch -\> target value.  
Inside my flow i will receive the following error:  
17.9.2023, 12:07:35[node: Wohnzimmer Steckdose](http://192.168.1.36:1880/#)msg : error  
"Error: Only modes: CCAPI,ValueAPI are allowed through this node type."  
But i can't find usefull information about the error.

```auto
[
    {
        "id": "534cc7cc1e8eb893",
        "type": "ui_switch",
        "z": "b9b31cf0f070f6c2",
        "name": "Steckdose Wohnzimmer",
        "label": "Steckdose Wohnzimmer",
        "tooltip": "",
        "group": "af4f1a5de982cf71",
        "order": 6,
        "width": 0,
        "height": 0,
        "passthru": false,
        "decouple": "false",
        "topic": "payload",
        "topicType": "msg",
        "style": "",
        "onvalue": "true",
        "onvalueType": "bool",
        "onicon": "",
        "oncolor": "",
        "offvalue": "false",
        "offvalueType": "bool",
        "officon": "",
        "offcolor": "",
        "animate": true,
        "className": "",
        "x": 230,
        "y": 200,
        "wires": [
            [
                "b81d2e2f5e9531e8"
            ]
        ],
        "info": "var g_alarm = msg.payload"
    },
    {
        "id": "7ca7c7c312be5c2a",
        "type": "ui_template",
        "z": "b9b31cf0f070f6c2",
        "group": "af4f1a5de982cf71",
        "name": "Steckdose Wohnzimmer",
        "order": 5,
        "width": 0,
        "height": 0,
        "format": "<div layout=\"row\" layout-align=\"space-between center\" style=\"padding: 0 6px;\">\n <p>Steckdose Wohnzimmer</p>\n <font color=\"{{msg.payload ? 'green' : 'red'}}\">\n {{msg.payload ? 'ein' : 'aus'}}\n <i class=\"fa fa-square\" aria-hidden=\"true\"></i>\n </font>\n</div>",
        "storeOutMessages": true,
        "fwdInMessages": true,
        "resendOnRefresh": true,
        "templateScope": "local",
        "className": "",
        "x": 1030,
        "y": 200,
        "wires": [
            []
        ]
    },
    {
        "id": "b81d2e2f5e9531e8",
        "type": "zwave-device",
        "z": "b9b31cf0f070f6c2",
        "networkIdentifier": 1,
        "name": "Wohnzimmer Steckdose",
        "filteredNodeId": "2",
        "multicast": false,
        "datamode": "Send/Receive",
        "messagesPerMS": 1,
        "messageInterval": 250,
        "isolated": true,
        "outputs": 1,
        "inputs": 1,
        "showStatus": true,
        "x": 670,
        "y": 200,
        "wires": [
            [
                "7ca7c7c312be5c2a"
            ]
        ]
    },
    {
        "id": "d372f27556593d08",
        "type": "inject",
        "z": "b9b31cf0f070f6c2",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 170,
        "y": 260,
        "wires": [
            [
                "b81d2e2f5e9531e8"
            ]
        ]
    },
    {
        "id": "fcce5d57fced75f6",
        "type": "inject",
        "z": "b9b31cf0f070f6c2",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "false",
        "payloadType": "bool",
        "x": 170,
        "y": 300,
        "wires": [
            [
                "b81d2e2f5e9531e8"
            ]
        ]
    },
    {
        "id": "af4f1a5de982cf71",
        "type": "ui_group",
        "name": "Überwachung",
        "tab": "24c6f17501e9810b",
        "order": 3,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "24c6f17501e9810b",
        "type": "ui_tab",
        "name": "Räume",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

```

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [19 September 2023 16:19 UTC](https://discourse.nodered.org/t/switch-fibaro-wall-plug-on-off/81394/2 "2023-09-19T16:19:51Z")

</div>

Hi @barnyundmax - Welcome to the forums.

You are not sending a valid Command to the Device.

You are sending a boolean - nothing more, but devices have various Zwave Data Types, so you must tell the device what data type (or Command Class in Zwave Terms) that this boolean value relates to.

Therefore, if you want to turn a Binary switch value off, you need to.

- Tell the device this is for a Binary Switch (remember devices have various types)
- Give it the value.

Sending this to the device - will turn it on (using a `function` node).

You can also use the `CMD Factory` Node - but if new to Node RED, this might be a little daunting

```auto
let ValueID = {
      "commandClass": 37 /* 37 - Binary Switch */
      "endpoint": 0, /* A Device can have multiple Binary Switches */
      "property": "targetValue",
}
let Message = {
    "payload": {
        "mode": "ValueAPI",
        "method": "setValue",
        "params": [ValueID,true]
    }
}
return Message

```

Example I have a siren that has a Binary switch and a Colour Switch, so when I send it a value - I need to address what property this value belongs - that's the job of the ValueID

See here:

> **[Value API](https://github.com/zwave-js/node-red-contrib-zwave-js/wiki/Value-API)**
>
> The most powerful, high performing and highly polished Z-Wave node for Node-RED based on Z-Wave JS. If you want a fully featured Z-Wave framework in your Node-RED instance, you have found it. - zwa...

**Also Note:**  
The Side Bar has a message log - that will print the commands being sent via the side bar - so you can copy and paste and reuse in the flow

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 November 2023 16:20 UTC](https://discourse.nodered.org/t/switch-fibaro-wall-plug-on-off/81394/3 "2023-11-18T16:20:48Z")

</div>

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