Shelly Button with mqtt Nr flow

Dylantje
Thu, 28 Mar 2024 06:17:46 +0000
General

Shelly Button.
Wifi and mqtt.
Would love to read it with a flow...
I use domoticz, in combination with node red. [not a programmer:-( ]

Doesn't seem that difficult,
shellies/Shel-Button-Urinal-gen1/input_event

Where I need the "S" or the "L" as a command

The node output:
code:

28-3-2024 07:06:32node: debug 594
shellies/Shel-Button-Urinal-gen1/input_event/0 : msg.payload : Object
object
event: "S"
event_cnt: 154

Or:

28-3-2024 07:06:51node: debug 594
shellies/Shel-Button-Urinal-gen1/input_event/0 : msg.payload : Object
object
event: "L"
event_cnt: 155

But I can't get the conversion from S to 1 [what Domoticz asks] right.

The flow:

[
    {
        "id": "2e2e6911.9a6a24",
        "type": "mqtt in",
        "z": "abbfc042b66eb59c",
        "name": "",
        "topic": "shellies/Shel-Button-Urinoir-gen1/input_event/0",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "4aaf39db27167f71",
        "nl": false,
        "rap": false,
        "inputs": 0,
        "x": 220,
        "y": 220,
        "wires": [
            [
                "2d9fa652.3e1de2",
                "931131d253083fae"
            ]
        ]
    },
    {
        "id": "2d9fa652.3e1de2",
        "type": "switch",
        "z": "abbfc042b66eb59c",
        "name": "Filter aan/uit",
        "property": "payload.event",
        "propertyType": "global",
        "rules": [
            {
                "t": "cont",
                "v": "\"S\"",
                "vt": "global"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 570,
        "y": 220,
        "wires": [
            [
                "f174a170449f7f5d",
                "5493943e93d0c59d"
            ]
        ]
    },
    {
        "id": "9ed66094.aa7cb8",
        "type": "mqtt out",
        "z": "abbfc042b66eb59c",
        "name": "",
        "topic": "domoticz/in",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "4aaf39db27167f71",
        "x": 1050,
        "y": 220,
        "wires": []
    },
    {
        "id": "931131d253083fae",
        "type": "debug",
        "z": "abbfc042b66eb59c",
        "name": "debug 593",
        "active": false,
        "tosidebar": true,
        "console": true,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 550,
        "y": 280,
        "wires": []
    },
    {
        "id": "f174a170449f7f5d",
        "type": "debug",
        "z": "abbfc042b66eb59c",
        "name": "debug 594",
        "active": true,
        "tosidebar": true,
        "console": true,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 710,
        "y": 60,
        "wires": []
    },
    {
        "id": "5493943e93d0c59d",
        "type": "change",
        "z": "abbfc042b66eb59c",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "\"S\"",
                "fromt": "flow",
                "to": "1",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 800,
        "y": 220,
        "wires": [
            [
                "753d97f777a7e6db",
                "9ed66094.aa7cb8"
            ]
        ]
    },
    {
        "id": "753d97f777a7e6db",
        "type": "debug",
        "z": "abbfc042b66eb59c",
        "name": "debug 595",
        "active": false,
        "tosidebar": true,
        "console": true,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 970,
        "y": 140,
        "wires": []
    },
    {
        "id": "4aaf39db27167f71",
        "type": "mqtt-broker",
        "name": "",
        "broker": "192.168.5.70",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "verifyservercert": true,
        "protocolVersion": "3",
        "keepalive": "15",
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "Domoticz",
        "birthQos": "2",
        "birthRetain": "true",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]

Maybe someone does O-)

13 posts - 5 participants