steffenmllr / node-red-contrib-sonoff-tasmota

Connect Sonoff Devices running the Sonoff-Tasmota firmware easy to node red

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advantages over "standard" MQTT nodes?

ulab opened this issue · comments

commented

Perhaps you could list some advantages over "standard" MQTT nodes in your documentation? Why would I want to install this?

Those are the standard mqtt nodes. They are just wrapped within the ui.

To be hontest, I just wanted a clean interface with a Boolean input and output that takes care of connecting and getting the mqtt status.

I would be open to a PR if you want to use it with a "standard" MQTT node" - it just wan't my use case so far.

commented

I am very new to Node-Red / MQTT, so I just wasn't sure why you created your own node and if it did anything other than what I cobbled together so far :). I was looking for Node-Red examples for Tasmota devices.

screenshot-2017-12-7 node-red ulab duckdns org

Using the MQTT in node makes sure the switch is always in the right state, even if anything else sends out a switching command.

[
    {
        "id": "9d815f31.91e098",
        "type": "mqtt in",
        "z": "96e60af4.0f30a8",
        "name": "",
        "topic": "stat/S20/POWER",
        "qos": "2",
        "broker": "d47db925.d79598",
        "x": 200,
        "y": 160,
        "wires": [
            [
                "df72b4a4.873598"
            ]
        ]
    },
    {
        "id": "df72b4a4.873598",
        "type": "ui_switch",
        "z": "96e60af4.0f30a8",
        "name": "",
        "label": "Socket",
        "group": "35aecb21.bade74",
        "order": 4,
        "width": 0,
        "height": 0,
        "passthru": false,
        "decouple": "true",
        "topic": "cmnd/S20/POWER",
        "style": "",
        "onvalue": "ON",
        "onvalueType": "str",
        "onicon": "",
        "oncolor": "",
        "offvalue": "OFF",
        "offvalueType": "str",
        "officon": "",
        "offcolor": "",
        "x": 400,
        "y": 160,
        "wires": [
            [
                "e92eac9b.05eb38"
            ]
        ]
    },
    {
        "id": "e92eac9b.05eb38",
        "type": "mqtt out",
        "z": "96e60af4.0f30a8",
        "name": "",
        "topic": "",
        "qos": "",
        "retain": "",
        "broker": "d47db925.d79598",
        "x": 590,
        "y": 160,
        "wires": []
    },
    {
        "id": "78f19cb6.24628c",
        "type": "inject",
        "z": "96e60af4.0f30a8",
        "name": "On / Off",
        "topic": "cmnd/S20/POWER",
        "payload": "toggle",
        "payloadType": "str",
        "repeat": "",
        "crontab": "",
        "once": false,
        "x": 410,
        "y": 120,
        "wires": [
            [
                "e92eac9b.05eb38"
            ]
        ]
    },
    {
        "id": "d47db925.d79598",
        "type": "mqtt-broker",
        "z": "",
        "broker": "localhost",
        "port": "1883",
        "clientid": "",
        "usetls": false,
        "compatmode": true,
        "keepalive": "60",
        "cleansession": true,
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": ""
    },
    {
        "id": "35aecb21.bade74",
        "type": "ui_group",
        "z": "",
        "name": "Living Room",
        "tab": "1302fa6c.612db6",
        "order": 1,
        "disp": true,
        "width": "6"
    },
    {
        "id": "1302fa6c.612db6",
        "type": "ui_tab",
        "z": "",
        "name": "Lights",
        "icon": "dashboard",
        "order": 1
    }
]

I much prefer this node because it allows for simpler flows. You only need one node as opposed to two.